/* A quiet chapter index: native in-page links, enhanced into a side rail. */
.section-nav { max-width: var(--max); margin: 24px auto; padding: 0 24px; }
.section-nav-heading { margin: 0 0 12px; color: var(--soft); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.section-nav-list { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.section-nav-list li[hidden] { display: none; }
.section-nav-list a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 2px; color: var(--muted); font-size: .875rem; line-height: 1.4; text-decoration: none; transition: color 180ms ease; }
.section-nav-list a:hover, .section-nav-list a:focus-visible { color: var(--gold-pale); }
.section-nav-marker { position: relative; flex: 0 0 7px; height: 7px; border: 1px solid var(--copper); border-radius: 50%; transition: background 180ms ease, box-shadow 180ms ease; }
.section-nav-list a[aria-current="location"] { color: var(--gold-pale); }
.section-nav-list a[aria-current="location"] .section-nav-marker { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(212,168,67,.12); }
.section-nav.is-enhanced { position: fixed; z-index: 35; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); margin: 0; padding: 0; max-width: calc(100vw - 88px); }
.section-nav.is-enhanced .section-nav-heading { display: none; }
.section-nav.is-enhanced .section-nav-list { display: none; position: absolute; left: 0; bottom: calc(100% + 12px); width: min(280px, calc(100vw - 88px)); max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px; border: 1px solid rgba(212,168,67,.25); border-radius: 16px; background: #100f0c; box-shadow: 0 16px 48px rgba(0,0,0,.4); }
.section-nav.is-open .section-nav-list { display: block; }
.section-nav-toggle { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 12px 16px; border: 1px solid rgba(212,168,67,.3); border-radius: 24px; background: rgba(16,15,12,.96); color: var(--gold-pale); font: 500 .875rem/1.4 "Inter", sans-serif; cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.section-nav-toggle[hidden] { display: none; }
.section-nav-toggle:hover { border-color: var(--gold); }
.section-nav-toggle svg { flex-shrink: 0; color: var(--gold); }
.section-nav-chevron { margin-left: 4px; transition: transform 180ms ease; }
.section-nav.is-open .section-nav-chevron { transform: rotate(180deg); }
/* Leave room to reach the last footer links behind the compact control. */
@media (max-width: 1479px), (max-height: 599px) {
  body:has(.section-nav.is-enhanced) .site-footer { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (min-width: 1480px) and (min-height: 600px) {
  .section-nav.is-enhanced { left: auto; right: max(16px, calc((100vw - 1520px) / 2)); top: 50%; bottom: auto; transform: translateY(-50%); width: 140px; max-height: calc(100dvh - 220px); overflow-y: auto; padding: 8px; }
  .section-nav.is-enhanced .section-nav-toggle { display: none; }
  .section-nav.is-enhanced .section-nav-heading { display: block; font-size: .75rem; letter-spacing: .06em; }
  .section-nav.is-enhanced .section-nav-list { display: block; position: static; width: auto; max-height: none; overflow: visible; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .section-nav-list li + li .section-nav-marker::before { content: ""; position: absolute; width: 1px; height: 28px; bottom: 13px; left: 2px; background: linear-gradient(var(--line), rgba(196,97,42,.3)); }
  .section-nav-list a { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .section-nav *, .section-nav *::before { transition: none; }
}
@media print { .section-nav { display: none; } }
