/* ═══════════════════════════════════════════════════════════════════════════
   Docs
   ---------------------------------------------------------------------------
   Built only from the theme's existing tokens: warm paper, Fraunces display,
   Geist sans, the coral gradient. No new colours, no new type families.

   Deliberately NOT the blog layout. A blog post is one centred column meant to
   be read start to finish. Docs are navigated: people arrive mid-structure from
   search, scan, and leave. So this is a two-column layout with persistent
   sibling navigation, denser type, tighter rhythm, and a visible sense of where
   you are in the set.
   ═══════════════════════════════════════════════════════════════════════════ */

.docs-eyebrow{
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--coral);
  margin:0 0 10px;
}

.docs-wrap{
  max-width:var(--maxw);
  margin:0 auto;
  padding:0 var(--gutter) var(--space-section);
}

/* ── Search ──────────────────────────────────────────────────────────────── */
.docs-search{
  display:flex;
  gap:8px;
  max-width:560px;
  margin:var(--space-lg) 0 0;
}
.docs-search input[type="search"]{
  flex:1;
  padding:13px 16px;
  font-family:var(--font-sans);
  font-size:15px;
  color:var(--ink);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  outline:none;
  transition:border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.docs-search input[type="search"]:focus{
  border-color:var(--coral);
  box-shadow:0 0 0 3px var(--coral-12);
}
.docs-search button{
  padding:13px 22px;
  font-family:var(--font-sans);
  font-weight:600;
  font-size:15px;
  color:#fff;
  background:var(--grad);
  border:0;
  border-radius:var(--radius-sm);
  cursor:pointer;
}

/* ── Hub: product cards ──────────────────────────────────────────────────── */
.docs-product-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(290px,1fr));
  gap:var(--space-md);
  margin-top:var(--space-xl);
}
.docs-product-card{
  display:flex;
  flex-direction:column;
  padding:var(--space-lg);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow-card);
  text-decoration:none;
  color:inherit;
  transition:transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.docs-product-card:hover{
  transform:translateY(-3px);
  border-color:var(--coral);
  box-shadow:var(--shadow-pop);
}
.docs-product-card h2{
  font-family:var(--font-display);
  font-size:25px;
  line-height:1.15;
  margin:0 0 10px;
  color:var(--ink);
}
.docs-product-card p{
  font-size:15px;
  line-height:1.6;
  color:var(--ink-soft);
  margin:0 0 var(--space-md);
  flex:1;
}
.docs-product-meta{
  font-family:var(--font-mono);
  font-size:12.5px;
  letter-spacing:.04em;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:8px;
}
.docs-arrow{
  color:var(--coral);
  transition:transform .2s var(--ease);
}
.docs-product-card:hover .docs-arrow{ transform:translateX(4px); }

/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */
.docs-crumbs{
  max-width:var(--maxw);
  margin:0 auto;
  padding:clamp(104px,13vh,140px) var(--gutter) 0;
  font-family:var(--font-mono);
  font-size:12.5px;
  color:var(--muted);
  display:flex;
  gap:9px;
  flex-wrap:wrap;
}
.docs-crumbs a{ color:var(--muted); text-decoration:none; }
.docs-crumbs a:hover{ color:var(--coral); }
.docs-crumbs [aria-current]{ color:var(--ink); }

/* ── Product landing ─────────────────────────────────────────────────────── */
.docs-product-head{ padding-top:var(--space-lg) !important; }
.docs-product-intro{ margin-bottom:var(--space-xl); }

.docs-section{ margin-top:var(--space-xl); }
.docs-section-title{
  font-family:var(--font-display);
  font-size:15px;
  letter-spacing:.02em;
  text-transform:uppercase;
  color:var(--muted);
  margin:0 0 var(--space-sm);
  padding-bottom:10px;
  border-bottom:1px solid var(--line-2);
}
.docs-list{ list-style:none; margin:0; padding:0; }
.docs-list li{ border-bottom:1px solid var(--line-2); }
.docs-list li:last-child{ border-bottom:0; }
.docs-list a{
  display:block;
  padding:15px 0;
  text-decoration:none;
  color:inherit;
  transition:padding-left .18s var(--ease);
}
.docs-list a:hover{ padding-left:8px; }
.docs-list-title{
  display:block;
  font-family:var(--font-sans);
  font-weight:600;
  font-size:16.5px;
  color:var(--ink);
}
.docs-list a:hover .docs-list-title{ color:var(--coral); }
.docs-list-desc{
  display:block;
  font-size:14.5px;
  line-height:1.55;
  color:var(--muted);
  margin-top:3px;
}

