/* ==============================
   Table of Contents (TOC)
   ============================== */
.toc-nav {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 1.5rem 0;
}

.toc-nav .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.toc-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a237e;
    margin: 0 0 0.75rem 0;
}

.toc-title i {
    margin-right: 0.4rem;
    color: #3f51b5;
}

.toc-list {
    list-style: none;
    counter-reset: toc-counter;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.4rem 1.5rem;
}

.toc-list li {
    counter-increment: toc-counter;
}

.toc-list li::before {
    content: counter(toc-counter) ". ";
    font-weight: 600;
    color: #3f51b5;
}

.toc-list a {
    color: #37474f;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.toc-list a:hover {
    color: #1a237e;
    text-decoration: underline;
}

/* Smooth scroll for anchor links */
html {
    scroll-behavior: smooth;
}

/* Offset anchored headings for fixed headers */
.hvad-er-page [id] {
    scroll-margin-top: 80px;
}

@media (max-width: 600px) {
    .toc-list {
        grid-template-columns: 1fr;
    }

    .toc-nav {
        padding: 1rem 0;
    }
}
