/* =========================================================
   TOC Sidebar Panel
   ========================================================= */

/* Hidden on small screens, sticky on large */
.toc-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .toc-sidebar {
    display: block;
    max-width: 37.5em; /* ~600px */
    position: sticky;
    top: calc(var(--header-height, 64px) + 40px);
    align-self: start;
    z-index: 9998;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--panel-bg);
    border-radius: 12px;
    box-shadow: var(--panel-shadow);
  }
}

/* =========================================================
   TOC Title
   ========================================================= */
.toc-title {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--foreground);
  margin-bottom: 1rem;
  transition: text-shadow 0.3s ease, color 0.3s ease;
}
.toc-title:hover {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent);
}

/* =========================================================
   TOC List
   ========================================================= */
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-list a {
  display: block;
  text-decoration: none;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: color 0.2s ease, text-shadow 0.3s ease;
  padding: 0.25em 0;
}

.toc-list a:hover {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent), 0 0 16px var(--accent);
}

/* =========================================================
   Indentation per level
   ========================================================= */
.toc-lv {
  margin-top: 0.25em;
}
.toc-lv-1 {
  margin-left: 0;
  font-weight: bold;
}
.toc-lv-2 { margin-left: 1rem; }
.toc-lv-3 { margin-left: 2rem; }
.toc-lv-4 { margin-left: 3rem; }
.toc-lv-5 { margin-left: 4rem; }

/* =========================================================
   Active link
   ========================================================= */
.toc-active {
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
}