/* ── Article: two-column ─────────────────────────────────────────────────── */
.docs-layout{
  max-width:var(--maxw);
  margin:0 auto;
  padding:var(--space-lg) var(--gutter) var(--space-section);
  display:grid;
  grid-template-columns:248px minmax(0,1fr);
  gap:var(--space-2xl);
  align-items:start;
}
.docs-sidebar{
  position:sticky;
  top:96px;
  max-height:calc(100vh - 130px);
  overflow-y:auto;
  padding-right:12px;
  border-right:1px solid var(--line-2);
}
.docs-sidebar-product{
  display:block;
  font-family:var(--font-display);
  font-size:19px;
  color:var(--ink);
  text-decoration:none;
  margin-bottom:var(--space-md);
}
.docs-sidebar-product:hover{ color:var(--coral); }
.docs-nav-group{ margin-bottom:var(--space-md); }
.docs-nav-group h3{
  font-family:var(--font-mono);
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--muted);
  margin:0 0 8px;
}
.docs-nav-group ul{ list-style:none; margin:0; padding:0; }
.docs-nav-group li{ margin:0; }
.docs-nav-group a{
  display:block;
  padding:6px 10px;
  margin-left:-10px;
  font-size:14.5px;
  line-height:1.45;
  color:var(--ink-soft);
  text-decoration:none;
  border-radius:7px;
  transition:background .16s var(--ease), color .16s var(--ease);
}
.docs-nav-group a:hover{ background:var(--line-2); color:var(--ink); }
.docs-nav-group li.is-current > a{
  background:var(--coral-12);
  color:var(--coral-deep);
  font-weight:600;
}

.docs-main{ min-width:0; }
.docs-article-head{ margin-bottom:var(--space-lg); }
.docs-article-head .h1{ margin-bottom:10px; }
.docs-updated{
  font-family:var(--font-mono);
  font-size:12px;
  color:var(--muted);
  margin:var(--space-sm) 0 0;
}

/* Denser than blog prose: docs get scanned, not read linearly. */
.docs-prose{ font-size:16.5px; line-height:1.72; }
.docs-prose h2{
  font-family:var(--font-display);
  font-size:27px;
  margin:var(--space-xl) 0 var(--space-xs);
  scroll-margin-top:100px;
}
.docs-prose h3{
  font-size:19px;
  font-weight:600;
  margin:var(--space-lg) 0 var(--space-2xs);
  scroll-margin-top:100px;
}
.docs-prose img{
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  box-shadow:var(--shadow-card);
  margin:var(--space-md) 0;
}
.docs-prose code{
  font-family:var(--font-mono);
  font-size:.88em;
  background:var(--coral-12);
  color:var(--coral-deep);
  padding:.14em .4em;
  border-radius:5px;
}
.docs-prose pre{
  background:var(--night);
  color:#EDE7DC;
  padding:var(--space-md);
  border-radius:var(--radius-sm);
  overflow-x:auto;
  font-size:13.5px;
  line-height:1.6;
}
.docs-prose pre code{ background:none; color:inherit; padding:0; }

.docs-topics{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:var(--space-xl);
  padding-top:var(--space-md);
  border-top:1px solid var(--line-2);
}
.docs-topics a{
  font-family:var(--font-mono);
  font-size:12px;
  padding:5px 11px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  text-decoration:none;
}
.docs-topics a:hover{ border-color:var(--coral); color:var(--coral); }

/* ── Prev / next ─────────────────────────────────────────────────────────── */
.docs-pager{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:var(--space-sm);
  margin-top:var(--space-xl);
  padding-top:var(--space-lg);
  border-top:1px solid var(--line-2);
}
.docs-pager a{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:var(--space-sm) var(--space-md);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  text-decoration:none;
  transition:border-color .18s var(--ease), transform .18s var(--ease);
}
.docs-pager a:hover{ border-color:var(--coral); transform:translateY(-2px); }
.docs-pager span{
  font-family:var(--font-mono);
  font-size:11px;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--muted);
}
.docs-pager strong{ font-size:15px; color:var(--ink); font-weight:600; }
.docs-pager-next{ text-align:right; align-items:flex-end; }

