/* apps/docs/docs.css — docs-specific overlay on /shared/theme.css.
   Adds the persistent left sidebar layout and the docs hero gradient. */

/* ── Doc shell layout ──────────────────────────────────────────── */
.doc-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 0.75rem) 1.75rem 2rem;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

aside.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 0.75rem);
  align-self: start;
  max-height: calc(100vh - var(--nav-height) - 1rem);
  overflow-y: auto;
  padding: 1rem 0.5rem 2rem;
  font-size: 0.86rem;
}
aside.sidebar::-webkit-scrollbar { width: 6px; }
aside.sidebar::-webkit-scrollbar-track { background: transparent; }
aside.sidebar::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

.sidebar-section { margin-bottom: 1.75rem; }
.sidebar-section h4 {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 0.75rem;
  margin-bottom: 0.6rem;
}
.sidebar-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
}
.sidebar-section li { margin: 0; }
.sidebar-section a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--r-md);
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.sidebar-section a:hover {
  color: var(--text);
  background: rgba(167,139,250,0.04);
}
.sidebar-section a.active {
  color: var(--violet);
  background: rgba(167,139,250,0.08);
  border-left-color: var(--violet);
  font-weight: 600;
}
.sidebar-section a .glyph {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  width: 1.4em;
}
.sidebar-section a.active .glyph { color: var(--violet); }
.sidebar-tag {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: auto;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  color: var(--gold);
  background: rgba(253,230,138,0.08);
}
.sidebar-tag.live { color: var(--green); background: rgba(52,211,153,0.08); }

/* ── Main content ──────────────────────────────────────────────── */
main.doc-content {
  min-width: 0;
  max-width: var(--doc-max);
  padding-bottom: 4rem;
}

/* ── Docs h2 with thin top rule (visual section breaks) ────────── */
main.doc-content h2 {
  margin: 4rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
main.doc-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 2rem;
}

/* ── Hero glow on docs index ───────────────────────────────────── */
.docs-hero {
  position: relative;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}
.docs-hero::before {
  content: '';
  position: absolute;
  top: -3rem; left: -3rem; right: -3rem;
  height: 320px;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(167,139,250,0.13) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.docs-hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  margin-bottom: 1.5rem;
}

/* ── Docs footer (matches site-footer baseline) ────────────────── */
footer.doc-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.75rem 3rem;
  max-width: 1280px;
  margin: 4rem auto 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 1rem;
}
footer.doc-footer .right {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-dim);
}

/* ── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 920px) {
  .doc-shell {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: calc(var(--nav-height) + 0.5rem) 1.25rem 2rem;
  }
  aside.sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--surface);
  }
  main.doc-content h2 { margin-top: 3rem; padding-top: 1.5rem; }
  pre { font-size: 0.76rem; padding: 0.85rem 1rem; }
}
