/* Content pages (features, guides, install docs) and legal pages.
   Builds on gx.css tokens + home.css (header, footer, buttons, FAQ, final CTA).
   Readable measure (--gx-measure ≈ 68ch); on wide screens the page's own
   table of contents becomes a sticky side column. */

.page { padding-top: 8px; }
.page-wrap { padding-bottom: 24px; }

/* Breadcrumbs */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 16px 0 28px; padding: 0; list-style: none; font-size: var(--gx-text-sm); color: var(--gx-muted); }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs li + li::before {
  content: ""; width: 16px; height: 16px; opacity: .7;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
[dir="rtl"] .crumbs li + li::before { transform: scaleX(-1); }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; color: var(--gx-muted); text-decoration: none; }
.crumbs a:hover { color: var(--gx-primary-text); text-decoration: underline; }
.crumbs [aria-current] { color: var(--gx-fg); font-weight: 600; }

/* Article layout: one readable column; sticky TOC beside it when there is room. */
.prose > article, .prose.legal { display: grid; grid-template-columns: minmax(0, var(--gx-measure)); column-gap: 64px; }
.prose > article > *, .prose.legal > * { grid-column: 1; min-width: 0; }
@media (min-width: 1100px) {
  .prose > article:has(> .toc), .prose.legal:has(> .toc) { grid-template-columns: minmax(0, var(--gx-measure)) minmax(200px, 260px); }
  .prose > article > .toc, .prose.legal > .toc {
    grid-column: 2; grid-row: 1 / span 400; align-self: start;
    position: sticky; top: calc(var(--hdr-h) + 24px); max-height: calc(100dvh - var(--hdr-h) - 48px); overflow-y: auto; margin: 6px 0 0;
  }
}

/* Type */
.prose { color: var(--gx-fg-2); font-size: 1.0625rem; line-height: 1.7; }
.prose h1 { font-size: var(--gx-text-4xl); font-weight: 800; letter-spacing: -.03em; color: var(--gx-fg); margin: 0 0 16px; }
.prose .lead { font-size: var(--gx-text-xl); color: var(--gx-muted); margin: 0 0 32px; line-height: 1.55; }
.prose h2 { font-size: var(--gx-text-2xl); font-weight: 800; color: var(--gx-fg); margin: 56px 0 14px; scroll-margin-top: calc(var(--hdr-h) + 16px); }
.prose h3 { font-size: var(--gx-text-lg); font-weight: 750; color: var(--gx-fg); margin: 28px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-inline-start: 22px; margin: 0 0 20px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--gx-subtle); }
.prose strong { color: var(--gx-fg); }
.prose a { color: var(--gx-primary-text); text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose a.gx-btn, .prose a.btn { text-decoration: none; }
.prose a.btn-primary { /* legacy class in page fragments */
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: var(--gx-r-sm);
  background: var(--gx-primary); color: var(--gx-on-primary); font-weight: 650;
  transition: background-color var(--gx-dur-1) var(--gx-ease-out), transform var(--gx-dur-1) var(--gx-ease-out);
}
.prose a.btn-primary:hover { background: var(--gx-primary-hover); }
.prose a.btn-primary:active { transform: scale(.97); }
.prose code { font-size: .88em; }

/* Code blocks (home.js adds a copy button) */
.code-block { position: relative; margin: 0 0 20px; }
.prose pre {
  margin: 0 0 20px; padding: 18px 20px; border-radius: var(--gx-r-md); overflow-x: auto;
  background: #0b1220; border: 1px solid #1e293b; color: #bfdbfe; font-size: 14px; line-height: 1.65;
}
.code-block pre { margin: 0; padding-inline-end: 96px; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.copy-mini { position: absolute; top: 8px; inset-inline-end: 8px; min-height: 36px; padding: 0 12px; }
li > .code-block, li > pre { margin-top: 10px; }

/* "In short" box */
.prose .tldr { margin: 0 0 24px; padding: 20px 24px; border-radius: var(--gx-r-lg); background: var(--gx-primary-soft); border: 1px solid color-mix(in srgb, var(--gx-primary) 22%, transparent); }
.prose .tldr > :last-child { margin-bottom: 0; }
.prose .tldr pre { margin-bottom: 12px; }

/* Check lists */
.prose .checks { list-style: none; padding-inline-start: 0; }
.prose .checks li { position: relative; padding-inline-start: 32px; margin: 10px 0; }
.prose .checks li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .25em; width: 20px; height: 20px; border-radius: 50%;
  background: var(--gx-online-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* Feature cards */
.prose .feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0 24px; }
.prose .card { padding: 18px 20px; border-radius: var(--gx-r-md); background: var(--gx-surface); border: 1px solid var(--gx-border); box-shadow: var(--gx-shadow-sm); transition: border-color var(--gx-dur-2) var(--gx-ease-out), box-shadow var(--gx-dur-2) var(--gx-ease-out); }
.prose .card:hover { border-color: var(--gx-border-strong); box-shadow: var(--gx-shadow-md); }
.prose .card h3 { margin: 0 0 6px; font-size: var(--gx-text-md); }
.prose .card p { margin: 0; font-size: var(--gx-text-sm); color: var(--gx-muted); line-height: 1.6; }

/* Tables scroll inside their own box on small screens */
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: var(--gx-text-sm); }
.prose th, .prose td { padding: 12px 10px; border-bottom: 1px solid var(--gx-border); text-align: start; vertical-align: top; }
.prose th { color: var(--gx-fg); font-weight: 700; background: var(--gx-bg-subtle); }
@media (max-width: 719px) { .prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; } .prose th, .prose td { min-width: 150px; } }

