/* 文章目錄 (TOC) 樣式
 * 與 post.css 一起載入（見各主題 post.php 的 $required_styles）。
 * 全部使用 CSS 變數，透過 get_style_paths() 的 fallback 由三套主題共用同一份、
 * 自動套用各自的主題配色（cloudmax / h3platform 無同名檔即退回此檔）。
 */

/* 點目錄錨點時平滑捲動 */
html {
    scroll-behavior: smooth;
}

/* 錨點落點避免貼齊視窗頂端 */
.autoblogKibo .article-text h2,
.autoblogKibo .article-text h3 {
    scroll-margin-top: 1.5rem;
}

.autoblogKibo .table-of-contents {
    margin: 2rem 0;
    padding: 1.5rem 1.75rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
}

.autoblogKibo .toc-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.autoblogKibo .toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc-h2;
}

.autoblogKibo .toc-sublist {
    list-style: none;
    margin: 0.4rem 0 0.6rem 1.25rem;
    padding: 0;
}

.autoblogKibo .toc-item {
    margin: 0.35rem 0;
    line-height: 1.6;
}

/* h2 主項：自動數字編號 */
.autoblogKibo .toc-item-h2 {
    counter-increment: toc-h2;
}

.autoblogKibo .toc-item-h2 > .toc-link::before {
    content: counter(toc-h2) ". ";
    color: var(--primary-color);
    font-weight: 600;
}

/* h3 子項：縮排 + 連字號標記 */
.autoblogKibo .toc-item-h3 {
    position: relative;
    padding-left: 1rem;
}

.autoblogKibo .toc-item-h3::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--primary-light);
}

.autoblogKibo .toc-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.autoblogKibo .toc-item-h2 > .toc-link {
    color: var(--text-primary);
    font-weight: 600;
}

.autoblogKibo .toc-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}
