/* ==============================================
   ANTIGRAVITY TOC STYLES
   ============================================== */

.antigravity-toc {
    box-sizing: border-box;
    margin: 2rem auto 2rem auto;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 645px;
}

.antigravity-toc__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.antigravity-toc__title {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.antigravity-toc__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

.antigravity-toc__toggle:hover {
    background: #e2e8f0;
    color: #334155;
}

.antigravity-toc__icon {
    transition: transform 0.25s ease;
}

.antigravity-toc__toggle[aria-expanded="false"] .antigravity-toc__icon {
    transform: rotate(-90deg);
}

.antigravity-toc__list {
    margin: 0;
    padding: 0 0 0 1.25rem;
    list-style: decimal;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease;
}

.antigravity-toc__list[aria-hidden="true"] {
    max-height: 0 !important;
    opacity: 0;
    overflow: hidden;
}

.antigravity-toc__list li {
    margin: 0.2rem 0;
}

.antigravity-toc__list li a {
    color: #334155;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.antigravity-toc__list li a:hover {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* Sub-headings (h3) */
.antigravity-toc__item--sub {
    margin-left: 1rem;
    list-style-type: disc;
    font-size: 0.85rem;
}

/* Active section highlight (JS adds .is-active) */
.antigravity-toc__list li.is-active>a {
    color: #2563eb;
    font-weight: 600;
}

/* Smooth scroll target offset */
:target {
    scroll-margin-top: 2rem;
}

/* Responsive */
@media (max-width: 600px) {
    .antigravity-toc {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .antigravity-toc__item--sub {
        margin-left: 0.75rem;
    }
}