/* ==========================================================================
   DOCS PAGE STYLES: used only by components.html and documentation/.
   Safe to delete from a production site.
   ========================================================================== */

.doc-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(247, 246, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border-subtle);
}
.doc-topbar .container-xl { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.doc-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-heading); font-weight: 600; font-size: 1.125rem;
  color: var(--color-text-brand); text-decoration: none;
}
.doc-brand-mark {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
}
.doc-brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.doc-brand-mark .icon { width: 18px; height: 18px; vertical-align: 0; }
.doc-topnav { display: flex; gap: 4px; }
.doc-topnav a {
  padding: 8px 14px; border-radius: var(--radius-md);
  font-size: 0.9375rem; font-weight: 600; text-decoration: none; color: var(--color-text-secondary);
}
/* Top links: icon + text. On small screens the text hides and only the icon shows. */
.doc-topnav a { display: inline-flex; align-items: center; gap: 8px; }
.doc-topnav .icon { width: 18px; height: 18px; vertical-align: 0; flex: none; }
@media (max-width: 991.98px) {
  .doc-topnav a { justify-content: center; width: 42px; height: 42px; padding: 0; }
  .doc-topnav-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.doc-topnav a:hover { background: var(--color-bg-surface); color: var(--color-text-brand); }
.doc-topnav a[aria-current="page"] { background: var(--color-bg-surface); color: var(--color-text-brand); }

.doc-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 56px; padding-block: 48px 96px; }
/* Component pages: no sidebar, full-width content (the mega menu lists every component) */
.container > .doc-main { padding-block: 48px 96px; }
.doc-sidebar { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; }
.doc-sidebar h2 {
  margin: 0 0 12px; font-family: var(--font-body); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-accent);
}
.doc-sidebar ul { list-style: none; margin: 0 0 28px; padding: 0; }
.doc-sidebar a {
  display: block; padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 0.9375rem; text-decoration: none; color: var(--color-text-secondary);
}
.doc-sidebar a:hover { background: var(--color-bg-surface); color: var(--color-text-brand); }

.doc-main { min-width: 0; }
.doc-hero { padding-bottom: 40px; border-bottom: 1px solid var(--color-border-default); margin-bottom: 56px; }
.doc-hero p { max-width: 62ch; }

.doc-section { padding-top: 8px; margin-bottom: 72px; scroll-margin-top: 88px; }
.doc-section > .section-head { margin-bottom: 28px; }
.doc-section > .section-head p { max-width: 70ch; margin: 8px 0 0; color: var(--color-text-secondary); }
.doc-section h3.demo-title {
  margin: 32px 0 12px; font-family: var(--font-body); font-size: 0.8125rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-secondary);
}

/* The rendered example */
.demo {
  padding: 32px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.demo + .demo-code { margin-bottom: 0; }
.demo-code {
  margin: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-subtle);
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.demo-code > summary {
  padding: 10px 20px; cursor: pointer; font-size: 0.8125rem; font-weight: 600; color: var(--color-text-link);
  border-top: 1px solid var(--color-border-subtle); list-style: none;
}
.demo-code > summary::-webkit-details-marker { display: none; }
.demo-code > summary::before { content: "</>"; margin-right: 8px; font-family: ui-monospace, monospace; color: var(--color-text-accent); }
.demo-code[open] > summary { border-bottom: 1px solid var(--color-border-subtle); }
.demo-code-body { position: relative; }
.demo-code pre {
  margin: 0; padding: 20px; max-height: 360px; overflow: auto;
  background: var(--green-950); color: var(--green-200);
  font-size: 0.8125rem; line-height: 1.65; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.demo-copy {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  padding: 4px 12px; font-size: 0.75rem; font-weight: 600; color: var(--color-text-inverse);
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: var(--radius-sm);
}
.demo-copy:hover { background: rgba(255, 255, 255, 0.22); }

/* Demo layout helpers */
.demo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.demo-stack { display: grid; gap: 24px; }
.demo-stack > * { max-width: 440px; }
.demo-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.demo-dark { background: var(--color-bg-inverse); border-color: var(--color-bg-inverse); }

/* Documentation prose and code snippets */
.doc-prose p, .doc-prose li { max-width: 75ch; }
/* Lists in the documentation text only. Lists inside a .demo are real components and keep their own spacing. */
.doc-prose :is(ul, ol):not(.demo *, [class]) { padding-left: 1.4rem; margin-bottom: 1rem; }
.doc-prose li:not(.demo *) { margin-bottom: 0.4rem; }
.doc-prose a { font-weight: 500; }
.doc-snippet {
  margin: 16px 0 20px; padding: 20px; overflow: auto;
  background: var(--green-950); color: var(--green-200);
  font-size: 0.8125rem; line-height: 1.65; border-radius: var(--radius-lg);
}
.doc-prose .doc-snippet code { padding: 0; color: inherit; background: none; font-size: inherit; white-space: pre; border-radius: 0; }
/* Class reference tables */
.doc-table { width: 100%; margin-top: 16px; font-size: 0.9375rem; border-collapse: collapse; }
.doc-table th, .doc-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--color-border-subtle); }
.doc-table th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-secondary); background: var(--color-bg-subtle); }
.doc-table code, .doc-prose code, p code, li code {
  padding: 2px 6px; font-size: 0.85em; color: var(--green-700);
  background: var(--color-bg-surface); border-radius: 4px;
}

