/* Offloader docs — reuses styles.css tokens (loaded first): fonts, colors, light/dark.
   This adds the docs layout (sticky sidebar + editorial prose) and nothing else. */

/* ── layout ─────────────────────────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 4rem);
  align-items: start;
  padding-top: clamp(1.75rem, 4vw, 3rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.docs-main { min-width: 0; }   /* let code/tables scroll instead of blowing out the grid */

/* ── sidebar ────────────────────────────────────────────────────────────── */
.docs-nav {
  position: sticky;
  top: 5.25rem;
  align-self: start;
  max-height: calc(100vh - 6.5rem);
  overflow-y: auto;
  /* left padding matches the -0.7rem link bleed below, so the active item's rounded
     highlight isn't clipped by the scroll container's overflow. */
  padding-left: 0.7rem;
  padding-right: 0.5rem;
}
.docs-nav > summary { display: none; }   /* desktop: always-open sidebar, no disclosure */
.docs-home {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; font-size: 1.02rem;
  padding-bottom: 1.1rem; margin-bottom: 0.4rem; border-bottom: 1px solid var(--line-2);
}
.docs-home .brand-mark { color: var(--accent); }
.nav-group { margin-top: 1.4rem; }
.nav-group-h {
  font-family: var(--mono); font-size: var(--fs-label); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted);
  margin: 0 0 0.55rem;
}
.docs-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; }
.docs-nav li a {
  display: block; padding: 0.32rem 0.7rem; margin-left: -0.7rem;
  border-radius: 7px; font-size: 0.95rem; color: var(--ink-2); line-height: 1.35;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.docs-nav li a:hover { color: var(--ink); background: var(--paper-2); }
.docs-nav li a[aria-current="page"] {
  color: var(--accent-2); font-weight: 550;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  box-shadow: inset 2px 0 0 var(--accent);   /* scheme-independent cue — the tint alone vanishes on dark paper */
}
.docs-home[aria-current="page"] { color: var(--accent-2); }

/* ── prose ──────────────────────────────────────────────────────────────── */
.doc-kicker {
  font-family: var(--mono); font-size: var(--fs-label); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase; color: var(--accent-2);
  margin: 0 0 0.9rem;
}
/* Prose text stays at a readable measure; wide reference tables and code blocks get the
   full main column (a 4-column config table shouldn't be boxed into 46rem on a 1280px screen). */
.prose { max-width: none; }
.prose > * + * { margin-top: 1.15rem; }
.prose > :is(p, ul, ol, blockquote, h1) { max-width: 46rem; }
.prose h1 {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02;
  font-size: clamp(2rem, 1.3rem + 2.2vw, 2.85rem); margin: 0 0 0.3rem;
}
.prose h2 {
  font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem);
  margin-top: 2.9rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
}
.prose h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.015em; font-size: 1.2rem; margin-top: 2rem; }
.prose h4 { font-family: var(--display); font-weight: 600; font-size: 1.03rem; margin-top: 1.6rem; }
.prose :is(h1, h2, h3, h4) { scroll-margin-top: 5.5rem; text-wrap: pretty; }
.prose p, .prose li { color: var(--ink-2); line-height: 1.68; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }

.prose ul, .prose ol { padding-left: 1.3rem; display: grid; gap: 0.5rem; }
.prose li { padding-left: 0.2rem; }
.prose li::marker { color: var(--muted); }
.prose ol li::marker { font-family: var(--mono); font-size: 0.9em; }
.prose :is(ul, ol) :is(ul, ol) { margin-top: 0.5rem; }
.prose li > p { margin: 0; }

.prose blockquote {
  margin: 1.4rem 0; padding: 0.35rem 0 0.35rem 1.25rem;
  border-left: 2px solid var(--accent); color: var(--ink-2);
}
.prose blockquote p { color: var(--ink-2); }
.prose blockquote strong { color: var(--ink); }
.prose hr { margin: 2.4rem 0; border: 0; border-top: 1px solid var(--line); }

/* inline + block code — same material as the marketing artifacts */
.prose :not(pre) > code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 5px;
  padding: 0.1em 0.38em; color: var(--ink); word-break: break-word;
}
.prose pre {
  margin: 1.5rem 0; padding: 1.15rem clamp(1rem, 2.5vw, 1.5rem); overflow-x: auto;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px;
  font-family: var(--mono); font-size: var(--fs-mono); line-height: 1.7;
  font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; white-space: pre; }

/* tables — bordered, mono header labels, horizontal scroll on small screens */
/* wrap the scroll on a container, NOT on the table (display:block would strip row/cell roles) */
.prose .table-scroll { margin: 1.5rem 0; overflow-x: auto; }
.prose .table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prose thead th {
  text-align: left; font-family: var(--mono); font-size: var(--fs-label); font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
  padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--line);
}
.prose tbody td { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: top; line-height: 1.5; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }

/* ── pager ──────────────────────────────────────────────────────────────── */
.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.doc-pager .pg {
  display: grid; gap: 0.25rem; padding: 0.95rem 1.15rem; border: 1px solid var(--line);
  border-radius: 10px; transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.doc-pager .pg:hover { border-color: var(--accent); transform: translateY(-1px); }
.doc-pager .pg.next { text-align: right; }
.doc-pager .pg span { font-family: var(--mono); font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--muted); }
.doc-pager .pg b { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); font-size: 1.02rem; }

/* ── index ──────────────────────────────────────────────────────────────── */
.docs-hero { margin-bottom: 1rem; }
.docs-hero h1 { font-family: var(--display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; font-size: clamp(2.1rem, 1.4rem + 2.4vw, 3rem); max-width: 18ch; margin: 0 0 1rem; }
.docs-hero .lede { max-width: var(--measure); font-size: var(--fs-lede); line-height: 1.5; color: var(--ink-2); }
.docs-hero .lede a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.doc-group { margin-top: clamp(2.25rem, 4vw, 3.25rem); }
.doc-group h2 { font-family: var(--mono); font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--accent-2); margin: 0 0 1.1rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.doc-index { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.75rem; }
.doc-index a { display: grid; align-content: start; gap: 0.3rem; height: 100%; padding: 1.05rem 1.25rem; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; transition: border-color 0.15s var(--ease), background 0.15s var(--ease); }
.doc-index a:hover { background: var(--paper-2); border-color: var(--accent); }
.doc-index b { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; color: var(--ink); font-size: 1.05rem; }
.doc-index span { font-size: 0.9rem; line-height: 1.45; color: var(--muted); }

/* The footer is the shared .site-foot (styles.css), same as the marketing site. */

/* ── responsive: collapse to a single column with a disclosure nav ────────── */
@media (max-width: 980px) {
  .docs-layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .docs-nav { position: static; max-height: none; overflow: visible; padding-right: 0; border: 1px solid var(--line); border-radius: 10px; }
  .docs-nav > summary {
    display: flex; align-items: center; justify-content: space-between; cursor: pointer;
    list-style: none; padding: 0.85rem 1.1rem;
    font-family: var(--mono); font-size: var(--fs-label); font-weight: 500;
    letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-2);
  }
  .docs-nav > summary::-webkit-details-marker { display: none; }
  .docs-nav > summary::after { content: "＋"; color: var(--muted); font-size: 1rem; }
  .docs-nav[open] > summary { border-bottom: 1px solid var(--line); }
  .docs-nav[open] > summary::after { content: "－"; }
  .docs-nav > nav { padding: 0.35rem 1.1rem 1rem; }
  .docs-home { margin-top: 0.6rem; }
}
