/* Documentation pages (/docs). Builds on the site's tokens and base styles in /styles.css. */

/* Header: always light on docs pages (no hero behind it). */
.docs-body .nav { background: #fff; color: var(--ink); box-shadow: 0 1px 0 var(--rule); }
.docs-body .nav-inner { gap: 16px; }
.docs-badge { font: 500 0.8rem/1 var(--mono); color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 10px; }
.docs-body .nav nav { gap: 22px; }
.docs-body .nav nav a { opacity: 1; color: var(--ink-2); }
.docs-body .nav nav a:hover { color: var(--ink); }
.docs-body .nav nav a[href="/docs"] { color: var(--ink); font-weight: 600; }
.docs-body .nav .btn-small { margin-left: 8px; }

/* Layout: sidebar and content. */
.docs-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: start; padding-top: 40px; padding-bottom: 88px; }
.docs-side { position: sticky; top: 92px; max-height: calc(100vh - 108px); overflow-y: auto; padding-bottom: 16px; }
.docs-menu > summary { display: none; }
.docs-nav h2 { font: 500 0.74rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 24px 0 8px 10px; max-width: none; }
.docs-nav h2:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 0.95rem; line-height: 1.35; }
.docs-nav a:hover { background: var(--tint); color: var(--ink); }
.docs-nav a[aria-current="page"] { background: var(--orange-soft); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--orange); }

/* Content */
.docs-main { min-width: 0; max-width: 780px; }
.docs-main:focus { outline: none; }
.docs-kicker { font: 500 0.8rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #B83A0A; }
.docs-main h1 { margin-top: 12px; font-size: clamp(2.1rem, 4.6vw, 3rem); line-height: 1.06; color: var(--ink); }
.docs-lede { margin-top: 18px; font-size: 1.16rem; color: var(--ink-2); max-width: 40em; }
.docs-main article > h2 { margin-top: 56px; font-size: clamp(1.45rem, 2.4vw, 1.75rem); line-height: 1.15; max-width: none; scroll-margin-top: 88px; }
.docs-main article > h3 { margin-top: 30px; font-size: 1.14rem; line-height: 1.3; scroll-margin-top: 88px; }
.docs-main article > h2 + h3 { margin-top: 18px; }
.docs-main p, .docs-main li, .docs-main dd { color: var(--ink-2); }
.docs-main article > p, .docs-main article > ul, .docs-main article > ol { margin-top: 14px; }
.docs-main article > ul, .docs-main article > ol { padding-left: 1.3em; }
.docs-main li { margin-top: 8px; }
.docs-main li::marker { color: var(--ink-3); }
.docs-main strong { color: var(--ink); font-weight: 600; }
.docs-main a { text-decoration-color: var(--orange); text-underline-offset: 2px; overflow-wrap: anywhere; }
.docs-main a:hover { color: var(--orange-ink); }
.docs-main code { overflow-wrap: anywhere; color: var(--ink); }

/* On this page */
.toc { margin-top: 32px; padding: 18px 22px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--tint); }
.toc h2 { font: 500 0.74rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 0; max-width: none; }
.toc ol { margin: 12px 0 0; padding-left: 1.4em; columns: 2 16em; column-gap: 32px; }
.toc li { margin: 0 0 6px; break-inside: avoid; color: var(--ink-2); }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Callouts */
.callout { margin-top: 28px; padding: 16px 20px; border-left: 4px solid var(--orange); border-radius: 0 10px 10px 0; background: var(--orange-soft); }
.callout p { color: var(--ink); margin: 0; }
.callout p + p { margin-top: 10px; }
.callout-note { border-left-color: var(--navy); background: var(--tint); }

/* Tables */
.table-wrap { margin-top: 20px; overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; }
.docs-table { min-width: 560px; font-size: 0.95rem; }
.docs-table th, .docs-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.docs-table thead th { font: 600 0.9rem var(--display); background: var(--tint); color: var(--ink); }
.docs-table tbody th { font-weight: 600; color: var(--ink); }
.docs-table td { color: var(--ink-2); }
.docs-table tbody tr:last-child > * { border-bottom: 0; }
.docs-table code { white-space: nowrap; }

