/* ============================================================
   NeuroVault docs page
   Reuses tokens from ../styles.css (--bg, --peach, --text, etc.)
   and only adds layout + prose styles specific to documentation.
   ============================================================ */

/* The landing page has aurora blobs and a grain overlay that don't
   suit a long-form reading view. Strip them on the docs body so the
   content stays focused; keep the gradient bg + nav identical. */
body.docs-body {
  background:
    radial-gradient(ellipse at top, rgba(47, 123, 246, 0.04) 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
}

/* Show the "Docs" link in nav with the active accent color. */
.nav-links .nav-link-active {
  color: var(--peach-soft);
}

/* ============================================================
   3-column layout: sidebar | content | on-page TOC
   ============================================================ */
.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 220px;
  gap: 48px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px clamp(16px, 3vw, 32px) 80px;
  align-items: start;
}

/* ---- Sidebar (left) ---- */
.docs-sidebar {
  position: sticky;
  top: 88px; /* nav height + breathing room */
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 8px;
}

/* Custom scrollbar so it doesn't intrude. */
.docs-sidebar::-webkit-scrollbar {
  width: 6px;
}
.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.docs-nav-section {
  margin-bottom: 24px;
}
.docs-nav-section-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 10px 12px;
}
.docs-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.docs-nav-list a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
  transition: background 0.12s ease, color 0.12s ease;
  border-left: 2px solid transparent;
}
.docs-nav-list a:hover {
  background: rgba(47, 123, 246, 0.06);
  color: var(--text);
}
.docs-nav-list a.is-active {
  background: rgba(47, 123, 246, 0.10);
  color: var(--peach-soft);
  border-left-color: var(--peach);
}

/* ---- Content (middle) ---- */
.docs-content-wrap {
  min-width: 0; /* lets long <pre> blocks wrap inside the grid cell */
}
.docs-content {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}
.docs-loading {
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 60px 0;
}

/* Headings — keep the gradient brand accent for h1, lighter for the rest. */
.docs-content h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--peach-soft) 0%, var(--peach) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.docs-content h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin: 48px 0 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  scroll-margin-top: 88px; /* anchor link doesn't hide under sticky nav */
}
.docs-content h3 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  margin: 32px 0 12px;
  color: var(--text);
  scroll-margin-top: 88px;
}
.docs-content h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--text-muted);
  scroll-margin-top: 88px;
}

/* Permalink anchor that shows on heading hover. Docs.js inserts these. */
.docs-content h2 .anchor-link,
.docs-content h3 .anchor-link,
.docs-content h4 .anchor-link {
  opacity: 0;
  margin-left: 8px;
  font-weight: 400;
  color: var(--peach);
  text-decoration: none;
  transition: opacity 0.12s ease;
}
.docs-content h2:hover .anchor-link,
.docs-content h3:hover .anchor-link,
.docs-content h4:hover .anchor-link { opacity: 1; }

/* Paragraphs + lists + links */
.docs-content p { margin: 0 0 16px; }
.docs-content ul,
.docs-content ol {
  margin: 0 0 16px;
  padding-left: 24px;
}
.docs-content li { margin: 6px 0; }
.docs-content li > p { margin-bottom: 8px; } /* tighter inside list items */

.docs-content a {
  color: var(--peach-soft);
  text-decoration: underline;
  text-decoration-color: rgba(47, 123, 246, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.12s ease;
}
.docs-content a:hover {
  text-decoration-color: var(--peach);
}

/* Inline code: same as ../styles.css but slightly tighter for prose density */
.docs-content code:not(pre code) {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(47, 123, 246, 0.10);
  color: var(--peach-soft);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(47, 123, 246, 0.10);
}

/* Code blocks (highlight.js renders into <pre><code class="hljs language-x">) */
.docs-content pre {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0 24px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.55;
}
.docs-content pre code.hljs {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0;
  font-size: inherit;
}

/* Blockquotes */
.docs-content blockquote {
  border-left: 3px solid var(--peach);
  padding: 4px 16px;
  margin: 16px 0 24px;
  color: var(--text-muted);
  background: rgba(47, 123, 246, 0.05);
  border-radius: 0 8px 8px 0;
}
.docs-content blockquote p:last-child { margin-bottom: 0; }

/* Tables */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}
.docs-content th,
.docs-content td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.docs-content th {
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border-bottom-color: var(--border-hot);
}
.docs-content td { color: var(--text-muted); }

