/* Table of Contents Styles */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

.toc-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.5;
    transition: all 0.2s ease;
    text-align: left;
    border-left: 2px solid transparent;
}

.toc-link:hover {
    background: rgba(30, 41, 59, 0.5);
    color: #f1f5f9;
    padding-left: 14px;
}

.toc-link.active {
    background: rgba(30, 58, 138, 0.3);
    color: #3b82f6;
    font-weight: 600;
    border-left-color: #3b82f6;
}

.toc-number {
    font-family: monospace;
    opacity: 0.5;
    font-size: 11px;
    margin-top: 1px;
}

/* Ensure headings have scroll margin for sticky headers */
article h2 {
    scroll-margin-top: 100px;
}

/* Mobile Drawer Polishing */
#mobile-toc-btn {
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
}

#mobile-toc-drawer.invisible {
    pointer-events: none;
}

#mobile-toc-content {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-toc-list .toc-link {
    padding: 12px 16px;
    font-size: 14px;
}

@media (max-width: 1023px) {
    #mobile-toc-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}