/* Table of contents */
.prose .toc { margin: 0 0 36px; padding: 16px 18px; border-radius: var(--gx-r-md); border: 1px solid var(--gx-border); background: var(--gx-bg-subtle); }
.prose .toc::before { content: "On this page"; display: block; margin-bottom: 6px; font-size: var(--gx-text-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gx-muted); }
.prose .toc a {
  display: flex; align-items: center; min-height: 36px; padding: 4px 10px; margin-inline-start: -10px; border-radius: var(--gx-r-xs);
  border-inline-start: 2px solid transparent; color: var(--gx-fg-2); text-decoration: none; font-size: var(--gx-text-sm); line-height: 1.4;
  transition: color var(--gx-dur-1) var(--gx-ease-out), background-color var(--gx-dur-1) var(--gx-ease-out), border-color var(--gx-dur-2) var(--gx-ease-out);
}
.prose .toc a:hover { background: var(--gx-surface-2); color: var(--gx-fg); }
.prose .toc a[aria-current] { color: var(--gx-primary-text); border-inline-start-color: var(--gx-primary); background: var(--gx-primary-soft); font-weight: 650; }
@media (min-width: 1100px) { .prose .toc { background: transparent; border: 0; padding: 0 0 0 4px; } }

/* FAQ inside an article */
.prose .faq { margin: 8px 0 0; }
.prose .faq summary { font-size: var(--gx-text-md); }
.prose .faq details p { padding-inline-end: 0; }

.prose .updated { margin: 48px 0 0; padding-top: 16px; border-top: 1px solid var(--gx-border); font-size: var(--gx-text-sm); color: var(--gx-subtle); }
.prose.legal .updated { margin: 0 0 28px; padding: 0; border: 0; }

@media (max-width: 599px) {
  .prose { font-size: 1rem; }
  .prose .feature-grid { grid-template-columns: 1fr; }
  .prose .lead { font-size: var(--gx-text-lg); }
  .prose .tldr { padding: 16px; }
  .code-block pre { padding-inline-end: 20px; padding-top: 52px; }
}
@media (prefers-reduced-motion: reduce) { .prose .card:hover { box-shadow: var(--gx-shadow-sm); } }