/* Code blocks */
.docs-main pre { margin: 16px 0 0; padding: 16px 18px; background: var(--navy); color: var(--on-dark); border-radius: 10px; overflow-x: auto; font: 400 0.88rem/1.6 var(--mono); }
.docs-main pre code { background: none; padding: 0; color: inherit; font: inherit; white-space: pre; overflow-wrap: normal; }

/* Numbered steps */
.steps-list { list-style: none; counter-reset: step; padding-left: 0 !important; }
.steps-list > li { counter-increment: step; position: relative; padding-left: 42px; margin-top: 14px; }
.steps-list > li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--navy); color: #fff; font: 700 0.9rem/1 var(--display); }

/* Example requests */
.examples-list { list-style: none; padding-left: 0 !important; display: grid; gap: 8px; }
.examples-list > li { margin: 0; padding: 12px 16px; border: 1px solid var(--rule); border-left: 3px solid var(--orange); border-radius: 0 10px 10px 0; background: #fff; color: var(--ink); font-weight: 500; }

/* Definition list for modes */
.defs { margin: 18px 0 0; display: grid; gap: 10px; }
.defs > div { padding: 14px 16px; border: 1px solid var(--rule); border-radius: 10px; }
.defs dt { font: 600 1.02rem var(--display); color: var(--ink); }
.defs dd { margin: 4px 0 0; }
.tag-inline { display: inline-block; margin-left: 6px; padding: 3px 7px; border-radius: 5px; background: var(--tint); border: 1px solid var(--rule); font: 500 0.72rem/1.2 var(--mono); color: var(--ink-2); vertical-align: 2px; letter-spacing: 0; }

/* Index cards */
.cards { list-style: none; padding: 0 !important; margin-top: 20px !important; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cards li { margin: 0; }
.cards a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 18px; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.cards a:hover { color: var(--ink); border-color: #C9D1DC; box-shadow: 0 10px 30px -18px rgba(17,26,46,.35); }
.cards strong { font: 600 1.05rem var(--display); }
.cards span { color: var(--ink-2); font-size: 0.95rem; }

/* FAQ (reuses the home page's details styling) */
.docs-main .faq { margin-top: 16px; }
.docs-main .faq summary { font-size: 1.05rem; color: var(--ink); }

/* Previous and next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--rule); }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 10px; text-decoration: none; color: var(--ink); font: 600 1rem var(--display); }
.pager a:hover { border-color: #C9D1DC; background: var(--tint); }
.pager span { font: 500 0.74rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.pager-next { grid-column: 2; text-align: right; align-items: flex-end; }

/* Narrow screens: the sidebar becomes a collapsible menu above the content. */
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 16px; }
  .docs-side { position: static; max-height: none; overflow: visible; padding-bottom: 0; margin-bottom: 24px; }
  .docs-menu { border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; }
  .docs-menu > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; cursor: pointer; list-style: none; font: 600 1rem var(--body); color: var(--ink); border-radius: var(--radius); }
  .docs-menu > summary::-webkit-details-marker { display: none; }
  .docs-menu > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: translateY(-25%) rotate(45deg); transition: transform .2s; }
  .docs-menu[open] > summary::after { transform: translateY(20%) rotate(-135deg); }
  .docs-menu[open] > summary { border-bottom: 1px solid var(--rule); border-radius: var(--radius) var(--radius) 0 0; }
  .docs-nav { padding: 12px 8px 16px; }
  .docs-nav a { padding: 10px 10px; }
}
@media (max-width: 720px) {
  .docs-body .nav-inner { justify-content: flex-start; }
  .docs-body .nav .btn-small { margin-left: auto; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .toc ol { columns: 1; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-next { grid-column: 1; }
}
@media (max-width: 420px) {
  .docs-badge { display: none; }
}
