/*
 * SASE Codex — Edge Solutions
 * TOC Sidebar Stylesheet · toc.css
 * Edge Documents v0.2 brand tokens
 * Fixed left-side Table of Contents — auto-generated from h2/h3 via toc.js
 */

/* ============================================================
   SIDEBAR LAYOUT
   ============================================================ */
.toc-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(72,109,135,0.18);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.toc-sidebar::-webkit-scrollbar       { width: 4px; }
.toc-sidebar::-webkit-scrollbar-track { background: transparent; }
.toc-sidebar::-webkit-scrollbar-thumb { background: var(--edge-muted); border-radius: 2px; opacity: 0.5; }

/* Header strip inside TOC */
.toc-sidebar__header {
  background: #2d4a5c;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 2px solid var(--edge-green);
}
.toc-sidebar__title {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--edge-green);
  text-transform: uppercase;
}

/* Mobile toggle button */
.toc-toggle-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  transition: color var(--dur-fast);
}
.toc-toggle-btn:hover { color: var(--edge-green); }

/* ============================================================
   TOC ITEM LIST
   ============================================================ */
.toc-sidebar__list {
  list-style: none;
  padding: 10px 0;
  flex: 1;
}
.toc-sidebar__link {
  display: block;
  padding: 5px 16px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--edge-dark);
  text-decoration: none;
  line-height: 1.4;
  border-left: 3px solid transparent;
  transition: color var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
}
.toc-sidebar__link:hover {
  color: var(--edge-blue);
  background: rgba(72,109,135,0.06);
}

/* h3-level entries — indented */
.toc-sidebar__item--h3 .toc-sidebar__link {
  padding-left: 28px;
  font-size: 11px;
  color: var(--edge-muted);
}
.toc-sidebar__item--h3 .toc-sidebar__link:hover {
  color: var(--edge-blue);
}

/* Active section highlight */
.toc-sidebar__link.is-active {
  color: var(--edge-blue);
  border-left-color: var(--edge-green);
  background: rgba(198,210,25,0.10);
  font-weight: 700;
}
.toc-sidebar__item--h3 .toc-sidebar__link.is-active {
  color: var(--edge-blue);
}

/* ============================================================
   MOBILE — collapse to drawer
   ============================================================ */
@media (max-width: 900px) {
  .toc-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    transform: translateX(-100%);
    transition: transform var(--dur-normal) var(--ease-spring);
    box-shadow: 4px 0 24px rgba(72,109,135,0.20);
  }
  .toc-sidebar.is-open {
    transform: translateX(0);
  }

  .toc-toggle-btn { display: block; }

  .toc-open-btn {
    display: flex;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: var(--edge-blue);
    color: var(--edge-green);
    border: none;
    border-radius: var(--r-sm);
    padding: 7px 10px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(72,109,135,0.25);
    transition: background var(--dur-fast), box-shadow var(--dur-fast);
  }
  .toc-open-btn:hover {
    background: #2d4a5c;
    box-shadow: 0 4px 16px rgba(72,109,135,0.30);
  }
  .toc-open-btn.is-hidden { display: none; }

  .toc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 99;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .toc-overlay.is-active { display: block; }
}

@media (min-width: 901px) {
  .toc-open-btn { display: none; }
  .toc-overlay  { display: none; }
}
