
/* TOC container and alignment */

.toc {
    overflow-x: hidden;
    font-size: 0.875rem !important;
}

.toc .row {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Common TOC link styles */
.toc .toc-link, .toc .toc-header {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
    /* text-overflow: ellipsis;
    white-space: nowrap; */
    border-left: 3px solid transparent;
    text-decoration: none;
    border-radius: 5px;
    padding: 5px;
    padding-right: 0.25rem!important;
    margin: 0;
    margin-right: 0.5rem !important;
    font-size: 0.875rem !important;
}

.toc .toc-link {
    text-overflow: ellipsis;
    white-space: nowrap;
}



.toc .toc-link  {
    cursor: pointer;
    color: var(--bs-primary-text) !important;

}

.toc .toc-header {
    pointer-events: none;
    color: var(--bs-secondary-text) !important;
}

.toc .toc-link.disabled  {
    pointer-events: none;
    color: var(--primary-400) !important;
}



.toc .toc-link:hover {
    background-color: var(--primary-100);
    border-left-color: var(--primary-300);
}

.toc .toc-link.active {
    border-left-color: var(--primary-500);
}

/* TOC indentation levels - using padding-left to ensure consistent width */
.toc .indent-0 { padding-left: 0.5rem; }
.toc .indent-1 { padding-left: 1.0rem; }
.toc .indent-2 { padding-left: 2.0rem; font-style: none;}
.toc .indent-3 { padding-left: 2.5rem; font-size: 1.0em;}
.toc .toc-header {font-weight: bold;}



/* Resizable TOC sidebar */
.toc-sidebar {
    width: 310px;
    min-width: 155px;
    max-width: 310px;
    flex-shrink: 0;
    position: relative;
}

.toc-sidebar.toc-sidebar--hidden {
    display: none !important;
}

#toc-hide-button {
    width: 30px;
    height: 30px;
    padding: 0;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}

/* Floating TOC button — paired with the chatbot button on the opposite side. */
#toc-toggle-btn {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 50;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
    transition: background-color 0.2s, transform 0.15s;
}

#toc-toggle-btn:active {
    transform: scale(0.93);
}

@media (min-width: 768px) {
    #toc-toggle-btn {
        display: none;
    }

    #toc-toggle-btn.toc-toggle-btn--visible {
        display: flex;
    }
}

/* Drag-to-resize handle */
#toc-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 6px;
    cursor: ew-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.15s;
}

#toc-resize-handle:hover,
#toc-resize-handle:active {
    background: var(--primary-200, rgba(79, 85, 176, 0.18));
}