@media (max-width: 991.98px) {
  .doc-layout { grid-template-columns: 1fr; gap: 24px; padding-block: 24px 64px; }
  .container > .doc-main { padding-block: 24px 64px; }
  .doc-sidebar { position: static; max-height: none; }
  .doc-sidebar ul { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
  .doc-sidebar a { background: var(--color-bg-surface); }
  .doc-sidebar-future { display: none; }
  .doc-table { display: block; overflow-x: auto; }
  .demo { padding: 20px; }
}

/* ==========================================================================
   Showcase shell (components/ pages): navigation, pager, extra demo helpers
   ========================================================================== */
body .doc-nav-toggle { display: none; margin-bottom: 12px; }
.doc-nav h2 { margin-top: 4px; }
.doc-nav-all {
  display: block; margin: 0 0 20px; padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-weight: 700; text-decoration: none; color: var(--color-text-brand);
  background: var(--color-bg-surface);
}
.doc-nav a[aria-current="page"] { background: var(--color-bg-surface); color: var(--color-text-brand); font-weight: 700; }
.doc-nav-soon { display: block; padding: 6px 0; font-size: 0.9375rem; color: var(--color-text-disabled); }
.doc-nav li:last-child .doc-nav-soon { padding-bottom: 0; }

.doc-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--color-border-default); }
.doc-pager-link {
  display: flex; flex-direction: column; gap: 2px; min-width: 200px; padding: 14px 20px;
  border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-bg-card);
  text-decoration: none; color: var(--color-text-brand);
}
.doc-pager-link span { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-secondary); }
.doc-pager-link:hover { border-color: var(--color-border-brand); background: var(--color-bg-surface); }
.doc-pager-link.is-next { text-align: right; margin-left: auto; }

/* Demo helpers */
.demo-bleed { padding: 0; overflow: hidden; }
.demo-page { background: var(--color-bg-page); }
.demo-dark { color: var(--color-text-inverse); }
.demo-stage { position: relative; overflow: hidden; border-radius: var(--radius-md); background: var(--color-bg-subtle); }
.api-note { margin-top: 20px; padding: 14px 18px; border-left: 3px solid var(--color-bg-accent); background: var(--color-bg-accent-subtle); border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: 0.9375rem; color: var(--color-text-primary); }
.api-note p { margin: 0; max-width: none; }

.hub-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 0; padding: 0; list-style: none; }
.hub-card {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 18px 20px;
  border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); background: var(--color-bg-card);
  text-decoration: none; color: var(--color-text-brand); transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.hub-card:hover { border-color: var(--color-border-brand); box-shadow: var(--shadow-md); }
.hub-card strong { font-size: 1.0625rem; }
.hub-card span { font-size: 0.875rem; color: var(--color-text-secondary); }
.hub-card.is-soon { background: transparent; border-style: dashed; pointer-events: none; }
.hub-card.is-soon strong { color: var(--color-text-secondary); font-weight: 600; }

@media (max-width: 991.98px) {
  body .doc-nav-toggle { display: inline-flex; }
  .doc-sidebar .doc-nav { display: none; }
  .doc-sidebar.is-open .doc-nav { display: block; padding: 16px; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); background: var(--color-bg-card); }
  .doc-sidebar .doc-nav ul { display: block; margin-bottom: 16px; }
  .doc-sidebar .doc-nav a { background: none; }
  .doc-sidebar .doc-nav a[aria-current="page"], .doc-sidebar .doc-nav .doc-nav-all { background: var(--color-bg-surface); }
  .doc-pager { flex-direction: column; }
  .doc-pager-link, .doc-pager-link.is-next { min-width: 0; text-align: left; margin-left: 0; }
}

