/* =================================================================
   AGB-Page — Walz-Schenk
   Self-contained legal page. Uses schenk.css design tokens.
   Nav is static/solid here (no hero, no main.js scroll logic),
   so no .on-hero overrides are needed.
   ================================================================= */

:root {
  --agb-nav-h: 76px;     /* fixed nav height (logo 43 + 2×1rem pad + 1px border) */
  --agb-tabs-h: 52px;    /* sticky tab bar height */
}

/* ---------- Page nav: always solid + light, never hides ---------- */
.nav--page {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--neutral-100);
  border-bottom: 1px solid var(--border-light);
}
.nav--page .nav-link { color: var(--neutral-500); }
.nav--page .nav-link:hover { color: var(--coal); }

/* ---------- Page hero ---------- */
.agb-hero {
  background-color: var(--bg-inverse);
  color: var(--text-inverse);
  padding: clamp(4.5rem, 9vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
  margin-top: var(--agb-nav-h);
}
/* Eyebrow uses the shared .label-wrap component (see schenk.css) so the
   plus-icon is sized correctly; this block just handles spacing. */
.agb-hero__eyebrow {
  margin-bottom: 1.5rem;
}
.agb-hero__title {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.97;
  margin-bottom: 1.25rem;
}
.agb-hero__meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---------- Tab bar (sticky under nav) ---------- */
.agb-tabs-bar {
  background-color: var(--white);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: var(--agb-nav-h);
  z-index: 80;
}
.agb-tabs-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.agb-tabs-inner::-webkit-scrollbar { display: none; }
.agb-tab-btn {
  padding: 1rem 1.5rem 0.9rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.agb-tab-btn:hover { color: var(--text-primary); }
.agb-tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--yellow);
}

/* ---------- Layout ---------- */
.agb-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(2rem, 4vw, 5rem);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
  align-items: start;
}

/* ---------- Sidebar TOC ---------- */
.agb-toc {
  position: sticky;
  top: calc(var(--agb-nav-h) + var(--agb-tabs-h) + 2rem);
  max-height: calc(100vh - var(--agb-nav-h) - var(--agb-tabs-h) - 4rem);
  overflow-y: auto;
  scrollbar-width: none;
}
.agb-toc::-webkit-scrollbar { display: none; }

.agb-toc__title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.agb-toc__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.agb-toc__link {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.45rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  line-height: 1.35;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  margin-left: -0.75rem;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.agb-toc__link:hover { color: var(--text-primary); }
.agb-toc__link.active {
  color: var(--text-primary);
  border-left-color: var(--yellow);
  font-weight: 500;
}
.agb-toc__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--neutral-300);
  flex-shrink: 0;
  min-width: 1.6rem;
}

/* ---------- Panel ---------- */
.agb-panel { display: none; }
.agb-panel.active { display: block; }

/* ---------- Accordion (details/summary) ---------- */
.agb-section {
  border-bottom: 1px solid var(--border-light);
  /* keep opened anchors clear of the fixed nav + sticky tab bar */
  scroll-margin-top: calc(var(--agb-nav-h) + var(--agb-tabs-h) + 1.5rem);
}
.agb-section:first-child {
  border-top: 1px solid var(--border-light);
}
.agb-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}
.agb-section summary::-webkit-details-marker { display: none; }
.agb-section summary:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.agb-section__heading {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.agb-section__num {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  min-width: 1.8rem;
  flex-shrink: 0;
}
.agb-section__title {
  font-size: var(--fs-base);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
.agb-section__chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform var(--dur-fast) var(--ease);
}
.agb-section[open] .agb-section__chevron {
  transform: rotate(180deg);
}
.agb-section[open] summary { border-bottom: 1px solid var(--border-light); }

.agb-body {
  padding: 1.5rem 0 2rem calc(1.8rem + 0.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 68ch;
}
.agb-body p {
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--text-primary);
}
.agb-body ul {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.agb-body ul li {
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-primary);
}

/* ---------- Toolbar: expand/collapse all ---------- */
.agb-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.agb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--dur-fast) var(--ease);
}
.agb-back:hover { color: var(--text-primary); }
.agb-expand {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.4rem 0;
  transition: color var(--dur-fast) var(--ease);
}
.agb-expand:hover { color: var(--coal); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .agb-layout { grid-template-columns: 1fr; }
  .agb-toc { display: none; }
}
@media (max-width: 600px) {
  .agb-tab-btn { padding: 0.9rem 1rem 0.8rem; font-size: var(--fs-xs); }
  .agb-body { padding-left: 0; }
}
