:root {
    /* Color */
    --primary-background-color: #ececec;
    --primary-text-color: #000000;
    --primary-text-color--alt: #3f3f3f;
    --secondary-background-color: #246d00;
    --secondary-text-color: #ffffff;
    --secondary-text-color-alt: #f3f3f3;
    --hover-color: #1c5300;
    --accent-color: #00a023;
    --accent-color-select: #009420;
    --secondary-color: #e7e7e7;
    --secondary-color-select: #b4b4b4;
    /* Sizes */
    --navbar-height: 4.5em; /* Needs to be a var, otherwise #page-content get's into trouble */
    /* Global components */
    --imagebox-shadow-length: 0.75em;
    --imagebox-shadow-alpha: 0.2;
    --imagebox-shadow-blur: 0.75em;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-clip: inherit; /* Fix for small gap in border corners */
    font-size: 1rem;
}

html {
    font-family: Poppins, 'Segoe UI', sans-serif;
    color: var(--text-color);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--primary-background-color);

    /* Used to fix the footer at the bottom of the page */
    display: flex;
    flex-direction: column;
}

/* HTML Elements */

/* Add margin for text blocks back in, removed with * rule */
p, ul, ol {
    margin-top: 1rem;
    margin-bottom: 1rem;
}
/* Using lists within each other should not introduce a margin or a big padding */
ol ul, ul ol {
    margin-top: 0;
    margin-bottom: 0;
    padding-left: 1em;
}
ul, ol {
    padding-left: 2em; /* * rule sets this to zero, which breaks li indentation */
}
li {
    padding-left: 0.25em; /* Normally zero */
}
img {}
p.indent-paragraph {
    margin-left: 1em;
}

h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}
h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.heading-link {
    margin-left: 0.5rem;
    font-weight: bold;
}

a,
a:visited {
    color: var(--primary-text-color);
}
a.invert,
a:visited.invert {
    color: var(--secondary-text-color);
}
a.hidden-link,
a:visited.hidden-link {
    color: var(--primary-text-color);
    text-decoration: none;
}

button {
    padding: 0.75rem 1rem 0.75rem 1rem;

    font-size: 1rem;
    font-weight: 500;

    border-radius: 0.5em;
    border: 1px solid var(--primary-text-color--alt);

    background-color: var(--secondary-color);
}
button:hover {
    background-color: var(--secondary-color-select);
}
.button-primary {
    background-color: var(--accent-color);
}
.button-primary:hover {
    background-color: var(--accent-color-select);
}

input {
    padding: 0.5rem;
    margin: 0.5rem;
}
textarea {
    font-family: inherit;
    font-size: 1.1rem;
}
input, textarea {
    border: 0;
    border-radius: 0.5rem;
    padding: 0.5rem;
    background-color: #f5f5f5;
}

form label.fat-label {
    font-weight: bold;
    font-size: 1.1rem;
}
form span.form-asterisk {
    font-weight: bold;
    font-size: 1.2rem;
    color: red;
    margin-left: 0.03rem;
}

dialog {
    margin: auto;
    border: none;
}
dialog:focus {
    /* Removes the default focus outline which is wrong all the time */
    /* Does not work currently... */
    outline: none !important;
    box-shadow: none !important;
}

/* Tables default to being very "raw", this adds some typical style */
table.table-stylized {
    border-collapse: collapse;
    tbody {
        tr:first-child {
            font-weight: bold;
        }
    }
    th, td {
        border: 1px solid black;
        padding: 0.5rem;
    }
} 

/* Layout */

#page-content {
    background-color: var(--primary-background-color);

    margin-top: var(--navbar-height);
    
    section {
        margin: auto;
        /*margin-top: 2rem;*/
        padding: 0 2rem 2rem 2rem;
        max-width: 100em;
    }
    section:first-child {
        padding-top: 2rem;
    }
}

/* Global components */

.box {
    border-radius: 8px;
    background-color: white;
    filter: drop-shadow(0.5rem 0.5rem var(--imagebox-shadow-blur) rgba(0,0,0,var(--imagebox-shadow-alpha)));
    padding: 1rem 2rem 1rem 2rem;
}
.box-no-shadow {
    border-radius: 8px;
    background-color: white;
}

/* Helper classes */
.center-vertically {
    display: flex;
    align-items: center;
}

.mq-xxs-visible {
    display: none !important;
}

/* Smaller than 600px */
@media only screen and (max-width: 37.5em) {
    /* Special classes */
    .mq-xxs-hidden {
        display: none !important;
    }
    .mq-xxs-visible {
        display: block !important;
    }
    /* Changed classes */
    /* Prevent X axis scrolling at all cost */
    html, body {
        overflow-x: hidden;
    }
    /* At this size the display width is too small for the extra heading */
    .heading-link {
        display: none;
    }
    #page-content {
        section {
            padding: 0 1rem 1rem 1rem;
        }
        section:first-child {
            padding-top: 1rem;
        }
    }
    .box {
        padding: 1rem 1.25rem 1rem 1.25rem;
    }
}

