header {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 1280px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 1.35rem;
    border-radius: 1.4rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(118, 170, 119, 0.18);
    box-shadow: 0 12px 32px rgba(28, 112, 59, 0.08);
    backdrop-filter: blur(16px);
    z-index: 50;
    transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

html[data-scroll="0"] header {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

#header-logo,
#header-logo img {
    display: block;
}

#header-logo {
    flex-shrink: 0;
}

#header-logo img {
    height: 3.5rem;
    width: auto;
}

#menu-toggle {
    display: none;
}

#sandwich {
    display: none;
}

#sandwich,
#sandwich::before,
#sandwich::after {
    content: '';
    background-color: var(--highlight-color);
    width: 1.8rem;
    height: 0.22rem;
    border-radius: 999px;
    position: relative;
    transition: transform 0.25s ease, background-color 0.25s ease;
}

#sandwich::before,
#sandwich::after {
    position: absolute;
    left: 0;
}

#sandwich::before {
    transform: translateY(-0.5rem);
}

#sandwich::after {
    transform: translateY(0.5rem);
}

html[data-scroll="0"] #sandwich,
html[data-scroll="0"] #sandwich::before,
html[data-scroll="0"] #sandwich::after {
    background-color: var(--brand-white);
}

header > nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

header > nav > ul {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

header > nav li {
    position: relative;
}

header > nav > ul > li {
    padding: 0.25rem 0;
}

header > nav > ul > li > a {
    color: var(--brand-dark);
    font-family: var(--aux-font);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

html[data-scroll="0"] header > nav > ul > li > a {
    color: rgba(255, 255, 255, 0.92);
}

header > nav > ul > li:hover > a,
header > nav li li a:hover {
    color: var(--highlight-soft);
}

header > nav > ul > li:first-child > a {
    color: var(--highlight-soft);
}

header > nav > ul > li:first-child::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.55rem;
    width: 2.75rem;
    height: 2px;
    border-radius: 999px;
    background: var(--highlight-soft);
}

header > nav li > ul {
    display: none;
    position: absolute;
    top: calc(100% - 0.15rem);
    left: 0;
    min-width: 14rem;
    padding: 0.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(118, 170, 119, 0.16);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-soft);
}

header > nav li > ul::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -0.5rem;
    height: 0.5rem;
}

header > nav li:hover > ul,
header > nav li:focus-within > ul {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

header > nav li > ul a {
    display: block;
    padding: 0.5rem 0.65rem;
    border-radius: 0.75rem;
    color: var(--brand-dark);
    font-family: var(--aux-font);
    font-size: 0.9rem;
    font-weight: 500;
}

header > nav li > ul a:hover,
header > nav li > ul a:focus-visible {
    background: rgba(28, 112, 59, 0.06);
    color: var(--highlight-color);
}

header::after {
    content: 'Inscrições';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0 1.35rem;
    border-radius: 0.9rem;
    background: var(--highlight-soft);
    color: var(--brand-dark);
    font-family: var(--aux-font);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

@media screen and (max-width: 1024px) {
    header {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        border-radius: 0;
        padding: 1rem 5vw;
    }

    header::after {
        display: none;
    }

    #sandwich {
        display: block;
        z-index: 60;
    }

    header > nav {
        position: fixed;
        top: 0;
        left: 100%;
        width: 100vw;
        height: 100vh;
        padding: 7rem 8vw 3rem;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        overflow-y: auto;
        transition: transform 0.25s ease;
    }

    header > nav > ul {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    header > nav > ul > li {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0;
    }

    header > nav > ul > li:first-child::after {
        display: none;
    }

    header > nav > ul > li > a {
        display: block;
        padding: 0.95rem 1rem;
        border-radius: 1rem;
        background: rgba(28, 112, 59, 0.08);
        color: var(--highlight-color) !important;
    }

    header > nav li > ul {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        position: static;
        min-width: 0;
        margin-top: 0;
        padding: 0 0 0 1rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    header > nav li > ul::before {
        display: none;
    }

    header > nav li > ul li {
        display: block;
        margin: 0;
        padding: 0;
    }

    header > nav li > ul a {
        display: block;
        padding: 0.35rem 0;
        border-radius: 0;
        background: transparent !important;
        color: var(--brand-dark) !important;
        font-size: 0.92rem;
        line-height: 1.45;
    }

    #menu-toggle:checked ~ #sandwich {
        transform: rotate(45deg);
    }

    #menu-toggle:checked ~ #sandwich::before,
    #menu-toggle:checked ~ #sandwich::after {
        transform: translateY(0) rotate(-90deg);
    }

    #menu-toggle:checked ~ nav {
        transform: translateX(-100vw);
    }

    #menu-toggle:not(:checked) ~ nav {
        transform: translateX(0);
    }
}