.demo-dark-bg { background: var(--color-bg-inverse); border-color: var(--color-bg-inverse); }
.icon-button-photo { position: relative; max-width: 320px; border-radius: var(--radius-lg); overflow: hidden; }
.icon-button-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.icon-button-photo-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }

.demo-stack-full { display: grid; gap: 16px; }
.demo-box, .demo-box-light > .container { padding: 18px 20px; border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-bg-surface); font-size: 0.875rem; color: var(--color-text-brand); }
.header-stage { position: relative; min-height: 220px; background: linear-gradient(135deg, var(--green-900), var(--green-700)); }
.header-stage .site-header { position: absolute; }
.header-stage-copy { padding: 140px 24px 56px; color: rgba(247,246,240,.8); text-align: center; }
/* Header demos on a plain page: leave room under the header so its dropdowns are visible */
.header-stage-copy--page { min-height: 300px; padding: 120px 24px 56px; color: var(--color-text-secondary); background: var(--color-bg-surface); }
.demo-bleed .site-header, .demo-bleed .site-footer { position: relative; z-index: 1; }

/* Back to top docs: live scroll box and static ring states */
.bt-demo { position: relative; height: 260px; overflow: hidden; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-lg); }
.bt-demo-scroll { height: 100%; padding: var(--spacing-lg); overflow-y: auto; }
.bt-demo-scroll p { max-width: 60ch; margin: 0 0 var(--spacing-md); color: var(--color-text-secondary); }
.bt-demo .back-to-top { position: absolute; }
.bt-states { display: flex; flex-wrap: wrap; align-items: center; gap: 36px; padding: 8px 4px; }
.bt-states figure { display: grid; justify-items: center; gap: 14px; margin: 0; font-size: 0.8125rem; color: var(--color-text-secondary); }
.bt-states .back-to-top { position: relative; }

/* ---------- Google Fonts picker (documentation) ---------- */
.fp { border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); background: var(--color-bg-surface); padding: 20px; margin: 20px 0 8px; }
.fp-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.fp-controls .fp-wide { grid-column: 1 / -1; }
.fp label { display: block; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 4px; }
.fp-row { display: flex; gap: 8px; }
.fp-row .form-select { flex: 1; min-width: 0; }
.fp-count { font-size: 13px; color: var(--color-text-secondary); margin: 0 0 12px; }
.fp-stage { border: 1px dashed var(--color-border-default); border-radius: var(--radius-md); padding: 20px 24px; margin: 12px 0; background: var(--color-bg-page, transparent); }
.fp-stage .fp-name { font: 400 12px/1 var(--font-body); color: var(--color-text-secondary); margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.fp-stage .fp-name strong { color: var(--color-text-primary); font-size: 14px; }
.fp-sample { font-family: var(--fp-font); font-weight: var(--fp-weight); font-style: var(--fp-style); }
.fp-sample.big { font-size: clamp(28px, 5vw, 44px); line-height: 1.15; margin: 0 0 12px; overflow-wrap: anywhere; }
.fp-sample.para { font-size: 17px; line-height: 1.6; margin: 0 0 12px; max-width: 64ch; }
.fp-sample.chars { font-size: 22px; line-height: 1.4; margin: 0; color: var(--color-text-secondary); overflow-wrap: anywhere; }
.fp-status { min-height: 18px; font-size: 12px; color: var(--color-text-secondary); margin: 0; }
.fp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.fp-pair { border-top: 1px solid var(--color-border-subtle); margin-top: 20px; padding-top: 16px; }
.fp-pair h4 { font-family: var(--fp-h); font-weight: var(--fp-hw); font-size: 26px; margin: 8px 0; }
.fp-pair p { font-family: var(--fp-b); font-weight: var(--fp-bw); margin: 0; max-width: 60ch; }
.fp-code { width: 100%; min-height: 300px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 12px; border: 1px solid var(--color-border-default); border-radius: var(--radius-md); background: var(--color-bg-surface); color: var(--color-text-primary); resize: vertical; }
@media (max-width: 575.98px) { .fp-controls { grid-template-columns: 1fr; } }