/* Horizontal rule — used by the markdown source to separate sections.
   Make it subtle so it reads as a chapter break, not a hard divide. */
.docs-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* Per-page footer (edit link). Sits under the content. */
.docs-page-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}
.docs-page-footer a {
  color: var(--peach-soft);
  text-decoration: underline;
  text-decoration-color: rgba(47, 123, 246, 0.35);
}

/* ---- On-page TOC (right) ---- */
.docs-on-page-toc {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  font-size: 13px;
}
.docs-on-page-toc-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 12px;
}
#docs-on-page-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
#docs-on-page-toc-list li { margin: 4px 0; }
#docs-on-page-toc-list a {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text-dim);
  line-height: 1.4;
  transition: color 0.12s ease, background 0.12s ease;
}
#docs-on-page-toc-list a:hover {
  color: var(--peach-soft);
  background: rgba(47, 123, 246, 0.04);
}
#docs-on-page-toc-list a.is-active {
  color: var(--peach);
  font-weight: 500;
}
/* Indent H3 entries under their parent H2. */
#docs-on-page-toc-list .toc-h3 a { padding-left: 20px; font-size: 12.5px; }

/* ---- Mobile sidebar toggle ---- */
.sidebar-toggle {
  display: none; /* shown on narrow screens via media query */
  position: fixed;
  top: 70px;
  left: 16px;
  z-index: 40;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  align-items: center;
  gap: 8px;
}
.sidebar-toggle:hover {
  border-color: var(--border-hot);
  color: var(--peach);
}

/* ============================================================
   Responsive layout
   ============================================================ */
@media (max-width: 1100px) {
  /* Drop the on-page TOC at this width — content + sidebar only. */
  .docs-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 32px;
  }
  .docs-on-page-toc { display: none; }
}

@media (max-width: 760px) {
  /* Drop the sidebar to off-canvas; show toggle. */
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 16px 60px;
  }
  .docs-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 16px 8px 24px 16px;
    max-height: none;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 45;
    box-shadow: 0 0 32px -8px rgba(0, 0, 0, 0.6);
  }
  .docs-sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-toggle { display: inline-flex; }
  .docs-content h1 { font-size: 28px; }
  .docs-content h2 { font-size: 21px; }
  .docs-content h3 { font-size: 17px; }
}

/* Backdrop dim when mobile sidebar is open */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 44;
}
.sidebar-backdrop.is-visible { display: block; }

/* ============================================================
   Callout boxes (note / tip / important / warning / caution)
   docs.js tags qualifying blockquotes with .docs-callout + a type class.
   ============================================================ */
.docs-content .docs-callout {
  border-left: 3px solid var(--peach);
  background: rgba(47, 123, 246, 0.06);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 20px 0 24px;
  color: var(--text-muted);
}
.docs-content .docs-callout .docs-callout-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.docs-content .docs-callout .docs-callout-title::before {
  font-size: 14px;
  line-height: 1;
}
.docs-content .docs-callout p:last-child { margin-bottom: 0; }

