
/* ============================================================================
   docs.css - documentation section layout (sidebar / prose / TOC / search).
   Builds ON TOP of site.css; reuses its palette tokens, fonts, and .support
   prose styles + light theme. Loaded only by /docs pages.
   ========================================================================== */

/* Align the top nav's content band with the docs grid (max-width 1320, centered)
   so the logo lines up with the sidebar and the right-hand controls line up with
   the TOC - instead of the support pages' narrower 1200 band. */
body.support.docs .support__nav {
  padding-left: max(24px, calc(50vw - 636px));
  padding-right: max(24px, calc(50vw - 636px));
}

/* The docs grid replaces the centered single-column .support__main layout. */
.docs-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr) 232px;
  gap: 0;
  max-width: 1320px;
  margin: 0 auto;
  align-items: start;
}

/* ---- left sidebar ---------------------------------------------------------- */
.docs-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  padding: 40px 20px 48px 24px;
  border-right: 2px solid var(--line);
}

/* Themed scrollbars on the scrollable doc panels - the default OS bar reads as a
   bright slab against the dark UI. Tracks transparent, thumb in the line tone;
   both flip with the theme via the palette vars. */
.docs-sidebar,
.docs-toc,
.docs-search__results {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.docs-sidebar::-webkit-scrollbar,
.docs-toc::-webkit-scrollbar,
.docs-search__results::-webkit-scrollbar {
  width: 10px;
}
.docs-sidebar::-webkit-scrollbar-track,
.docs-toc::-webkit-scrollbar-track,
.docs-search__results::-webkit-scrollbar-track {
  background: transparent;
}
.docs-sidebar::-webkit-scrollbar-thumb,
.docs-toc::-webkit-scrollbar-thumb,
.docs-search__results::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--base);
  border-radius: 6px;
}
.docs-sidebar::-webkit-scrollbar-thumb:hover,
.docs-toc::-webkit-scrollbar-thumb:hover,
.docs-search__results::-webkit-scrollbar-thumb:hover {
  background: var(--ink-faint);
}
.docs-sidebar__toggle {
  display: none;
  width: 100%;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--ink-dim);
  background: transparent;
  border: 2px solid var(--line-strong);
  padding: 10px 12px;
  cursor: pointer;
  margin-bottom: 14px;
}
.docs-nav__group { margin-bottom: 22px; }
.docs-nav__head {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 12px;
  line-height: 1.6;
}
.docs-nav__link {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-dim);
  text-decoration: none;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  margin-left: -2px;
}
.docs-nav__link:hover { color: var(--teal); }
.docs-nav__link.is-active {
  color: var(--teal);
  border-left-color: var(--teal);
  background: var(--panel-2);
}

/* ---- center content -------------------------------------------------------- */
.docs-content { min-width: 0; }
.docs-content .support__main {
  max-width: 768px;
  margin: 0;
  padding: 48px 44px 56px;
}
/* code blocks: theme-aware bg/border; docs-chroma.css supplies the token
   colours (light tokens by default, a :root[data-theme="dark"] block for dark).
   The container background follows the theme too - a light surface under the
   light-theme tokens, a dark surface under the dark-theme tokens. */
.docs-content .support__main pre,
.docs-content .support__main pre.chroma {
  position: relative;
  background: var(--surface-2);
  border: 2px solid var(--line-2);
  padding: 16px 20px;
  border-radius: 0;
}
:root[data-theme="dark"] .docs-content .support__main pre,
:root[data-theme="dark"] .docs-content .support__main pre.chroma {
  background: #0D1117;
}
.docs-content .support__main pre code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  font-size: 13px;
}
/* GFM tables */
.docs-content .support__main table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.docs-content .support__main th,
.docs-content .support__main td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  color: var(--ink-dim);
}
.docs-content .support__main th { color: var(--ink); background: var(--panel-2); font-weight: 600; }

