/*adapted from https://github.com/arco-project/arco-static/blob/main/html/css/editions-toc.css*/

#toc .nav-link {
    padding: 0.25rem 0.75rem;
    color: var(--bs-secondary-color);
    border-left: 2px solid transparent;
}

#toc .nav-link:hover {
    color: var(--bs-emphasis-color);
}

#toc > ul > .nav-item > .nav-link {
    font-weight: 500;
}

#toc ul ul {
    border-left: 1px solid var(--bs-border-color);
}

#toc ul ul .nav-link {
    font-size: 0.825rem;
}

#toc ul ul ul .nav-link {
    font-size: 0.725rem;
}

/*align with KRP color scheme*/
#toc .nav-link.active {
    color: var(--dse-base-color);
    border-left-color: var(--dse-base-color);
}

/*for 2nd layer of sticky sidebar navigation:
hide nested lists that follow after inactive 1st-layer link;
but only if JavaScript is enabled (because ScrollSpy needs it)*/
@media (scripting: enabled) {
    #toc ul a.nav-link:not(.active) + ul {
        display: none;
    }
}

/*above Bootstrap lg breakpoint (when sidebar is sticky),
limit sidebar navigation to screen height and add scrollbar if it overflows*/
@media (min-width: 992px) {
    nav#toc {
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}
