/* Page frame: header, main, footer. Ported from the Blazor layout/header/footer components. */

/*=================================*/
/*             Frame               */
/*=================================*/

body {
    background: var(--light);
    color: var(--dark);
}

/* Spacing by margins rather than a flex gap: elements injected after the footer (e.g. by browser
   extensions) would otherwise get a gap and push the footer up from the bottom */
body.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.page main {
    flex: 1;
    gap: 2em;
    margin: 2rem 0;
}

body.home main {
    gap: 4rem;
}

/* A contact block at the end reaches into the footer: same spacing on every page as on the home page */
body.page.footer-overlap main {
    margin-bottom: 0;
}

@media (min-width: 992px) {
    body.page main {
        margin: 4rem 0;
    }

    body.home main {
        gap: var(--section-gap);
    }
}

/*=================================*/
/*             Header              */
/*=================================*/

header {
    z-index: 100;
    background-color: var(--primary);
    position: sticky;
    top: 0;
    transition-property: border-radius;
    transition-duration: 500ms;
}

header nav {
    width: 100%;
    height: var(--nav-height);
    padding-left: 6rem;
    padding-right: 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header nav ul {
    height: 100%;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    list-style: none;
}

header nav li {
    height: max-content;
    width: 100%;
    text-align: center;
    position: relative;
    transition-property: background;
    transition-duration: 500ms;
}

header nav li:hover {
    background: var(--tertiary);
}

header nav li:hover > a.active {
    color: var(--light);
}

header nav ul a {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-page-title {
    font-size: calc(var(--font-size) * var(--gora));
    text-transform: uppercase;
    font-weight: bold;
}

@media (min-width: 768px) {
    header.final {
        border-radius: 0 0 .5rem .5rem;
    }

    header nav {
        padding-right: unset;
    }

    header nav li {
        height: 100%;
        flex: 1;
    }

    header nav li a span {
        display: none;
    }

    header.final nav li:last-child {
        border-radius: 0 0 .5rem 0;
    }

    .header-page-title {
        display: none;
    }
}

@media (min-width: 992px) {
    header:not(.final) nav {
        padding-left: 12rem;
    }
}

@media (max-width: 1200px) {
    header nav li:last-child {
        flex: .5;
    }
}

@media (min-width: 1200px) {
    header nav li {
        flex: 0;
    }

    header nav li a {
        padding: 0 2rem;
    }
}

@media (max-width: 768px) {
    header nav ul {
        height: min-content;
        width: 0;
        min-width: 0;
        background: var(--primary);
        display: block;
        position: absolute;
        top: var(--nav-height);
        right: 0;
        transition: all .75s ease;
        overflow: hidden;
    }

    header nav ul.active {
        min-width: 50%;
    }

    header nav ul a {
        padding: .5rem 1rem;
        justify-content: flex-start;
    }

    header nav li a span {
        padding-right: .5rem;
    }
}

/*=================================*/
/*        Hamburger button         */
/*=================================*/

header .toggle-button {
    width: 30px;
    height: 23px;
    padding: 0;
    position: absolute;
    top: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: none;

    &:hover {
        box-shadow: none;
    }
}

header .toggle-button .bar {
    height: 4px;
    width: 100%;
    background: var(--light);
    border-radius: 100px;
}

@media (min-width: 768px) {
    header .toggle-button {
        display: none;
    }
}

/*=================================*/
/*              Logo               */
/*=================================*/

header .logo {
    position: absolute;
    width: 5rem;
    top: .5rem;
    margin-left: .5rem;
    transition-duration: 500ms;
}

@media (min-width: 992px) {
    header .logo {
        width: 6rem;
        top: 1rem;
        margin-left: 1rem;
    }

    header:not(.final) .logo {
        width: 10rem;
    }
}

/*=================================*/
/*             Footer              */
/*=================================*/

footer {
    background-color: var(--primary);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

footer.enlarged {
    margin-top: var(--section-gap);
}

footer h3 {
    text-align: center;
}

footer .links {
    display: flex;
}

@media (min-width: 768px) {
    footer {
        border-radius: .5rem .5rem 0 0;
    }
}

@media (min-width: 992px) {
    footer {
        flex-direction: row;
        justify-content: space-between;
    }

    footer.enlarged {
        padding: 12rem 2rem 2rem 2rem;
    }
}

/*=================================*/
/*           Page title            */
/*=================================*/

.page-title {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;

    h1 {
        display: none;
    }

    .child {
        display: flex;
        align-items: flex-end;
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .page-title {
        justify-content: space-between;

        h1 {
            display: unset;
        }
    }
}
