@font-face {
    font-family: 'Nunito';
    src: url('/assets/fonts/Nunito.woff2') format('woff2');
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito';
    src: url('/assets/fonts/Nunito-italic.woff2') format('woff2');
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'SourGummy';
    src: url('/assets/fonts/SourGummy.woff2') format('woff2');
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SourGummy';
    src: url('/assets/fonts/SourGummy-italic.woff2') format('woff2');
    font-style: italic;
    font-display: swap;
}

:root {
    --accent-color: #7F95D1;
    --second-accent-color: #ED6A5A;
}

html {
    font-size: 62.5%;
}

body {
    font-family: 'Nunito';
    margin: 0;
    padding: 0;
    font-size: 1.6rem;
    line-height: 1.2;
    font-weight: 500;
    color: #1e1e1e;
}

main h1:not(:last-child),
main h2:not(:last-child),
main h3:not(:last-child),
main h4:not(:last-child),
main h5:not(:last-child),
main h6:not(:last-child),
main p:not(:last-child) {
    margin-bottom: 1rem;
}

*,
::before,
::after {
    box-sizing: border-box;
    margin-block: 0;
}

ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* Navigation */
#topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #e3e3e3;
    padding: 10px 20px;
    font-family: SourGummy;
    z-index: 999;
}

#topbar #topbar-logo {
    position: relative;
}

#topbar #topbar-logo a {
    position: absolute;
    left: calc(50%);
    top: 50%;
    translate: -20px -60%;
    color: #ffffff;
    text-decoration: none;
    white-space: pre;
}

#topbar #topbar-logo img {
    height: 40px;
}

#topbar #topbar-navigation {
    position: fixed;
    background-color: #1e1e1e;
    inset: 0;
    transition: translate 400ms ease-in-out;
    translate: -100% 0;
    opacity: 0;
}

#topbar #topbar-navigation ul {
    display: flex;
    flex-direction: column;
    width: 100%;
}

#topbar #topbar-navigation .has-children>a {
    position: relative;
    display: block;
    width: 100%;
}

#topbar #topbar-navigation .has-children>ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 250ms ease-in-out;
}

#topbar #topbar-navigation .has-children>a::after {
    content: url("./../media/chevron-down.svg");
    position: absolute;
    width: 20px;
    color: #ffffff;
    top: 0;
    right: 0;
    rotate: 0deg;
    transition: rotate 250ms ease-in-out;
}

#topbar #topbar-navigation .has-children.open>ul {
    max-height: 250px;
}

#topbar #topbar-navigation .has-children.open>a::after {
    rotate: 90deg;
}

#topbar #topbar-navigation ul.sub-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-inline: 20px;
}

#topbar #topbar-navigation ul.sub-menu li {
    padding-block: 6px;
}

#topbar #topbar-navigation a {
    color: #ffffff;
    text-decoration: none;
}

#topbar #topbar-navigation a.current-page {
    font-weight: 800 !important;
    color: var(--accent-color);
}

#topbar #topbar-toggler {
    display: flex;
    cursor: pointer;
    width: 20px;
    height: 20px;
    flex-direction: column;
    justify-content: center;
    z-index: 9999;
}

#topbar #topbar-toggler span {
    display: block;
    width: 100%;
    background-color: #1e1e1e;
    height: 2px;
    transition: all 250ms ease-in-out;
}

#topbar #topbar-toggler span:first-child {
    transform: translateY(-5px);
}

#topbar #topbar-toggler span:last-child {
    transform: translateY(5px);
}

/* Navigation: open */
#topbar.open #topbar-navigation {
    translate: 0 0;
}

#topbar.active #topbar-navigation {
    opacity: 1;
    display: flex;
    align-items: center;
    padding-inline: 40px;
}

#topbar.active #topbar-navigation li {
    padding-block: 10px;
}

#topbar.open #topbar-toggler span {
    background-color: #ffffff;
}

#topbar.open #topbar-toggler span:first-child {
    transform: translateY(50%) rotate(-45deg);
}

