/* Sidebar Table of Contents — shared component */

.sidebar {
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 3px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.sidebar h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-faint);
    margin-bottom: 16px;
    font-weight: 600;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 2px;
}

.sidebar a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 0;
    transition: color 0.2s, border-color 0.2s;
    line-height: 1.4;
}

.sidebar a:hover {
    color: var(--text);
}

.sidebar a.active {
    color: var(--text);
    font-weight: 700;
}

/* Top-level sections: larger, semi-bold, grouped with spacing */
.sidebar > nav > ul > li {
    margin-top: 16px;
}

.sidebar > nav > ul > li:first-child {
    margin-top: 0;
}

.sidebar > nav > ul > li > a {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-left: 3px solid transparent;
    padding-left: 10px;
}

.sidebar > nav > ul > li > a.active {
    border-left-color: var(--text);
}

/* Subsections: smaller, indented under parent */
.sidebar .subsection {
    padding-left: 14px;
    margin-top: 4px;
}

.sidebar .subsection a {
    font-size: 12px;
    color: var(--text-faint);
    padding: 4px 0;
    border-left: 2px solid transparent;
    padding-left: 10px;
}

.sidebar .subsection a:hover {
    color: var(--text-muted);
}

.sidebar .subsection a.active {
    border-left-color: var(--text);
}
