/* ========================================
   TOC (목차) 스타일
   ======================================== */

/* TOC 컨테이너 - side-actions와 동일한 패턴 */
.side-toc {
    position: absolute;
    left: calc(50% + 400px);
    height: 100%;
}

.toc-container {
    position: sticky;
    top: 160px;
    width: 200px;
    max-height: calc(100vh - 400px);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--quantum-border-light);
    border-radius: 8px;
    padding: 8px;
    background: var(--quantum-bg-primary);
}

/* TOC 네비게이션 */
.toc-nav {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--quantum-border-medium) transparent;
}

.toc-nav::-webkit-scrollbar {
    width: 4px;
}

.toc-nav::-webkit-scrollbar-track {
    background: transparent;
}

.toc-nav::-webkit-scrollbar-thumb {
    background: var(--quantum-border-medium);
    border-radius: 2px;
}

/* 목록 */
.toc-list {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}

.toc-item {
    margin-bottom: 2px;
}

.toc-link {
    display: block;
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--quantum-text-tertiary);
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toc-link:hover {
    color: var(--quantum-text-secondary);
    background: var(--quantum-bg-secondary);
}

/* 활성 상태 - 포인트 컬러 */
.toc-link.active {
    color: var(--quantum-point);
    background: var(--quantum-point-light);
    font-weight: 500;
}

/* 상대적 depth별 들여쓰기 */
.toc-item[data-depth="0"] .toc-link {
    padding-left: 8px;
}

.toc-item[data-depth="1"] .toc-link {
    padding-left: 20px;
    font-size: 12px;
}

.toc-item[data-depth="2"] .toc-link {
    padding-left: 32px;
    font-size: 12px;
}

.toc-item[data-depth="3"] .toc-link {
    padding-left: 44px;
    font-size: 12px;
}

/* TOC 숨김 (헤딩 없을 때) */
.side-toc.hidden {
    display: none;
}

/* ========================================
   반응형 - 1199px 이하 숨김
   ======================================== */
@media (max-width: 1199px) {
    .side-toc {
        display: none;
    }
}
