:root {
    --font-family: Tacoma, sans-serif;
    --clr-surface-primary: #d8e5c6;
    --clr-on-surface-primary: #000000;
    --clr-on-surface-primary-alt: #182506;
    --clr-accent: #00b050;
    --clr-link: #085296;
}

/*** Colours & Typography ***/

body {
    font-family: var(--font-family);
    background: var(--clr-surface-primary);
    color: var(--clr-on-surface-primary);
}

nav ul {
    text-align: center;
    list-style-type: none;

    li a {
        border: 3px solid var(--clr-accent);
        color: inherit;
        text-decoration: none;
        font-weight: bold;
        text-wrap: nowrap;

        &:hover,
        &:focus-within,
        &.active {
            color: var(--clr-surface-primary);
            border-color: var(--clr-on-surface-primary-alt);
            background-color: var(--clr-on-surface-primary-alt);
        }
    }
}

footer {
    color: var(--clr-surface-primary);
    background-color: var(--clr-on-surface-primary-alt);
}

h1 {
    text-align: center;
    color: var(--clr-on-surface-primary-alt);
    text-shadow: color-mix(in srgb, currentColor 70%, transparent) 0.5px 0.5px;
}

a {
    color: var(--clr-link);
}

/*** Layout ***/

body,
main,
nav ul {
    display: flex;
    gap: 1rem;
}
body,
main {
    flex-direction: column;
}
nav ul {
    flex-wrap: wrap;
}
main {
    flex: 1;
}

body {
    min-height: 100vh;
    width: 100vw;

    & > * {
        &:first-child {
            padding-top: 1rem;
        }
        padding-inline: 1rem;
    }
}

header img {
    height: 150px;
    margin: 1rem auto;
}

nav ul {
    padding-inline: 2rem;
    justify-content: space-around;

    li {
        flex: 1;

        a {
            display: block;
            inset: 0;
            padding: 0.2rem 0.5rem;
        }
    }
}

ul.spaced li {
    padding-block: 0.25rem;
}

ul li.indent {
    list-style-type: circle;
    list-style-position: inside;
}

section {
    margin: 0 auto;
    width: 80ch;

    @media (max-width: 100ch) {
        width: 100%;
    }

    &:last-child {
        margin-bottom: 5rem;
    }
}

table {
    width: 100%;
    border-collapse: collapse;

    th,
    td {
        border: 1px solid black;
        vertical-align: top;
        padding: 0.1rem 0.5em;
    }
}

footer {
    padding-block: 0.5rem;
    text-align: right;
}

/*** Utility Classes ***/

.emphasis {
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.gallery {
    --column-count: 4;

    padding-bottom: 1rem;
    display: grid;
    gap: 3rem;
    justify-items: center;
    grid-template-columns: repeat(var(--column-count), 1fr);

    section:has(&) {
        width: 800px;
        text-align: center;

        @media (max-width: 800px) {
            width: 100%;
        }

        &:not(:last-child) {
            padding-bottom: 3rem;
        }
    }

    img {
        max-height: 150px;
    }

    &[data-column-count="3"] {
        --column-count: 3;

        @media (max-width: 800px) {
            --column-count: 2;
        }
    }

    &[data-column-count="4"] {
        --column-count: 4;

        @media (max-width: 800px) {
            --column-count: 2;
        }
    }
}

/*** Page-specific ***/

.hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5rem;
    position: relative;

    img {
        height: 12.5rem;
    }
}
