.custom-toc {
    display: block;
    position: fixed;
    top: 100px;
    white-space: normal;
    word-break: break-word;
    width: calc(100% - 80%);
    margin-left: 10px;
    -webkit-box-shadow: none;
    box-shadow: none;
    padding: 10px 20px 10px 10px;
    opacity: 0; /* Masqué par défaut */
    pointer-events: none;
    overflow: hidden;
    transition: opacity 0.5s ease-in-out; /* Transition uniquement sur l'opacité */
}

.custom-toc.show {
    pointer-events: initial;
    opacity: 1; /* Affiche avec un effet de fade in */
}

.custom-header .title {
    transition: opacity 0.5s ease-in-out; /* Transition pour l'opacité */
    display: block;
    width: 100%;
    opacity: 0; /* Masqué par défaut */
}

.custom-header .title.show {
    opacity: 1; /* Affiche le titre avec un effet de fade in */
}

body {
    scroll-behavior: smooth;
}

.custom-toc ul {
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
}

.custom-toc ul li {
    list-style: none;
    padding: 3px;
    font-weight: 500;
    font-size: 95%;
    background: 0 0;
    line-height: 1.6;
    margin: 0;
    overflow: hidden;
}

.scroll-progress-bar {
    transition-delay: 0s;
    transition-duration: 200ms;
    transition-property: width;
    transition-timing-function: ease;
    position: absolute;
}

.custom-toc.collapsed {
    display: none;
}

.custom-toc-toggle {
    cursor: pointer;
    color: #0073aa;
    text-decoration: underline;
}

.collapse-icon, .expand-icon {
    display: none;
}

@media (max-width: 961px) {
    .custom-toc {
        inset: 0;
        top: auto;
        z-index: 1000;
        margin: 0;
        width: 100%;
        background: #FFF!important;
        padding: 20px;
        box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
    }

    .custom-toc ul {
        transition: max-height 300ms ease-out;
        max-height: 0;
        overflow: hidden;
    }
    .expand ul {
        transition: max-height 300ms ease-out;
        max-height: 70svh;
        overflow: auto;
    }

    .collapse-icon, .expand-icon {
        pointer-events: none;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        font-size: 2rem;
        font-weight: bold;
    }

    .expand-icon {
        display: none;
    }

    .collapse-icon {
        display: inline;
    }

    .expand .expand-icon {
        display: inline;
    }

    .expand .collapse-icon {
        display: none;
    }
}