﻿/***********************************************************************/
/******************************* %header% ******************************/
/***********************************************************************/

/*#region Header*/

header {
    background-color: var(--background);
    color: var(--color);
    position: relative;
    z-index: 2; /* Prevents footer from appearing on top of header, while keeping footer interactable*/
}

/* Logo, Title & Icons*/

header .logo-bar {
    padding: 1rem 1rem 0 1rem;
    display: grid;
    grid-template-areas: 
        'logo title buttons';
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

#HeaderLogo { grid-area: logo; }
#HeaderTitle { grid-area: title; }
#HeaderButtons, #HeaderBurgerButtons { grid-area: buttons; }

#HeaderBurgerButton button {
    font-size: 1.5rem;
}

header img {
    height: 100px;
    width: 100px;
}

header .title {
    color: var(--color);
    font-family: var(--serif);
    display: inline-block;
    margin-right: 5rem;
}

header .title .line1 {
    display: block;
    font-size: 2rem;
    font-family: var(--display);
}

header .title .line2 {
    display: block;
    font-size: 1.3rem;
    font-family: var(--display);
}

/*#endregion*/

/*#region Header (0 to 899px)*/

@media screen and (max-width: 899px) {
    #HeaderButtons {
        display: none;
    }
}

/*#endregion*/

/*#region Header (0 to 599px)*/

@media screen and (max-width: 599px) {
    header img {
        height: 75px;
        width: 75px;
        margin-right: 1rem;
    }

    header .title .line1 {
        font-size: 1.5rem;
    }

    header .title .line2 {
        font-size: 1rem;
    }
}

/*#endregion*/

/***********************************************************************/
/***************************** %navigation% ****************************/
/***********************************************************************/

/*#region Navigation*/

nav {
    display: grid;
}

header .navigation-bar {
    border-top: 1px solid var(--tertiary);
    background-color: var(--background);
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

nav .level1 {
    font-size: 1.0rem;
    font-family: var(--serif);
}

nav .level1 .bttn {
    font-size: 1.0rem;
}

nav .level2 {
    font-size: 1rem;
    font-family: var(--sansserif);
}

nav .level2 > li:not(:first-of-type) {
    margin-top: 1rem;
}

nav .level3 {
    font-size: 0.9rem;
    padding-left: 1rem;
}

nav #ResponsiveIcons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-evenly;
}

nav #ResponsiveIcons > * {
    font-size: 1.3rem;
}

header nav .other-links {
    padding: 1rem;
    border-top: 1px solid var(--tertiary);
    font-size: 0.8rem;
    background-color: var(--background);
}

@media (prefers-color-scheme: light) {
    header nav .other-links {
        color: #BBBBBB;
    }

    nav #ResponsiveIcons .ch95-icon {
        background-image: url("/_Media/Global/Logos/Channel95/Medium/Channel95LogoWhite.png");
    }
}

/*#endregion*/

/*#region Navigation (900px to ∞)*/

@media screen and (min-width: 900px) {
    nav {
        grid-template-columns: auto;
    }

    nav .level1 {
        grid-column-start: 1;
    }

    .mobile-nav-open,
    .mobile-nav-close,
    .mobile-nav-back {
        display: none;
    }

    header nav .other-links {
        display: none;
    }

    /*Main navigation bar*/
    nav {
        width: 100%;
    }

    nav > ul {
        display: flex;
        justify-content: flex-end;
    }

    nav > ul > li {
        flex: 0;
        text-align: center;
        padding-inline: 0;
        transition: all ease-in-out 1s;
        border-bottom: 3px solid transparent;
        position: relative;
    }

    nav > ul > li + li:before {
        content: '';
        height: 50%;
        width: 1px;
        background-color: white;
        position: absolute;
        left: 0;
        top: 25%;
    }

    nav > ul > li > a, 
    nav > ul > li > button {
        padding-block: 1rem;
        padding-inline: 1rem;
        display: block;
        line-height: normal;
        font-size: 1.0rem;
        white-space: nowrap;
    }

    nav > ul > li.open {
        background-color: var(--background-hover);
        border-bottom-color: var(--tertiary);
    }

    /*Second level*/
    nav > ul > li > ul {
        display: none;
        z-index: 2;
        text-align: left;
        background-color: var(--background);
        padding: 2rem;
    }

    nav > ul > li.open > ul {
        position: absolute;
        display: block;
        top: calc(100% + 2px);
        left: 0;
    }

    nav > ul > li.open > ul > li > a {
        white-space: nowrap;
    }
}

/*#endregion*/

/*#region Navigation (0 to 899px)*/

@media screen and (max-width: 899px) {
    nav {
        grid-template-rows: 0fr auto 0fr;
    }

    header nav .other-links {
        grid-row-start: 3;
    }

    .mobile-nav-close {
        grid-row-start: 1;
    }

    nav .level1 {
        grid-row-start: 2;
    }

    .mobile-nav-close {
        font-size: 2rem;
        text-align: right;
        margin-right: 1rem;
    }

    .mobile-nav-back {
        position: absolute;
        right: 2rem;
        top: 1rem;
        font-size: 2rem;
    }

    /*Main navigation bar*/
    nav,
    nav > ul > li > ul {
        position: fixed;
        right: 0;
        top: 0;
        width: 300px;
        height: 100%;
        background-color: var(--background);
        text-align: left;
    }

    nav > ul,
    nav > ul > li > ul {
        overflow-y: scroll;
        padding: 1rem;
    }

    nav:not(.open),
    nav > ul > li:not(.open) > ul {
        display: none;
    }

    nav > ul > li {
        text-align: center;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border);
    }

    nav > ul > li > ul > li:first-of-type {
        margin-top: 3rem;
    }
}

/*#endregion*/

/*#region Navigation (0 to 400px)*/

@media screen and (max-width: 400px) {
    /*Main navigation bar*/
    nav,
    nav > ul > li > ul {
        width: 100%;
        transition: right 1s ease-in-out;
    }

    nav:not(.open),
    nav > ul > li:not(.open) > ul {
        right: -100vw;
    }
}

/*#endregion*/