.docs-callout.cl-note     { border-left-color: #2f7bf6; background: rgba(47,123,246,0.06); }
.docs-callout.cl-note     .docs-callout-title { color: #6ea8ff; }
.docs-callout.cl-note     .docs-callout-title::before { content: "ℹ"; }
.docs-callout.cl-tip      { border-left-color: #00c9b1; background: rgba(0,201,177,0.07); }
.docs-callout.cl-tip      .docs-callout-title { color: #2fe0c8; }
.docs-callout.cl-tip      .docs-callout-title::before { content: "✦"; }
.docs-callout.cl-important{ border-left-color: #b592ff; background: rgba(181,146,255,0.08); }
.docs-callout.cl-important .docs-callout-title { color: #c7adff; }
.docs-callout.cl-important .docs-callout-title::before { content: "◆"; }
.docs-callout.cl-warning  { border-left-color: #f0a500; background: rgba(240,165,0,0.08); }
.docs-callout.cl-warning  .docs-callout-title { color: #ffc23d; }
.docs-callout.cl-warning  .docs-callout-title::before { content: "▲"; }
.docs-callout.cl-caution  { border-left-color: #ff5d5d; background: rgba(255,93,93,0.08); }
.docs-callout.cl-caution  .docs-callout-title { color: #ff8585; }
.docs-callout.cl-caution  .docs-callout-title::before { content: "⛔"; }

/* ============================================================
   Prev / next pager
   ============================================================ */
.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.docs-pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
}
.docs-pager a:hover {
  border-color: var(--border-hot, var(--peach));
  background: rgba(47, 123, 246, 0.05);
  transform: translateY(-1px);
}
.docs-pager-next { text-align: right; }
.docs-pager-dir {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.docs-pager-title { font-size: 15px; font-weight: 600; color: var(--text); }

/* ============================================================
   Search: sidebar trigger + Cmd/Ctrl+K modal
   ============================================================ */
.docs-search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 22px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease;
}
.docs-search-trigger:hover { border-color: var(--border-hot, var(--peach)); color: var(--text-muted); }
.docs-search-trigger span { flex: 1; text-align: left; }
.docs-search-trigger-kbd,
.docs-search-hint kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-deep, rgba(0,0,0,0.2));
  color: var(--text-dim);
}

.docs-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 8, 18, 0.6);
  backdrop-filter: blur(3px);
  padding-top: 12vh;
  justify-content: center;
  align-items: flex-start;
}
.docs-search-overlay.is-open { display: flex; }
.docs-search-box {
  width: min(600px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border-hot, var(--border));
  border-radius: 16px;
  box-shadow: 0 24px 80px -16px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.docs-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 18px 20px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  outline: none;
}
.docs-search-input::placeholder { color: var(--text-dim); }
.docs-search-results {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 52vh;
  overflow-y: auto;
}
.docs-search-hit {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-auto-rows: auto;
  gap: 1px 10px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.docs-search-hit.is-sel { background: rgba(47, 123, 246, 0.12); }
.docs-search-hit-page {
  grid-row: 1;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--peach-soft);
  align-self: center;
}
.docs-search-hit-section { grid-row: 1; font-size: 14.5px; font-weight: 600; color: var(--text); }
.docs-search-hit-snippet {
  grid-row: 2;
  grid-column: 2;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docs-search-empty { padding: 18px; color: var(--text-dim); font-style: italic; text-align: center; }
.docs-search-hint {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-dim);
}
.docs-search-hint span { display: inline-flex; align-items: center; gap: 5px; }

@media (max-width: 760px) {
  .docs-pager { grid-template-columns: 1fr; }
}

/* --- v0.2.0 blue rebrand: nav consistency with landing page --- */
:root{--sans:"Plus Jakarta Sans",system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
.nav{display:grid;grid-template-columns:1fr auto 1fr;align-items:center}
.nav-logo{justify-self:start;gap:8px}
.nav-logo-icon{width:50px;height:50px;border-radius:0;box-shadow:none}
.nav-logo-word{height:15px;width:auto;display:block}
.nav-links{justify-self:center}
.nav-cta{justify-self:end;display:inline-flex;align-items:center;gap:7px;border-radius:999px;padding:9px 17px;font-weight:600;background:var(--peach)!important;background-image:none!important;color:#fff!important;box-shadow:0 1px 0 rgba(255,255,255,.28) inset,0 7px 18px -7px rgba(47,123,246,.65)}
.nav-cta:hover{transform:translateY(-1px)}
.nav-cta-ic{width:15px;height:15px}
