/* Article TOC Widget Styles */

/* Progressive enhancement: smooth page scroll + offset for fixed headers */
html {
    scroll-behavior: smooth;
}

[id^="toc-"] {
    scroll-margin-top: 80px;
}

.article-toc {
    font-size: 14px;
    line-height: 1.6;
}

.article-toc .toc-root {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-toc .toc-sub {
    list-style: none;
    margin: 2px 0 2px 16px;
    padding: 0;
}

.article-toc .toc-item {
    margin: 0;
    padding: 0;
}

.article-toc .toc-item a {
    display: block;
    padding: 4px 8px;
    color: #555;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.article-toc .toc-item a:hover {
    background-color: #f0f0f0;
    color: #333;
}

.article-toc .toc-item a:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Active heading highlight */
.article-toc .toc-item a.active {
    background-color: #e8f0fe;
    color: #1a73e8;
    border-left-color: #1a73e8;
    font-weight: 500;
}

/* Level indentation hints */
.article-toc .toc-level-1 {
    font-weight: 600;
}

.article-toc .toc-level-2 {
    font-weight: 500;
}

/* Fixed TOC mode when sidebar uses sticky */
.article-toc.toc-fixed {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Scrollbar styling for fixed mode */
.article-toc.toc-fixed::-webkit-scrollbar {
    width: 4px;
}

.article-toc.toc-fixed::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}