#topbar.open #topbar-toggler span:nth-child(2) {
    display: none;
}

#topbar.open #topbar-toggler span:last-child {
    transform: translateY(-50%) rotate(45deg);
}

header#hero {
    margin-bottom: 40px;
}

header#hero.leaflet-container {
    width: 100%;
    height: 400px;
}

header#hero img {
    aspect-ratio: 7/1;
    object-fit: cover;
    width: 100%;
}

/* Generic content styling */
/* If this looks weird im used to SCSS where we would nest these stylings inside .main { ... } */
main>*:not(.full-width) {
    padding-inline: 20px;
    max-width: 800px;
    margin-inline: auto;
}

main>*:not(:last-child),
article>*:not(:last-child) {
    margin-bottom: 2rem;
}

main ul {
    list-style-type: disc;
}

main ul ul {
    list-style-type: circle;
    padding-inline-start: 20px;
}

main ol {
    list-style-type: decimal;
    padding: 0;
}

main ul,
main ol {
    list-style-position: inside;
}

main table {
    border-collapse: collapse;
    font-size: 1.4rem;
    width: 100%;
}

main table thead {
    text-align: left;
    background-color: var(--second-accent-color);
}


main table th {
    border: 1px solid var(--second-accent-color);
}

main table th,
main table td {
    padding-inline: 4px;
    padding-block: 6px;
}

main table td {
    border: 1px solid var(--accent-color);
}

main table tbody td:first-child {
    font-weight: 700;
}

/* Footer */
footer {
    padding: 30px 20px;
}

/* Components */
.gallery ul {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px 30px;
    list-style-type: none;
}

.gallery .video,
.gallery .image {
    aspect-ratio: 16/9;
    /* background-color: #1e1e1e; */
    /* remove css sometimes leaving a really small bar */
    font-size: 0;
}

.gallery .contain * {
    object-fit: contain !important;
    padding: 4px;
}

.gallery iframe,
.gallery img,
.gallery picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px 40px;
    list-style-type: none;
}

.card {
    background-color: #e3e3e3;
    padding: 20px;
}

.card__image {
    /* aspect-ratio: 5/3; */
    width: 100%;
    font-size: 0;
}

.card__video {
    width: 100%;
    font-size: 0;
    aspect-ratio: 16/9;
}

.card__title {
    font-weight: 600;
    font-size: 1.8rem;
}

.card__content>* {
    margin: 1rem 0;
}

/* Dynamic rules */
@media screen and (min-width: 768px) {

    /* Topbar */
    #topbar #topbar-navigation {
        position: relative;
        translate: unset;
        opacity: 1;
        background-color: unset;
        transition: unset;
    }

    #topbar #topbar-navigation ul {
        flex-direction: row;
        gap: 30px;
    }

    #topbar #topbar-navigation a {
        color: #1e1e1e;
    }

    #topbar #topbar-navigation .has-children>ul.sub-menu {
        background-color: #e3e3e3;
        position: absolute;
        width: auto;
    }

    #topbar #topbar-navigation .has-children>a {
        padding-inline-end: 30px;
    }

    #topbar #topbar-navigation .has-children>a::after {
        display: inline-block;
        vertical-align: middle;
        position: absolute;
    }

    #topbar #topbar-toggler {
        display: none;
    }

    /* Components */
    .gallery ul {
        grid-template-columns: repeat(6, 1fr);
        gap: 30px;
    }

    .gallery ul>* {
        grid-column: span 2;
    }

    .gallery ul>*:nth-last-child(1),
    .gallery ul>*:nth-last-child(2) {
        grid-column: span 3;
    }

    .cards .card {
        display: flex;
        gap: 20px;
    }

    .cards .card>* {
        flex: 1;
    }

    .cards .card:nth-child(even) {
        flex-direction: row-reverse;
    }
}


@media screen and (min-width: 1024px) {
    .gallery ul {
        grid-template-columns: repeat(5, 1fr);
    }

    .gallery ul>* {
        grid-column: span 1 !important;
    }

    .cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .cards .card {
        display: block;
    }
}