/* SIDEBAR */
#sidebar {
    background-color: rgba(0,0,0,0) !important;
    width: 14rem;
    position: absolute;
    left: 2rem;
    margin-top: 10rem;
    padding: 0 !important;
    text-align: left;
}

#sidebar-spacer {
    min-width: 16rem;
    height: 100%;
}

#sidebar-content-wrapper {
    display: flex; gap: 3rem; justify-content: center;
    width: 100vw;

    background-color: white;
    overflow: hidden;

    padding-bottom: 6rem;
}

.topic-subpages-wrapper {
    max-width: 900px;
    text-align: justify;
    display: flex;
    flex-direction: column;
    padding-right: 3rem;
}

#sidebar .nav-link {
    background-color: rgba(0,0,0,0) !important;
    color: black;
    position:relative;
    font-size: 1.4rem;
}

#sidebar .nav-link.sup-link:hover, .chapter-wrapper.active .sup-link {
    color: #81B29A !important;
    font-weight: bold;
}

#sidebar .nav-link.sub-link:hover, #sidebar .nav-link.sub-link.active {
    color: #F2CC8F !important;
}


#sidebar .nav-link.active {
    font-weight: bold;
}

.nav-link.sub-link {
    font-size: 0.9rem !important;
    padding-top: 0 !important;
    color: gray !important;
}

.chapter-wrapper.active .sub-link {
    display: block;
}


.chapter-wrapper.inactive .sub-link {
    display: none
}







#sidebar-mobile-button {
    display: none;
}

.topic-subpages-wrapper.no-sidebary {
    padding: 0 1.5rem;
}

/* mobile */
@media all and (max-width: 680px) {
    #sidebar-wrapper-mobile a.sub-link {
        font-size: 1.2rem !important;
    }


    .imp-special {
        width: 98vw;
    }

    #sidebar-content-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    #sidebar-spacer {
        display: none;
        height: 0; width: 0;
    }

    #sidebar {
        position: static;
        display: block;
        width: 84vw;
        margin-top: 2.5rem;
    }

    .topic-subpages-wrapper {
        padding: 0 1.5rem;
    }


    #mobile-sidebar-background {
        width: 100vw; height: 100vh;
        display: none;
        position: fixed; top: 0; left: 0;
    }

    #mobile-sidebar-background.active {
        display: block;
    }


    #sidebar-mobile-wrapper {
        display: flex; align-items: center; height: 100vh; position: fixed; top:0; left: 0; width: 0; overflow: visible;
    }

    #sidebar-mobile {
        z-index: 2;
        display: flex; align-items: center; justify-content: right;
        height: 40vh; width: 85vw;
        position: absolute; left: -81.4vw;
        background-color: rgba(0, 0, 0, 0.25);
        color: #ffffff;
        border-radius: 1rem;
        cursor: pointer;

        opacity: 0; /* controlled by headerParallax.js */

        -webkit-transition:background-color 0.5s, opacity 0.5s;
        -moz-transition:background-color 0.5s, opacity 0.5s;
        -o-transition:background-color 0.5s, opacity 0.5s;
        transition:background-color 0.5s, opacity 0.5s;



        overflow: hidden;
        max-height: 80vh !important;
    }

    #sidebar-mobile.active {
        background-color: rgba(0, 0, 0, 0.9);
        -webkit-transition:background-color 0.5s, opacity 0.5s;
        -moz-transition:background-color 0.5s, opacity 0.5s;
        -o-transition:background-color 0.5s, opacity 0.5s;
        transition:background-color 0.5s, opacity 0.5s;

        overflow-y: scroll;
    }

    #sidebar-mobile .sup-link {
        color: #81B29A !important;
        font-weight: bold;
    }

    #sidebar-mobile .sub-link {
        color: #F2CC8F !important;
    }


    #sidebar-wrapper-mobile {
        padding-top: 1rem; padding-bottom: 1rem;
        width: 75vw;
    }

    #mobile-icon {
        display: flex;
        width: 5vw; height: 40vh;
        font-size: 2.5rem;
        position: fixed; margin-right: 0.6rem; padding-left: 0.2rem;
        align-items: center;
    }

    #sidebar-wrapper-mobile .chapter-wrapper {
        width: 90%;
    }
}

