/* ── Left sidebar TOC — auto-generated from page headings ── */

.sidebar-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 60px);
  align-items: start;
}

.sidebar-nav {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  padding: 40px 0;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-nav-heading {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 24px;
  margin-bottom: 12px;
}

.sidebar-nav a {
  display: block;
  padding: 6px 24px;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.sidebar-nav a:hover { color: var(--gold); background: rgba(184,137,42,0.06); }
.sidebar-nav a.active { color: var(--gold); }

.sidebar-nav .nav-divider {
  height: 1px;
  background: var(--rule);
  margin: 12px 24px;
}

.sidebar-nav-top {
  display: block;
  padding: 6px 24px;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}
.sidebar-nav-top:hover { opacity: 1; color: var(--gold); }

/* Hamburger toggle button — only visible on mobile */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 100px;
  left: 1rem;
  z-index: 200;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--fg);
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--shadow);
}

@media (max-width: 860px) {
  .sidebar-layout {
    grid-template-columns: 1fr;
  }
  .sidebar-nav {
    position: fixed;
    top: 60px;
    left: -240px;
    width: 240px;
    height: calc(100vh - 60px);
    background: var(--bg);
    border-right: 1px solid var(--rule);
    z-index: 150;
    transition: left 0.25s ease;
    padding: 24px 0;
    overflow-y: auto;
  }
  .sidebar-nav.open {
    left: 0;
    box-shadow: 4px 0 20px var(--shadow);
  }
  .sidebar-toggle {
    display: flex;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 140;
  }
  .sidebar-overlay.open { display: block; }
}
