:root {
    --nav-h: 70px;
}

/* ── Nav bar ──────────────────────────────────────────────────────── */
#siteNav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background-color .25s ease, box-shadow .25s ease, transform .3s ease;
}

    #siteNav.nav--transparent {
        background-color: transparent;
        box-shadow: none;
    }

    #siteNav.nav--solid {
        background-color: #16a34a;
        box-shadow: 0 2px 8px rgba(0,0,0,.18);
    }

    #siteNav.nav--hidden {
        transform: translateY(-100%);
    }

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: padding .25s ease;
}

#siteNav.nav--solid .nav-inner {
    padding-top: .7rem;
    padding-bottom: .7rem;
}

/* ── Logo ─────────────────────────────────────────────────────────── */
.nav-logo {
    display: flex;
    align-items: center;
    gap: .45rem;
    text-decoration: none;
    color: white;
    font-family: 'Caveat', cursive;
    font-size: 2.75rem;
    line-height: 1;
}

    .nav-logo:hover {
        color: white;
        text-decoration: none;
    }

.nav-logo-img {
    height: 42px;
}

@media (max-width: 767px) {
    .nav-logo {
        font-size: 2.25rem;
    }

    .nav-logo-img {
        height: 36px;
    }
}

/* ── Hamburger toggle ─────────────────────────────────────────────── */
.nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    border-radius: .25rem;
    flex-shrink: 0;
}

    .nav-toggle:focus-visible {
        outline: 2px solid rgba(255,255,255,.6);
        outline-offset: 3px;
    }

.hb-line {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}

@media (min-width: 768px) {
    .hb-line {
        width: 30px;
    }
}

/* Animate hamburger to X when open — driven by aria-expanded attribute. */
#navToggle[aria-expanded="true"] .hb-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#navToggle[aria-expanded="true"] .hb-line:nth-child(2) {
    opacity: 0;
}

#navToggle[aria-expanded="true"] .hb-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Overlay — Mobile default: full-screen ────────────────────────── */
#navOverlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background-color: #16a34a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(-100%);
    opacity: 1;
    transition: transform .32s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .32s;
    visibility: hidden;
    pointer-events: none;
}

    #navOverlay.overlay--open {
        transform: translateY(0);
        visibility: visible;
        pointer-events: all;
        transition-delay: 0s;
    }

.overlay-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: .5rem;
    line-height: 1;
    border-radius: .25rem;
    opacity: .75;
    transition: opacity .15s;
}

    .overlay-close:hover {
        opacity: 1;
    }

    .overlay-close:focus-visible {
        outline: 2px solid rgba(255,255,255,.6);
        outline-offset: 2px;
    }

    .overlay-close svg {
        display: block;
        width: 30px;
        height: 30px;
    }

.overlay-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
    padding: 0 1.5rem;
    gap: .125rem;
}

.overlay-link {
    display: block;
    width: 100%;
    text-align: center;
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: .01em;
    padding: .6rem 1.25rem;
    border-radius: .5rem;
    transition: background-color .15s ease;
}

    .overlay-link:hover,
    .overlay-link:focus {
        background-color: rgba(255,255,255,.15);
        color: white;
        text-decoration: none;
    }

.overlay-hr {
    width: 100%;
    border: none;
    border-top: 1px solid rgba(255,255,255,.2);
    margin: .375rem 0;
}

.overlay-watermark {
    position: absolute;
    bottom: 1.75rem;
    right: 1.75rem;
    opacity: .07;
    pointer-events: none;
}

    .overlay-watermark img {
        height: 110px;
    }

/* Scroll lock — mobile only */
@media (max-width: 767px) {
    body.nav-menu-open {
        overflow: hidden;
    }
}

/* ── Overlay — Desktop 768px+: compact dropdown card ─────────────── */
@media (min-width: 768px) {

    #navOverlay {
        inset: auto;
        top: calc(var(--nav-h) + .5rem);
        right: 1.5rem;
        left: auto;
        bottom: auto;
        width: 240px;
        border-radius: .75rem;
        box-shadow: 0 8px 24px rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.08);
        align-items: flex-start;
        justify-content: flex-start;
        /* Different animation: fade + gentle drop */
        transform: translateY(-6px);
        opacity: 0;
        transition: transform .2s ease, opacity .2s ease, visibility 0s linear .2s;
    }

        #navOverlay.overlay--open {
            transform: translateY(0);
            opacity: 1;
            transition-delay: 0s;
        }
        /* Pointing triangle above the card, aligned with the toggle button */
        #navOverlay::before {
            content: '';
            position: absolute;
            top: -8px;
            right: 18px;
            width: 0;
            height: 0;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-bottom: 8px solid #16a34a;
        }
    /* X close button not needed on desktop — click outside closes */
    .overlay-close {
        display: none;
    }

    .overlay-nav {
        align-items: flex-start;
        padding: .625rem .5rem;
        max-width: none;
        gap: .1rem;
    }

    .overlay-link {
        font-size: 1rem;
        font-weight: 500;
        padding: .45rem 1rem;
        text-align: left;
    }

    .overlay-hr {
        margin: .25rem 0;
    }

    .overlay-watermark {
        display: none;
    }
}
