/* docs.css — API documentation layout. Pairs with site.css (design tokens +
 * marketing header/footer). Multi-page docs: sticky sidebar + content, framed by
 * the same edge rails as the homepage. Accents are BLACK — no blue. */

:root { --mkt-head:63px; }

/* site.css sets overflow-x:hidden on html/body, which breaks position:sticky for
   the sidebar. 'clip' prevents horizontal scroll the same way but is sticky-safe. */
html, body { overflow-x:clip; }

/* Docs run on Figtree (the tool-page typeface), not site.css's Inter. Loaded after
   site.css so this body rule wins; Figtree is pulled in by the shared header. */
body { font-family:'Figtree','Inter',system-ui,-apple-system,'Segoe UI',sans-serif; }

/* Thin, grey scrollbars — match the /app nav (the native bar was reading as white).
   Scoped here, so only /docs + /api docs get them. The transparent border + padding-box
   clip slims the thumb and rounds it; it darkens on hover. html AND body are targeted
   because overflow-x:clip can move the viewport scroller to either element. */
html, body { scrollbar-width:thin; scrollbar-color:#cbd5e1 transparent; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width:11px; }
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track { background:transparent; }
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb { background:#cbd5e1; border:3px solid transparent; background-clip:padding-box; border-radius:8px; }
html::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover { background:#94a3b8; background-clip:padding-box; }
.docs-side { scrollbar-width:thin; scrollbar-color:#e2e3e8 transparent; }
.docs-side:hover { scrollbar-color:#c4c8d0 transparent; }
.docs-side::-webkit-scrollbar { width:8px; }
.docs-side::-webkit-scrollbar-track { background:transparent; }
.docs-side::-webkit-scrollbar-thumb { background:#e2e3e8; border:2px solid transparent; background-clip:padding-box; border-radius:8px; }
.docs-side:hover::-webkit-scrollbar-thumb { background:#c4c8d0; background-clip:padding-box; }
.docs-side::-webkit-scrollbar-thumb:hover { background:#b0b5bf; background-clip:padding-box; }

/* Edge rails — identical to the homepage frame */
.page-rails { position:fixed; top:0; bottom:0; left:0; right:0; margin:0 auto;
  width:min(1360px,100%); border-left:1px solid var(--border); border-right:1px solid var(--border);
  pointer-events:none; z-index:101; }
@media (max-width:1360px){ .page-rails { display:none; } }

/* Layout: sidebar + content within the 1360 frame */
.docs { max-width:1360px; margin:0 auto; display:grid; grid-template-columns:262px minmax(0,1fr); align-items:start; }
.docs-side { position:sticky; top:var(--mkt-head); align-self:start; max-height:calc(100vh - var(--mkt-head));
  overflow-y:auto; border-right:1px solid var(--border); padding:30px 18px 60px; }
/* Content fills the full width of the content column (no narrow cap) */
.docs-main { padding:46px clamp(24px,4vw,56px) 96px; min-width:0; }

/* Sidebar nav */
.api-nav-group { margin-bottom:24px; }
.api-nav-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:1.2px;
  color:var(--text-muted); padding:0 10px; margin-bottom:8px; }
.api-nav a { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 10px;
  border-radius:7px; font-size:14px; color:var(--text-soft); font-weight:500; text-decoration:none; }
.api-nav a:hover { background:var(--bg-subtle); color:var(--text); }
.api-nav a.active { background:#f3f4f6; color:#0a0a0a; font-weight:600; }
.api-nav .mtag { font-size:9.5px; font-weight:800; letter-spacing:.4px; padding:2px 5px; border-radius:3px; }
.api-nav .mtag.get { background:#ecfdf5; color:#059669; }
.api-nav .mtag.post { background:#f3f4f6; color:#0a0a0a; }

/* Content typography — matches the tool pages' palette: navy-ink headings (#091e42),
   slate body text (#51607a), blue links (#2563eb). */
.docs-main h1 { font-size:38px; font-weight:800; letter-spacing:-1.2px; margin:0 0 14px; color:#091e42; }
.docs-lede { font-size:18px; color:#51607a; margin:0 0 26px; max-width:680px; line-height:1.6; }
.docs-main h2 { font-size:23px; font-weight:700; letter-spacing:-.4px; margin:44px 0 10px; color:#091e42; }
.docs-main h3 { font-size:16px; font-weight:700; margin:26px 0 8px; color:#091e42; }
.docs-main p { color:#51607a; margin:0 0 14px; }
.docs-main ul, .docs-main ol.list { color:#51607a; margin:0 0 16px; padding-left:20px; }
.docs-main li { margin:0 0 7px; }
.docs-main li b { color:#091e42; }
.docs-main a { color:#2563eb; font-weight:500; text-decoration:underline; text-underline-offset:2px; }
.docs-main a:hover { color:#000; }

/* Breadcrumbs — same trail style as the tool pages, for internal linking. The
   .docs-main scope lets the crumb links override the blue content-link colour. */
.docs-main .crumbs { font-size:13px; margin:0 0 20px; display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.docs-main .crumbs a { color:var(--text-muted); font-weight:500; text-decoration:none; }
.docs-main .crumbs a:hover { color:#091e42; text-decoration:underline; }
.docs-main .crumbs .sep { color:var(--border-strong); }
.docs-main .crumbs .current { color:var(--text-soft); }
.ic { font-family:'SFMono-Regular',Menlo,Consolas,monospace; font-size:13px; background:var(--bg-subtle);
  border:1px solid var(--border); padding:1px 6px; border-radius:4px; color:var(--text); }

/* Code blocks — light, SQUARE, line-numbered, neutral (no blue) */
.code { background:#f8f9fb; border:1px solid var(--border); margin:8px 0 18px; overflow:hidden; }
.code-label { display:block; padding:7px 16px; border-bottom:1px solid var(--border); background:#eef0f3;
  font-size:11px; font-weight:700; letter-spacing:.6px; text-transform:uppercase; color:var(--text-muted); }
ol.code-lines { counter-reset:ln; list-style:none; margin:0; padding:14px 0; overflow-x:auto;
  font-family:'SFMono-Regular',Menlo,Consolas,monospace; font-size:13px; }
ol.code-lines li { counter-increment:ln; white-space:pre; padding:0 20px 0 56px; position:relative; line-height:1.8; color:#24292e; }
ol.code-lines li::before { content:counter(ln); position:absolute; left:0; width:40px; text-align:right;
  color:#aab1bd; user-select:none; font-variant-numeric:tabular-nums; }

/* Multi-language code tabs (cURL / PHP / Node / Python / C#) */
.code-tabs { border:1px solid var(--border); margin:8px 0 18px; background:#f8f9fb; }
.code-tabs-bar { display:flex; border-bottom:1px solid var(--border); background:#eef0f3; overflow-x:auto; scrollbar-width:none; }
.code-tabs-bar::-webkit-scrollbar { display:none; }
.code-tab { display:flex; align-items:center; gap:7px; background:none; border:0; border-bottom:2px solid transparent;
  padding:9px 15px; font-size:12.5px; font-weight:600; color:var(--text-muted); cursor:pointer; font-family:inherit; white-space:nowrap; }
.code-tab .lang-ico { display:inline-flex; align-items:center; }
.code-tab .lang-ico svg { width:15px; height:15px; display:block; }
.code-tab:hover { color:var(--text); }
.code-tab.active { color:#0a0a0a; border-bottom-color:#0a0a0a; background:#f8f9fb; }
.code-tab-panel { display:none; }
.code-tab-panel.active { display:block; }
.code-tabs ol.code-lines { padding:14px 0; }

/* Endpoint header */
.endpoint { display:inline-flex; align-items:center; gap:10px; background:var(--bg-subtle); border:1px solid var(--border);
  padding:9px 14px; font-family:'SFMono-Regular',Menlo,Consolas,monospace; font-size:13.5px; color:var(--text); margin:6px 0 16px; }
.endpoint .verb { font-weight:800; font-size:11px; letter-spacing:.5px; padding:3px 7px; color:#fff; }
.endpoint .verb.get { background:#059669; }
.endpoint .verb.post { background:#0a0a0a; }

/* Tables */
.docs-main table { width:100%; border-collapse:collapse; margin:6px 0 20px; font-size:14px; }
.docs-main th, .docs-main td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:top; }
.docs-main th { font-size:11px; text-transform:uppercase; letter-spacing:.8px; color:var(--text-muted); font-weight:700; }
.req { color:#b91c1c; font-size:11px; font-weight:700; }
.opt { color:var(--text-muted); font-size:11px; font-weight:600; }

/* Callout + buttons + pager (black accents) */
.callout { background:var(--bg-subtle); border:1px solid var(--border); border-left:3px solid #0a0a0a;
  padding:14px 16px; margin:0 0 18px; font-size:14px; color:var(--text-soft); }
.btn-navy { display:inline-flex; align-items:center; gap:8px; background:#2563eb; color:#fff; padding:11px 18px;
  font-size:14px; font-weight:600; border-radius:2px; text-decoration:none; }
.btn-navy:hover { background:#1d4ed8; color:#fff; text-decoration:none; }
/* `.docs-main a` (black + underline) outranks `.btn-navy` on specificity, which
   turned the label black-on-black. This override wins so it stays white. */
.docs-main a.btn-navy, .docs-main a.btn-navy:hover { color:#fff; text-decoration:none; }
.pager { display:flex; gap:14px; margin-top:52px; padding-top:24px; border-top:1px solid var(--border); }
.pager a { flex:1; padding:14px 18px; border:1px solid var(--border); text-decoration:none; }
.pager a:hover { border-color:#0a0a0a; background:var(--bg-subtle); text-decoration:none; }
.pager .dir { font-size:12px; color:var(--text-muted); }
.pager .ttl { font-size:15px; font-weight:600; color:var(--text); margin-top:2px; }
.pager .next { text-align:right; }

/* ── Mobile: drawer sidebar + clear toggle + backdrop ───────────────────────── */
.api-menu-btn { display:none; }
.api-nav-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:130; }
@media (max-width:920px){
  .docs { grid-template-columns:1fr; }
  /* Full-width bar at the top of the docs content (sits right under the site
     header) — clearly the DOCS nav, separate from the site hamburger. */
  .api-menu-btn { display:flex; align-items:center; gap:10px; width:100%; justify-content:flex-start;
    background:#fff; color:#0a0a0a; border:0; border-bottom:1px solid var(--border);
    padding:15px clamp(16px,5vw,22px); font-size:15px; font-weight:600; font-family:inherit; cursor:pointer; }
  .api-menu-btn::after { content:"▾"; margin-left:auto; color:var(--text-muted); }
  body.api-nav-open .api-nav-backdrop { display:block; }
  .docs-side { position:fixed; top:0; left:0; bottom:0; width:300px; max-height:none; height:100vh; background:#fff; z-index:140;
    transform:translateX(-100%); transition:transform .22s ease; box-shadow:0 10px 40px rgba(0,0,0,.16); padding-top:24px; }
  body.api-nav-open .docs-side { transform:translateX(0); }
  .docs-main { padding:30px 22px 90px; }
  .docs-main h1 { font-size:30px; }
}
