@font-face {
    font-display: swap;
    font-family: "Merriweather Sans";
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/merriweather-sans-400.woff2") format('woff2');
}

@font-face {
    font-display: swap;
    font-family: 'Merriweather Sans';
    font-style: normal;
    font-weight: 700;
    src: url("../fonts/merriweather-sans-700.woff2") format('woff2');
}

@font-face {
    font-display: swap;
    font-family: 'Merriweather';
    font-style: normal;
    font-weight: 700;
    src: url("../fonts/merriweather-700.woff2") format('woff2');
}

@media (prefers-reduced-motion: reduce) {
    :root {
        interpolate-size: numeric-only;
    }

    *::before,
    *::after,
    .btn,
    header,
    #primary-nav {
        transition: none !important;
    }

    .carousel {
        scroll-behavior: auto;
    }
}

:root {
    --white: hsl(0, 0%, 100%);
    --black: hsl(0, 0%, 18%);
    --fir-green: hsl(145, 80%, 18%);
    --wood-brown: hsl(24, 31%, 47%);
    --cream-white: hsl(46, 25%, 86%);
    --grey: hsl(150, 3%, 88%);
    --overlay: hsla(0, 0%, 18%, 0.7);

    interpolate-size: allow-keywords;
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid currentColor;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

body {
    background-color: var(--white);
    color: var(--black);
    font-family: 'Merriweather Sans', sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

p {
    text-wrap: pretty;
    max-inline-size: 56ch;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Merriweather', serif;
    text-wrap: balance;
    max-inline-size: 24ch;
}

ul,
ol {
    list-style: none;
    padding-inline-start: 0;
}

p a,
.card a {
    text-decoration: underline;
}

a {
    color: currentColor;
    text-decoration: none;
}

button,
input {
    border: none;
    background-color: transparent;
    padding-block: 0;
    padding-inline: 0;
}

address {
    display: grid;
    gap: .5rem;
    font-style: normal;
}

h1 {
    font-size: clamp(1.875rem, 1.25rem + 3.125vw, 3.75rem);
    line-height: 1.2;

    @media (width > 64rem) {
        line-height: 1;
    }
}

h2 {
    font-size: clamp(1.5rem, 0.8182rem + 3.4091vw, 3rem);
    line-height: 1.3;

    @media (width > 64rem) {
        line-height: 1;
    }
}

h3 {
    font-size: clamp(1.25rem, 1.1364rem + 0.5682vw, 1.5rem);
    line-height: 1.4;

    @media (width > 64rem) {
        line-height: 1.3;
    }
}

h4 {
    font-size: 1.125rem;
    line-height: 1.6;
}

.text-lg {
    font-size: clamp(1.125rem, 1.0682rem + 0.2841vw, 1.25rem);
    line-height: 1.6;

    @media (width > 64rem) {
        line-height: 1.4;
    }
}

label {
    font-size: 0.875rem;
    line-height: 1.3;
    font-weight: 700;

    @media (width > 64rem) {
        line-height: 1.4;
    }
}

.wrapper {
    width: min(calc(100% - 2rem), 80rem);
    margin-inline: auto;
}

.grid.wrapper {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 2rem;

    @media (width >=1024px) {
        grid-template-columns: repeat(2, 1fr);
        gap: 4rem;
    }
}

.fullwidth.wrapper {
    display: grid;
    justify-items: center;
    text-align: center;

    .cards {
        width: 100%;
        text-align: start;
    }
}

section,
aside {
    padding-block: 4rem;
}

.btn {
    display: block;
    width: fit-content;
    font-weight: 700;
    color: var(--white);
    padding: 12px 24px;
    transition: background-color 300ms ease-in-out;
    border-radius: 0;

    &.btn-primary {
        background-color: var(--wood-brown);

        &:hover,
        &:focus-visible {
            background-color: hsl(24, 31%, 37%);
        }
    }

    &.btn-outline {
        border: 1px solid var(--wood-brown);

        &:hover,
        &:focus-visible {
            background-color: var(--wood-brown);
        }
    }
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;

    @media (width <493px) {
        .btn {
            width: 100%;
            text-align: center;
        }
    }

}

.mb-4 {
    margin-block-end: 1rem;
}

.mb-8 {
    margin-block-end: 2rem;
}

h2::before {
    content: url("../images/boards.svg");
    display: block;
    margin-block-end: .5rem;
    line-height: 0;
}

.h3,
details summary {
    font-family: 'Merriweather', serif;
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1.4;
    text-wrap: balance;
}

.bg-cream-white {
    background-color: var(--cream-white);

    .card>div {
        background-color: var(--white) !important;
    }
}

header {
    background-color: var(--fir-green);
    color: var(--white);

    .wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-block: 1rem;

        .menu-toggle {
            position: relative;
            width: 48px;
            height: 32px;
            cursor: pointer;

            @media (width >=64rem) {
                display: none;
            }

            &[aria-expanded="true"] {
                span {
                    &.top {
                        transform: translate(4px, -4px) rotate(45deg);
                    }

                    &.mid {
                        transform: translate(4px, 15px) rotate(-45deg);
                    }

                    &.bottom {
                        transform: translate(-10px, 3px) rotate(45deg);
                    }
                }
            }

            span {
                position: absolute;
                left: 0;
                width: 100%;
                height: 5px;
                background-color: var(--white);
                transition: 0.3s transform ease;

                &.top {
                    top: 0;
                    transform-origin: bottom left;
                }

                &.mid {
                    top: 50%;
                    transform: translateY(-50%);
                    transform-origin: top left;
                }

                &.bottom {
                    bottom: 0;
                    transform-origin: bottom right;
                }
            }
        }

        #primary-nav {
            background-color: var(--fir-green);
            position: absolute;
            inset: 80px 0;
            z-index: 1;
            padding-inline: 1rem;
            height: 0;
            overflow: hidden;
            transition: height ease-in-out 300ms;

            @media (width >=64rem) {
                position: static;
                height: auto !important;
                padding: 0;
                overflow: visible;
                display: flex;
                align-items: center;
                gap: 2rem;

                ul {
                    display: flex;
                    gap: 2rem;
                }
            }

            &.open {
                height: max-content;
            }

            li a {
                padding-block: 1rem;
                display: inline-flex;
                width: 100%;

                @media (width >=64rem) {
                    padding-block: 0;
                }

                &:hover,
                &:focus-visible,
                &[aria-current="page"] {
                    text-decoration: underline solid var(--wood-brown) 2px;
                    text-underline-offset: 4px;
                }
            }

            li.current-menu-item.current_page_item.menu-item {
                text-decoration: underline solid var(--wood-brown) 2px;
                text-underline-offset: 4px;
            }

            .btn {
                margin-block-start: 1rem;
                margin-block-end: 2rem;

                @media (width >=64rem) {
                    margin-block: 0;
                }
            }

            .tree {
                position: absolute;
                inset: auto 0 0 auto;
                opacity: 0.08;
                z-index: -1;

                @media (width >=64rem) {
                    display: none;
                }
            }
        }
    }
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 314px), 1fr));
    gap: 1rem;

    .card {
        position: relative;
        display: grid;
        grid-row: span 2;
        grid-template-rows: subgrid;
        gap: 0;

        img {
            aspect-ratio: 3 / 2;
            width: 100%;
            object-fit: cover;
            object-position: center;
        }

        >div {
            padding: 1rem;
            background-color: var(--cream-white);

            h3,
            p {
                margin-block-end: .5rem;
            }

            a:hover::before,
            a:focus::before {
                border-color: var(--wood-brown);
            }

            a:focus {
                outline: none;
            }

            a::before {
                content: '';
                position: absolute;
                inset: 0;
                z-index: 1;
                border: 2px solid transparent;
                transition: border-color 300ms ease-in-out;
            }
        }
    }
}

.logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;

    li {
        width: 100px;
        height: 100px;
        background-color: var(--grey);
    }
}

.cta {
    background-image: url("../images/cta.avif");
    background-size: contain;
    background-position: center;
}

.footer-top {
    background-color: var(--fir-green);
    color: var(--white);

    .wrapper {
        padding-block: 4rem;
        display: grid;
        align-items: start;
        grid-template-columns: 1fr;
        gap: 2rem;

        @media (width >=48rem) {
            grid-template-columns: repeat(2, 1fr);
            gap: 4rem;
        }

        @media (width >=64rem) {
            grid-template-columns: repeat(4, 1fr);
            gap: 2rem;
        }

        >div {
            display: grid;
            gap: 1rem;

            ul {
                display: grid;
                gap: .5rem;
            }
        }
    }
}

.footer-bottom {
    background-image: url("../images/footer-bg.avif");
    background-size: cover;
    background-position: center;
    background-color: #0E4523;
    color: var(--white);

    .wrapper {
        padding-block: 2rem;
        display: flex;
        align-items: center;
        flex-direction: column;
        gap: 1rem;

        @media (width >=48rem) {
            flex-direction: row-reverse;
            justify-content: space-between;
        }
    }

    p a {
        text-decoration: none;
    }
}

details {
    padding: 1rem;
    background-color: var(--cream-white);

    &:not(:last-of-type) {
        margin-block-end: 1rem;
    }

    >summary {
        position: relative;
        cursor: pointer;

        &::marker {
            content: "";
        }

        &::-webkit-details-marker {
            display: none;
        }

        &::after {
            content: url("../images/arrow-down.svg");
            position: absolute;
            top: 50%;
            right: 0;
            translate: 0 -50%;
            transition: transform 300ms ease-in-out;
            line-height: 0;
        }
    }

    &::details-content {
        height: 0;
        transition:
            height 300ms ease-in-out,
            content-visibility 300ms ease-in-out allow-discrete;
        overflow: clip;
    }

    &[open]::details-content {
        height: auto;
    }

    &[open] summary {
        margin-block-end: .5rem;
    }

    &[open] summary::after {
        transform: rotate(180deg);
    }
}