/* ───────────────────────────────────────────────────────────────
   site-nav.css: persistent sidebar menu
   Loaded by every published page.
   Uses fallback CSS variables so it works in both Style A and B.
   ─────────────────────────────────────────────────────────────── */

.nav-toggle {
  position: fixed; top: 14px; left: 14px; z-index: 200;
  background: rgba(8, 10, 18, 0.85);
  color: var(--gold-bright, var(--gold, #c8a84b));
  border: 1px solid rgba(200, 168, 75, 0.35);
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 0.7rem; letter-spacing: 0.28em;
  padding: 8px 14px; border-radius: 2px;
  cursor: pointer; text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.nav-toggle:hover { background: rgba(40, 28, 12, 0.95); }

.site-nav {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px;
  background: rgba(8, 10, 18, 0.96);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(200, 168, 75, 0.18);
  padding: 64px 20px 26px;
  z-index: 190;
  font-family: 'Cormorant Garamond', 'Crimson Pro', Georgia, serif;
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
}
/* scrollable middle — title above and foot below stay pinned */
.nav-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.site-nav.open {
  transform: translateX(0);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.6);
}

.site-nav-title {
  flex-shrink: 0;
  display: block;
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 1.2rem;
  letter-spacing: 0.28em;
  color: var(--gold-bright, var(--gold, #c8a84b));
  text-decoration: none;
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(200, 168, 75, 0.18);
}

.nav-section { margin-bottom: 22px; }
.nav-section-label {
  display: block;
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 0.6rem; letter-spacing: 0.32em;
  color: var(--gold-dim, #8a6e28);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.nav-section-link {
  text-decoration: none;
  padding: 2px 0 4px;
  border-bottom: 1px solid rgba(200, 168, 75, 0.12);
  transition: color 0.15s, border-color 0.15s;
}
.nav-section-link:hover {
  color: var(--gold-bright, var(--gold, #c8a84b));
  border-bottom-color: rgba(200, 168, 75, 0.4);
}
.nav-section-link.is-current {
  color: var(--gold-bright, var(--gold, #c8a84b));
  border-bottom-color: var(--gold, #c8a84b);
}
.nav-foot {
  flex-shrink: 0;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid rgba(200, 168, 75, 0.18);
}
.nav-foot-link {
  display: block;
  font-family: 'Cormorant SC', 'Cinzel', serif;
  font-size: 0.62rem; letter-spacing: 0.28em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gold, #c8a84b);
  text-decoration: none;
  padding: 9px 10px;
  border: 1px solid rgba(200, 168, 75, 0.28);
  border-radius: 3px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav-foot-link:hover {
  color: var(--gold-bright, #f0d080);
  border-color: rgba(200, 168, 75, 0.55);
  background: rgba(200, 168, 75, 0.06);
}

.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-list a {
  display: block;
  padding: 4px 10px;
  color: var(--text-dim, #8a8070);
  text-decoration: none;
  font-size: 0.92rem;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav-list a:hover {
  color: var(--text, #d0c8a8);
  border-left-color: rgba(200, 168, 75, 0.4);
  background: rgba(200, 168, 75, 0.05);
}
.nav-list a.is-current {
  color: var(--gold-bright, var(--gold, #c8a84b));
  border-left-color: var(--gold, #c8a84b);
  background: rgba(200, 168, 75, 0.08);
}

.nav-scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 180;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.nav-scrim.open { opacity: 1; pointer-events: auto; }

/* ── Accordion rows (recursive) ──────────────────────────────────
   Each <li class="nav-domain"> carries data-depth="N" where 1 is
   a top-level row inside a section's .nav-list, and each nesting
   level adds 1. Depth drives indent, font-size, and dim: so the
   tree can recurse 4–5 levels without the labels becoming cramped.
   ────────────────────────────────────────────────────────────── */
.nav-domain-row {
  display: flex;
  align-items: stretch;
}
.nav-domain-row > a {
  flex: 1;
  min-width: 0;
}
.nav-expand {
  background: transparent;
  border: 0;
  color: var(--gold-dim, #8a6e28);
  cursor: pointer;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  line-height: 1;
  display: flex;
  align-items: center;
  border-left: 2px solid transparent;
  transition: transform 0.22s ease, color 0.15s;
}
.nav-expand:hover {
  color: var(--gold-bright, var(--gold, #c8a84b));
}
.nav-domain.expanded > .nav-domain-row > .nav-expand {
  transform: rotate(90deg);
  color: var(--gold, #c8a84b);
}
.nav-sublist {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}
.nav-domain.expanded > .nav-sublist {
  max-height: 2400px;
}

/* Per-depth indent + size cascade.
   Depth 1 inherits the default .nav-list a styling (font-size 0.92rem,
   padding-left 10px). Each deeper level steps in ~14px and ticks the
   font-size and opacity down a notch so the hierarchy reads cleanly. */
.nav-domain[data-depth="2"] > .nav-domain-row > a {
  padding-left: 24px;
  font-size: 0.88rem;
}
.nav-domain[data-depth="3"] > .nav-domain-row > a {
  padding-left: 38px;
  font-size: 0.85rem;
  opacity: 0.94;
}
.nav-domain[data-depth="4"] > .nav-domain-row > a {
  padding-left: 52px;
  font-size: 0.82rem;
  opacity: 0.88;
}
.nav-domain[data-depth="5"] > .nav-domain-row > a {
  padding-left: 66px;
  font-size: 0.80rem;
  opacity: 0.84;
}

@media (max-width: 600px) {
  .site-nav { width: 86vw; }
}

/* ── KEYBOARD FOCUS (WCAG 2.4.7) ──────────────────────────────
   Loaded by every page (Style A and Style B), so this is the
   universal focus indicator for the site. Uses the gold accent
   so the ring is visible on both the warm dark Style-B background
   and the cool void Style-A background. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold-bright, var(--gold, #f0d080));
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── GM-VETTED BADGE ───────────────────────────────────────────
   Marks a page the GM has personally read through and
   corrected. Added by hand near the footer; a PostToolUse hook
   flags it for removal whenever the page takes a more-than-minor
   edit. Var-based so it reads on both Style A and Style B. */
.gm-vetted {
  display: block;
  width: fit-content;
  margin: 14px auto 0;
  padding: 5px 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: 'Cinzel', 'Cormorant SC', serif;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-bright, var(--gold, #c8a84b));
  opacity: 0.8;
}
.gm-vetted time { letter-spacing: 0.12em; }