/* underlining animation only on desktop */
@media all and (min-width: 551px) {
    #sidebar .nav-link::after {
        position: absolute;
        bottom: 0;
        left: -25%;
        right: 0;
        margin: auto;
        width: 0;
        content: "";
        height: 4px;
        transition: all 0.5s;
    }

    #sidebar .sup-link:after {
        background-color: #81B29A;
    }

    #sidebar .sub-link:after {
        background-color: #F2CC8F;
    }

    #sidebar .nav-link:hover::after {
        width: 60%;
        transition: all 0.5s;
    }
}


/* get rid of headbutting when pressing on links, courtesy: https://css-tricks.com/hash-tag-links-padding/ */
#sidebar-content-wrapper h4::before, #sidebar-content-wrapper h5::before {
    display: block;
    content: " ";
    margin-top: -80px;
    height: 80px;
    visibility: hidden;
    pointer-events: none;
}

#sidebar-content-wrapper h4, .event-text h4 {
    text-align: center;
    font-size: 3rem;
    color: #67a286;
    padding-top: 4rem;
    font-weight: bolder;
}

#sidebar-content-wrapper h5, .event-text h5 {
    text-align: center;
    font-size: 1.8rem;
    color: #eaac4a;
    font-weight: normal;
    padding-top: 2rem;
}

.event-text h5 {
    margin-top: 0;
}


.text-wrapper {
    margin-top: 1rem;
}

.image-wrapper {
    display: flex;
    width: 100%;
    justify-content: center;
}

.pdf-wrapper {
    margin-top: 1rem;
    display: flex;
    width: 100%;
    height: 70vh;
    justify-content: center;
}

.topic-subpages-wrapper img, .image-wrapper img {
    max-width: 80%;
    align-self: center;
}

.caption {
    font-size: 0.9rem;
    line-height: 1rem;
    margin-bottom: 1.5rem;
}

.under-title-info  {
    font-size: 1rem;
    color: #AAA;
    align-self: center;
}

.attribution {

}

.name-link, .outside-link,.outgoing-link, .ingoing-link {
    text-decoration: none;
    color: #999;
    background-color: rgba(0, 0, 0, 0);
    box-shadow: inset 0 -0.5em 0 -1px rgba(153, 153, 153, 0.47);
    cursor: pointer;
}

.ingoing-link {
    color: black;
    box-shadow: inset 0 -0.5em 0 -1px #F2CC8F;
}

.document {
    font-weight: bold;
    width: fit-content !important;
}


.name-link:hover, .ingoing-link:hover {
    color: #666;
    box-shadow: inset 0 -0.5em 0 -1px #F2CC8F;
}

.outside-link, .outgoing-link {
    color: #000;
    box-shadow: inset 0 -0.5em 0 -1px rgba(51, 102, 204, 0.63);
}
.outside-link:hover, .outgoing-link:hover {
    color: #3366CC;
    box-shadow: inset 0 -0.5em 0 -1px rgba(51, 102, 204, 0.5);
}

h5 {
    margin-bottom: 0 !important;
}

.text-wrapper {
    margin-top: 1rem;
}


.content-hider {
    display: flex; flex-direction: column;
    text-decoration: none;
    width: 100%;
    height: 2rem;
    overflow: hidden;

    margin-top: 1rem;
}

.content-hider.open {
    height: auto;
    overflow: visible;
}



.content-opener {
    width: 100%;
    align-self: center;

    text-decoration: none;
    color: #888;
    cursor: pointer;
    box-shadow: inset 0 -0.5em 0 -1px rgba(180, 180, 180, 0.5);
}

.content-opener:hover {
    text-decoration: none;
    color: #333;
    cursor: pointer;
    box-shadow: inset 0 -0.5em 0 -1px rgb(242, 204, 143, 0.5);
}

.content-hider.open .content-opener {
    color: #333;
    box-shadow: inset 0 -0.5em 0 -1px rgb(242, 204, 143, 0.5);
}
.no-sidebar {
    margin-bottom: 3rem;
}

.no-sidebary {
    padding-bottom: 0 !important;
}