/* ============================================================
   NAV STYLES
   ============================================================ */

/* Header layout */
header {
    background-color: #ffffff;
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Logo */
.site-logo img {
    height: auto;
    max-width: 100%;
    width: 367px;
}

/* ── Desktop Nav ── */
#main-nav {
    position: relative;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-item > a {
    display: block;
    padding: 0.5rem 0.85rem;
    color: var(--color-contrast, #111);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-small, 0.9rem);
    white-space: nowrap;
    border-bottom: 1px solid #ddd;
}

.nav-item:last-child > a {
    border-bottom: none;
}

.nav-item > a:hover {
    text-decoration: underline;
}

/* Dropdown container */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 1000;
}

.dropdown li {
    border-bottom: 1px solid #f0f0f0;
}

.dropdown li:last-child {
    border-bottom: none;
}

.dropdown a {
    display: block;
    padding: 0.5em 1em;
    color: var(--color-contrast, #111);
    text-decoration: none;
    font-size: var(--font-size-small, 0.9rem);
    white-space: normal;
    line-height: 1.4;
}

.dropdown a:hover {
    background-color: #f5f5f5;
    text-decoration: underline;
}

/* Show dropdown on hover (desktop) */
.nav-item.has-dropdown {
    position: relative;
}

.nav-item.has-dropdown:hover > .dropdown,
.nav-item.has-dropdown:focus-within > .dropdown {
    display: block;
}

/* Nested (second-level) dropdown */
.dropdown .has-dropdown > .dropdown {
    top: 0;
    left: 100%;
}

/* ── Mobile toggle buttons ── */
.nav-toggle,
.nav-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--color-contrast, #111);
}

.nav-toggle svg,
.nav-close svg {
    display: block;
    fill: currentColor;
}

.nav-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* ── Mobile styles ── */
@media (max-width: 600px) {

    .nav-toggle {
        display: block;
    }

    #main-nav {
        display: none;
        position: fixed;
        inset: 0;
        background: #fff;
        z-index: 100000;
        overflow-y: auto;
        padding: 4rem 1.5rem 2rem;
    }

    #main-nav.is-open {
        display: block;
    }

    .nav-close {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    .nav-item > a {
        padding: 0.75rem 0;
        border-bottom: none;
        width: 100%;
    }

    /* On mobile, dropdowns are always visible (stacked) */
    .dropdown {
        display: block;
        position: static;
        border: none;
        padding-left: 1rem;
        min-width: unset;
        width: 100%;
    }

    .dropdown .has-dropdown > .dropdown {
        left: 0;
    }
}