/* Below 480px */
@media only screen and (max-width: 29.95em) {
    h1 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
}

/* Below 370px */
/* TODO: This break hX font sizes, find away around it */
@media only screen and (max-width: 23.15em) {
    .mq-xxs-text-small,
    .mq-xxs-text-small > *,
    .mq-xxs-text-small-justify,
    .mq-xxs-text-small-justify {
        font-size: 0.95em;
    }
    .mq-xxs-text-small-justify,
    .mq-xxs-text-small-justify > *,
    .mq-xxs-text-smaller-justify,
    .mq-xxs-text-smaller-justify > * {
        text-align: justify;
    }
    .mq-xxs-text-smaller,
    .mq-xxs-text-smaller > *,
    .mq-xxs-text-smaller-justify,
    .mq-xxs-text-smaller-justify {
        font-size: 0.8em;
    }
}
/* START COMPONENT: nav-bar */
nav {
    background-color: var(--secondary-background-color);
    opacity: 0.8;
    display: flex;
    align-items: center;
    position: fixed;
    /* width: 100%; Breaks on smaller screens */
    width: 100vw;
    z-index: 100;

    height: var(--navbar-height);
}

nav a.nav-heading-link,
nav a.nav-heading-link:visited {
    padding: 0.75rem 0 0.75rem 1rem;
    text-decoration: none;
    color: var(--secondary-text-color);
    span {
        font-size: 2rem;
    }
}

#navLinkBurger {
    display: none;
    padding: 0.625rem 1rem 0 1.5rem; /* Some vert. alignment to be on the title height */
    margin-left: auto;

    svg {
        width: 2rem;
        height: 2rem;
        fill: var(--secondary-text-color);
    }
}

#navLinkContainer {
    display: flex;
    padding: 0;
}

nav div {
    margin-left: auto;
}

nav div ul {
    list-style: none;
    display: flex;
    li {
        padding: 0; /* Explicitly set in the global.css, revert this for menu elements */
    }
}

nav div ul li a,
nav div ul li a:visited {
    display: flex;
    text-decoration: none;
    color: var(--secondary-text-color);
    padding: 1em 2em;
    transition: background-color 150ms ease;
    font-size: 1.25rem;
}

nav div ul li a:hover {
    background-color: var(--hover-color);
}

nav div ul li a.active {
    border-bottom: 2px solid var(--secondary-text-color);
}

nav div ul li a.accent {
    background-color: var(--accent-color);
}

/* Above 785px and below 930px */
@media only screen and (min-width: 49.06em) and (max-width: 58.12em) {
    nav a.nav-heading-link,
    nav a.nav-heading-link:visited {
        span {
            font-size: 1.35rem;
        }
    }
}

/* Below 785px */
@media only screen and (max-width: 49.06em) {
    :root {
        --navbar-height: 3.75rem;
    }
    nav {
        justify-content: space-between;
        height: var(--navbar-height);
        opacity: 1.0;
    }
    nav a.nav-heading-link,
    nav a.nav-heading-link:visited {
        span {
            font-size: 1.4rem;
        }
    }
    #navLinkBurger {
        display: inline;
    }
    #navLinkContainer {
        display: none;
        position: fixed;
        width: 100vw;
        z-index: 105;

        filter: drop-shadow(0 1.25rem var(--imagebox-shadow-blur) rgba(0, 0, 0, 0.3));

        /* Invert all colors */
        background-color: white;
        
        ul li a,
        ul li a:visited {
            color: black;
        }
        ul li a.active {
            border-bottom: none;
            background-color: var(--accent-color);
        }

        top: var(--navbar-height);
        ul {
            margin: 0;
            padding: 0;
            display: inline;
        }
    }
}

/* END COMPONENT: nav-bar */

/* START COMPONENT: back-to-top */
#bttnToTop {
    /* Override base button class */
    padding: 0;

    position: fixed;
    width: 3em;
    height: 3em;
    bottom: 2em;
    right: 2em;
    background-color: white;
    border-radius: 100%;
    border: solid var(--primary-text-color--alt) 1px;

    z-index: 200;
    display: none;

    svg {
        width: 100%;
        height: 100%;
        padding: 0.25rem;
        fill: var(--primary-text-color);
    }
}

/* Smaller than 730px */
@media only screen and (max-width: 45.63em) {
    #bttnToTop {
        display: none !important;
    }
}
/* END COMPONENT: back-to-top */

/* START COMPONENT: cookie-bar */
#cookieBarBackground {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    z-index: 240;

    background-color: black;
    opacity: 0.35;
}