.docs-empty{
  color:var(--muted);
  font-size:16px;
  padding:var(--space-xl) 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width:900px){
  .docs-layout{ grid-template-columns:1fr; gap:var(--space-lg); }
  .docs-sidebar{
    position:static;
    max-height:none;
    overflow:visible;
    border-right:0;
    border-bottom:1px solid var(--line-2);
    padding-right:0;
    padding-bottom:var(--space-md);
  }
  .docs-pager{ grid-template-columns:1fr; }
  .docs-pager-next{ text-align:left; align-items:flex-start; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Sidebar, collapsible (1.2.0)
   ---------------------------------------------------------------------------
   43 links in one flat scroll is a wall, not navigation. Groups collapse to
   their headings; only the group holding the current page opens. <details>
   does the work natively, so it survives with JavaScript disabled and is
   keyboard operable without any extra handling.
   ═══════════════════════════════════════════════════════════════════════════ */
.docs-nav-group{ margin-bottom:2px; border:0; }
.docs-nav-group > summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    padding:7px 10px;
    margin-left:-10px;
    font-family:var(--font-mono);
    font-size:11px;
    letter-spacing:.1em;
    text-transform:uppercase;
    color:var(--muted);
    cursor:pointer;
    border-radius:7px;
    list-style:none;
    transition:background .16s var(--ease), color .16s var(--ease);
}
.docs-nav-group > summary::-webkit-details-marker{ display:none; }
.docs-nav-group > summary:hover{ background:var(--line-2); color:var(--ink); }
.docs-nav-group > summary::after{
    content:"";
    width:6px; height:6px;
    border-right:1.5px solid currentColor;
    border-bottom:1.5px solid currentColor;
    transform:rotate(-45deg);
    margin-left:auto;
    opacity:.55;
    transition:transform .18s var(--ease);
}
.docs-nav-group[open] > summary::after{ transform:rotate(45deg); }
.docs-nav-group[open] > summary{ color:var(--ink); }
.docs-nav-count{
    font-size:10px;
    padding:1px 6px;
    border-radius:999px;
    background:var(--line-2);
    color:var(--muted);
    letter-spacing:0;
}
.docs-nav-group > ul{ margin:2px 0 10px; padding:0 0 0 2px; list-style:none; }

/* ═══════════════════════════════════════════════════════════════════════════
   Docs type and spacing system (1.2.0)
   ---------------------------------------------------------------------------
   The article template reuses the theme's .h1, .article-standfirst and .prose
   classes, which are tuned for marketing pages. Measured on a live doc:
   .prose carried padding-left 64px plus margin-left 28px, so body copy sat
   92px to the right of its own H1, and the standfirst rendered at 22.7px
   display serif. Correct for a landing page, wrong for a reference page.

   These rules reset docs to a single left edge and a tighter scale. Everything
   still uses the theme's own tokens, so it stays on-brand.
   ═══════════════════════════════════════════════════════════════════════════ */

/* One left edge. Nothing in a doc is indented from anything else. */
.docs-main .prose,
.docs-main .docs-prose{
    padding-left:0;
    padding-right:0;
    margin-left:0;
    margin-right:0;
    max-width:74ch;          /* measure, not a pixel guess */
}

/* Heading: readable, not a hero. */
.docs-main .h1{
    font-family:var(--font-display);
    font-size:clamp(28px, 3.1vw, 38px);
    line-height:1.18;
    letter-spacing:-0.015em;
    margin:0 0 12px;
    max-width:26ch;
}

/* Standfirst is a summary line, not a subheadline. Sans, not display serif. */
.docs-main .article-standfirst{
    font-family:var(--font-sans);
    font-size:17px;
    line-height:1.6;
    color:var(--ink-soft);
    margin:0 0 4px;
    max-width:68ch;
}

/* Byline sits quietly under the summary, separated by a hairline. */
.docs-updated{
    margin:14px 0 0;
    padding-top:14px;
    border-top:1px solid var(--line-2);
    font-size:11.5px;
    letter-spacing:.04em;
    color:var(--muted);
}

/* Breadcrumbs were clearing a fixed header with 117px of padding, which left a
   visible dead band above every doc. The nav is not that tall. */
.docs-crumbs{
    padding-top:clamp(88px, 10vh, 104px);
    padding-bottom:0;
}
.docs-layout{ padding-top:22px; }
.docs-product-head{ padding-top:22px !important; }

/* Body rhythm: enough air to scan, not so much that steps drift apart. */
.docs-prose p{ margin:0 0 16px; }
.docs-prose h2{
    font-size:23px;
    line-height:1.25;
    margin:36px 0 10px;
    padding-top:4px;
}
.docs-prose h3{
    font-size:17.5px;
    margin:26px 0 8px;
}
.docs-prose ul,
.docs-prose ol{ margin:0 0 16px; padding-left:22px; }
.docs-prose li{ margin:5px 0; }
.docs-prose figure{ margin:22px 0; }
.docs-prose figcaption{
    font-family:var(--font-mono);
    font-size:11.5px;
    color:var(--muted);
    margin-top:8px;
}
.docs-prose table{
    width:100%;
    border-collapse:collapse;
    font-size:15px;
    margin:0 0 20px;
}
.docs-prose th,
.docs-prose td{
    text-align:left;
    padding:9px 12px;
    border-bottom:1px solid var(--line-2);
    vertical-align:top;
}
.docs-prose th{
    font-family:var(--font-mono);
    font-size:11px;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:var(--muted);
    font-weight:600;
}

/* The sidebar scrollbar was visible as a permanent grey track. Show it only
   while the sidebar is actually being used. */
.docs-sidebar{ scrollbar-width:thin; scrollbar-color:transparent transparent; }
.docs-sidebar:hover{ scrollbar-color:var(--line) transparent; }
.docs-sidebar::-webkit-scrollbar{ width:6px; }
.docs-sidebar::-webkit-scrollbar-thumb{ background:transparent; border-radius:3px; }
.docs-sidebar:hover::-webkit-scrollbar-thumb{ background:var(--line); }
