/**
 * 目次（Table of Contents）スタイル
 *
 * @package Yorisou
 */

 .table-of-contents {
    background: #f8f9fa;
    border: 2px solid var(--color-primary, #2C5F2D);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem auto;
    width: 70%;
}

.toc-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary, #2C5F2D);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-primary, #2C5F2D);
}

.toc-header i {
    margin-right: 0.5rem;
}

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

.toc-item {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
}

.toc-item::before {
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.toc-item a {
    flex: 1;
    color: var(--color-text, #333);
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color 0.3s ease;
    line-height: 1.6;
}

.toc-item a:hover {
    color: var(--color-primary, #2C5F2D);
    text-decoration: underline;
}

/* h2レベル */
.toc-level-2 {
    font-weight: 600;
    counter-increment: toc-counter;
}

.toc-level-2::before {
    content: counter(toc-counter) ".";
    color: var(--color-primary, #2C5F2D);
    font-weight: 700;
    min-width: 1.5rem;
}

/* h3レベル */
.toc-level-3 {
    padding-left: 2rem;
    font-size: 0.95rem;
}

.toc-level-3::before {
    content: "▸";
    color: var(--color-accent, #8B4513);
    min-width: 1rem;
}

/* h4レベル */
.toc-level-4 {
    padding-left: 3rem;
    font-size: 0.9rem;
    color: #666;
}

.toc-level-4::before {
    content: "-";
    color: #999;
    min-width: 1rem;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .table-of-contents {
        padding: 1rem;
        margin: 1.5rem 0;
    }

    .toc-header {
        font-size: 1.125rem;
    }

    .toc-level-3 {
        padding-left: 1rem;
        font-size: 0.9rem;
    }

    .toc-level-4 {
        padding-left: 2rem;
        font-size: 0.875rem;
    }
}