/* callouts: markdown blockquotes become accented note panels */
.docs-content .support__main blockquote {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-left: 3px solid var(--teal);
  background: var(--panel-2);
  color: var(--ink-dim);
}
.docs-content .support__main blockquote p { margin: 0 0 8px; }
.docs-content .support__main blockquote p:last-child { margin: 0; }
.docs-content .support__main blockquote strong { color: var(--teal); }

/* copy-to-clipboard button injected by docs.js */
.docs-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--ink-faint);
  background: var(--base);
  border: 2px solid var(--line-strong);
  padding: 6px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease;
}
.docs-content .support__main pre:hover .docs-copy { opacity: 1; }
.docs-copy:hover { color: var(--teal); border-color: var(--teal); }
.docs-copy.copied { color: var(--gold); border-color: var(--gold); }

/* prev / next footer */
.docs-prevnext {
  display: flex;
  gap: 14px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 2px solid var(--line);
}
.docs-prevnext__spacer { flex: 1; }
.docs-prevnext__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 2px solid var(--line-strong);
  text-decoration: none !important;
}
.docs-prevnext__link.next { text-align: right; }
.docs-prevnext__link:hover { border-color: var(--teal); }
.docs-prevnext__dir {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--ink-faint);
}
.docs-prevnext__title {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--teal);
}

/* ---- right table of contents ---------------------------------------------- */
.docs-toc {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  padding: 48px 24px 48px 16px;
}
.docs-toc__title {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.docs-toc__list { list-style: none; padding: 0; margin: 0; }
.docs-toc__list li { margin: 0; }
.docs-toc__list li.lvl-3 a { padding-left: 22px; font-size: 12px; }
.docs-toc__list a {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-faint);
  text-decoration: none;
  padding: 5px 10px;
  border-left: 2px solid transparent;
}
.docs-toc__list a:hover { color: var(--teal); }
.docs-toc__list a.is-active {
  color: var(--teal);
  border-left-color: var(--teal);
}

/* ---- search overlay -------------------------------------------------------- */
.docs__search-open { border-color: var(--teal) !important; color: var(--teal) !important; }
.docs-search {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(5, 8, 16, 0.72);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14vh 16px 0;
}
.docs-search[hidden] { display: none; }
.docs-search__panel {
  width: 100%;
  max-width: 620px;
  background: var(--base);
  border: 2px solid var(--line-strong);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
}
.docs-search__input {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--line);
  padding: 16px 18px;
  outline: none;
}
.docs-search__results { max-height: 52vh; overflow-y: auto; }
.docs-search__result {
  display: block;
  padding: 12px 18px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.docs-search__result:hover,
.docs-search__result.is-active { background: var(--panel-2); }
.docs-search__result-sec {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--gold);
}
.docs-search__result-title {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--teal);
  margin: 4px 0 2px;
}
.docs-search__result-ex {
  font-family: var(--font-grotesk);
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.4;
}
.docs-search__empty { padding: 18px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); }
.docs-search__hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  padding: 10px 18px;
  border-top: 1px solid var(--line);
}
.docs-search__hint kbd {
  font-family: var(--font-mono);
  border: 1px solid var(--line-strong);
  padding: 1px 5px;
  color: var(--ink-dim);
}

/* Footer social links match the home page: pixel-font text glyphs (X / in / ▶ /
   GH), theme-following, teal on hover - not the support pages' pixel-art SVGs.
   The 36×36 bordered box comes from .support__foot .socials a in site.css. */
body.support.docs .support__foot .socials a {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink-dim);
}
body.support.docs .support__foot .socials a:hover { color: var(--teal); }

/* ---- responsive ------------------------------------------------------------ */
@media (max-width: 1100px) {
  .docs-shell { grid-template-columns: 240px minmax(0, 1fr); max-width: 960px; }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .docs-sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 2px solid var(--line);
    padding: 16px 16px 8px;
  }
  .docs-sidebar__toggle { display: block; }
  .docs-sidebar__inner { display: none; }
  .docs-sidebar.is-open .docs-sidebar__inner { display: block; }
  .docs-content .support__main { padding: 32px 16px 48px; }
  .docs-prevnext { flex-direction: column; }
}