#cookieBar {
    position: fixed;
    left: 50%;
    transform: translate(-50%, 0);
    bottom: 2rem;
    padding: 2rem;

    background-color: var(--primary-background-color);

    border-radius: 8px;
    border: solid var(--primary-text-color--alt) 2px;

    z-index: 250;

    .cookie-bar-heading {
        display: flex;

        svg {
            width: 2.25rem;
            height: 2.25rem;
            margin-right: 0.5rem;
        }
    }

    div.cookie-bar-buttons {
        margin-top: 1rem;
        padding: 0.5rem;
        display: flex;

        span {
            color: var(--primary-text-color);
            padding: 0 0.5rem 0 0.5rem;
            margin: auto 0 auto 0;
            justify-content: center;
            a {
                color: inherit;
            }
            a:first-child {
                margin-right: 0.75rem;
            }
            a:not(:first-child) {
                margin-left: 0.75rem;
            }
        }
        button:first-of-type {
            margin-left: auto;
        }
        button:not(:first-of-type) {
            margin-left: 1rem;
        }
    }
}

/* Below 710px height */
@media only screen and (max-height: 44.38em) {
    #cookieBar {
        position: fixed;
        left: 2rem;
        transform: none;
        right: 2rem;
    }
}

/* Below 500px height */
@media only screen and (max-height: 31.25em) {
    #cookieBar {
        position: fixed;
        left: 0.5rem;
        transform: none;
        right: 0.5rem;
        bottom: 0.5rem;
        p {
            .cookie-bar-extended-2 {
                display: none;
            }
        }
    }
}

/* Below 420px height */
@media only screen and (max-height: 26.25em) {
    #cookieBar {
        p {
            .cookie-bar-extended-1 {
                display: none;
            }
        }
    }
}

/* Below 500px */
@media only screen and (max-width: 31.25em) {
    #cookieBar {
        position: fixed;
        left: 2rem;
        transform: none;
        right: 2rem;

        p {
            margin: 0 0 1rem 0;

            .cookie-bar-extended-2 {
                display: none;
            }
            a {
                display: flex;
                margin-top: 0.5rem;
            }
        }

        div.cookie-bar-buttons {
            margin-top: 0.5rem;
            padding: 0;
            display: block;

            span {
                display: flex;
                color: var(--primary-text-color);
                a:first-child {
                    margin-right: 0.75rem;
                }
                a:not(:first-child) {
                    margin-left: 0.75rem;
                }
            }
            span,
            a {
                font-size: 1.1rem;
            }
            button:first-of-type {
                margin-top: 1rem;
                width: 100%;
                margin-left: 0;
            }
            button:not(:first-of-type) {
                margin-top: 0.5rem;
                width: 100%;
                margin-left: 0;
            }
        }
    }
}

/* Below 450px */
@media only screen and (max-width: 28.13em) {
    #cookieBar {
        p {
            .cookie-bar-extended-1 {
                display: none;
            }
        }
    }
}

/* Below 330px */
@media only screen and (max-width: 20.63em) {
    #cookieBar {
        position: fixed;
        left: 0.5rem;
        transform: none;
        right: 0.5rem;
    }
}
/* END COMPONENT: cookie-bar */

/* START COMPONENT: no-script-warning */
#noScriptWarning {
    position: fixed;
    left: 50%;
    transform: translate(-50%, 0);
    margin: 0 auto 0 auto;
    top: 8rem;
    padding: 1rem;

    background-color: var(--primary-background-color);

    border-radius: 0.5rem;
    border: solid var(--primary-text-color--alt) 2px;

    z-index: 255;

    text-align: center;
    color: red;
    font-weight: bold;
    font-size: 1.2rem;
}
/* END COMPONENT: no-script-warning */

/* START COMPONENT: footer */
footer {
    color: var(--secondary-text-color-alt);

    position: relative;
    overflow: hidden;
    /* Necessary for negative margin in background image */

    /* Used to fix the footer at the bottom of the page */
    margin-top: auto;

    svg {
        fill: var(--secondary-text-color);
    }
}

footer .footer-bg {
    /* height 100% does not work here because footer is dynamically sized */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background-image: url("../media/footer.webp") !important;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    filter: brightness(55%) blur(0.5rem);
    margin: -0.5rem;

    z-index: -10;
}

footer .footer-content {
    padding: 4rem 7rem 4rem 7rem;

    display: flex;
    flex-direction: row;
    align-items: stretch;

    .footer-heading {
        margin-bottom: 1em;
        font-weight: bold;
    }

    address {
        color: var(--secondary-text-color--alt);
    }

    .footer-content-right {

        display: flex;
        flex-direction: column;
        align-items: stretch;

        margin-left: auto;
        text-align: right;

        a {
            margin-top: 0.75em;
        }

        .footer-icons {
            a {
                text-decoration: none;
            }

            svg {
                height: 2.25rem;
                margin: 0.5rem;
            }
        }

        p {
            margin-top: auto;
        }
    }
}

/* Smaller than 730px */
@media only screen and (max-width: 45.63em) {
    footer .footer-content {
        padding: 1rem 1rem 1rem 1rem;

        display: block;

        .footer-content-right {
            display: block;

            .footer-icons {
                text-align: center;
                a:not(:first-child) {
                    margin-left: 1rem;
                }
            }
            > a {
                display: block;
            }
            > p {
                margin: 1rem 0 0 0;
            }
        }

        div {
            p.footer-heading span {
                display: none;
            }
            address {
                display: none;
            }
        }
    }
}
/* END COMPONENT: footer */
