/* Foldable documentation table of contents. */

:root {
    --sze-foldable-toc-height: calc(100vh - 200px);
}

.mxn-toc-view {
    font-size: 0.95rem;
    height: var(--sze-foldable-toc-height);
    padding-right: 20px;
    position: relative;
}

.mxn-toc-view .scroll-area {
    height: var(--sze-foldable-toc-height);
    margin-top: 20px;
    overflow-x: hidden;
    overflow-y: auto;
}

.mxn-toc-view > .scroll-area::-webkit-scrollbar {
    width: 5px;
}

.mxn-toc-view > .scroll-area::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--color-scrollbar-thumb) 22%, transparent);
    border: 0;
}

.mxn-toc-view ul {
    list-style: none;
    padding-left: 0;
}

.mxn-toc-view ul ul {
    margin-left: 20px;
    padding-left: 0;
}

.mxn-toc-view li {
    margin: 3px 0;
}

.mxn-toc-view li.nested > ul {
    display: none;
}

.mxn-toc-view li.nested,
.mxn-toc-view li.terminal {
    line-height: 25px;
}

.mxn-toc-view li.terminal {
    margin-left: 20px;
}

.mxn-toc-view li.open > ul {
    display: block;
}

.mxn-toc-view a {
    color: var(--col-text-light);
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mxn-toc-view .terminal a {
    display: block;
    width: 100%;
}

.mxn-toc-view .toggle {
    align-items: center;
    cursor: pointer;
    display: flex;
    width: 100%;
}

.mxn-toc-view .toggle:hover {
    background: var(--col-gray-light-darker);
}

.mxn-toc-view .arrow {
    color: var(--col-text-very-light);
    display: inline-block;
    font-size: 0.7em;
    margin-right: 1em;
    opacity: 0.6;
    transform: rotate(0deg);
    transition: transform 0.2s;
    user-select: none;
}

.mxn-toc-view .nested.open > .toggle > .arrow {
    transform: rotate(90deg);
}

.mxn-toc-view .expander {
    background: transparent;
    border: 0;
    color: var(--col-text-light);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    position: fixed;
}

@media (max-width: 1600px) {
    .mxn-toc-view {
        display: none;
    }
}
