/* ==========================================================================
   Site header — top contact bar + logo/navigation row

   On the existing site the navigation row itself is transparent and the page
   hero is pulled up underneath it (margin-top: -90px), so the header sits
   over the hero image. The row keeps its 3px translucent bottom border.
   ========================================================================== */

.site-header {
    position: relative;
    z-index: 10;
}

/* --------------------------------------------------------------------------
   Coming back on the way up

   Past the top of the page the header is fixed rather than sitting over the
   hero, so it needs a background of its own: the same maroon as the contact
   bar above it. Scrolling down lifts it out of the way, scrolling up brings
   it straight back (js/sticky-header.js).
   -------------------------------------------------------------------------- */

.site-header.is-stuck {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--color-maroon-dark);
    box-shadow: 0 6px 24px rgba(19, 16, 58, 0.18);
    transition: transform 0.35s ease;
}

.site-header.is-stuck.is-hidden {
    transform: translateY(-100%);
}

/* Fixed, so the row no longer needs the border that separated it from the
   hero */
.site-header.is-stuck .header-main {
    border-bottom-color: transparent;
}

/* Scrolled up, the contact bar turns grey against the maroon below it. At the
   top of the page it is maroon like the rest, as it always has been. */
.site-header.is-stuck .top-bar {
    background-color: var(--color-dark-grey);
}

@media (prefers-reduced-motion: reduce) {

    .site-header.is-stuck {
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   Top contact bar
   -------------------------------------------------------------------------- */

.top-bar {
    position: relative;
    z-index: 5;
    background-color: var(--color-maroon-dark);
    padding: 10px 0;
}

.top-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.top-bar__info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.top-bar__info li {
    padding-right: 30px;
    border-right: 1px solid var(--color-header-divider);
}

.top-bar__info li + li {
    padding-left: 30px;
}

.top-bar__info li:last-child {
    padding-right: 0;
    border-right: 0;
}

.top-bar__info a {
    color: var(--color-white);
    font-size: var(--font-size-header-info);
    font-weight: 500;
    line-height: 1.4;
}

/* --- Social icons --- */

.top-bar__social {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* Base .social-link lives in components.css — the float on hover is the
   header's own treatment. */
.top-bar__social .social-link {
    background-color: var(--color-white);
}

.top-bar__social .social-link:hover,
.top-bar__social .social-link:focus-visible {
    background-color: var(--color-accent);
    transform: translateY(-8px);
}

/* --------------------------------------------------------------------------
   Main row — logo + navigation
   -------------------------------------------------------------------------- */

.header-main {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    height: var(--header-row-height);
    padding-bottom: 10px;
    border-bottom: 3px solid var(--color-header-border);
}

.header-main__inner {
    display: flex;
    align-items: center;
    width: 100%;
}

.site-logo {
    flex: 0 0 15%;
    margin: 6px 0 0 29px;
}

.site-logo img {
    width: var(--logo-width);
    height: auto;
}

.header-main__nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    padding-right: var(--nav-inset-right);
}

/* --------------------------------------------------------------------------
   Navigation — desktop
   -------------------------------------------------------------------------- */

.main-nav {
    margin-right: 15px;
}

.nav-menu {
    display: flex;
    align-items: center;
    height: var(--header-nav-height);
}

.nav-menu > li {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-menu > li > .nav-link {
    display: flex;
    align-items: center;
    height: 100%;
    padding-left: 40px;
    color: var(--color-white);
    font-size: var(--font-size-nav);
    font-weight: 500;
    letter-spacing: var(--letter-spacing-nav);
    text-transform: uppercase;
    transition: color 0.3s;
}

/* Dropdown indicator ("+" on the existing site) */
.nav-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    color: var(--color-accent);
    font-size: var(--font-size-nav);
    line-height: 1;
    transition: color 0.3s;
}

.nav-menu > li:hover > .nav-indicator,
.nav-menu > li:focus-within > .nav-indicator {
    color: var(--color-white);
}

/* --- Dropdown panel --- */

.nav-submenu {
    position: absolute;
    top: 100%;
    left: 40px;
    min-width: 200px;
    padding: 40px 0;
    background-color: var(--color-submenu-bg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.has-dropdown:hover > .nav-submenu,
.has-dropdown:focus-within > .nav-submenu,
.has-dropdown.is-open > .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-submenu a {
    display: block;
    padding: 2px 15px 2px 35px;
    color: var(--color-submenu-text);
    font-size: var(--font-size-header-info);
    font-weight: 500;
    line-height: 1.9;
    transition: color 0.3s;
}

.nav-submenu a:hover,
.nav-submenu a:focus-visible {
    color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Hamburger, off-canvas panel head and overlay — hidden on desktop
   -------------------------------------------------------------------------- */

.nav-toggle,
.nav-close,
.main-nav__head,
.nav-overlay {
    display: none;
}

/* ==========================================================================
   Tablet and below — off-canvas navigation (breakpoint 1024px)
   ========================================================================== */

@media (max-width: 1024px) {

    :root {
        --header-row-height: 120px;
    }

    .top-bar {
        padding: 9px 30px;
    }

    .header-main {
        padding: 12px 30px;
    }

    .header-main__inner,
    .top-bar__inner {
        padding-inline: 0;
    }

    .site-logo {
        flex: 0 0 auto;
        margin: 0;
    }

    .site-logo img {
        width: clamp(90px, 18vw, 130px);
    }

    .header-main__nav {
        padding-right: 0;
    }

    .main-nav {
        margin-right: 0;
    }

    /* --- Hamburger --- */

    .nav-toggle {
        display: block;
        width: 45px;
        color: var(--color-white);
        line-height: 0;
        border-radius: 3px;
        transition: color 0.3s;
    }

    .nav-toggle:hover {
        color: var(--color-accent);
    }

    .nav-toggle svg {
        width: 30px;
        height: 30px;
        margin-left: auto;
    }

    /* --- Off-canvas panel --- */

    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        width: 100%;
        max-width: 350px;
        height: 100%;
        background-color: var(--color-maroon-mid);
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .main-nav.is-active {
        transform: translateX(0);
    }

    .main-nav__head {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 10px 0;
    }

    .nav-close {
        display: block;
        width: 45px;
        margin: 12px;
        color: var(--color-accent);
        font-size: 18px;
        font-weight: 600;
        transition: color 0.3s;
    }

    .nav-close:hover {
        color: var(--color-white);
    }

    /* --- Menu items --- */

    .nav-menu {
        display: block;
        height: auto;
    }

    .nav-menu > li {
        flex-wrap: wrap;
        height: auto;
    }

    .nav-menu > li > .nav-link {
        flex: 1;
        height: auto;
        padding: 7px 15px 7px 30px;
    }

    .nav-indicator {
        width: 45px;
        margin-left: auto;
        padding: 7px 0;
        color: var(--color-white);
    }

    /* --- Accordion submenus --- */

    .nav-submenu {
        position: static;
        display: none;
        width: 100%;
        min-width: 0;
        padding: 30px 0 30px 30px;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
    }

    .has-dropdown.is-open > .nav-submenu {
        display: block;
    }

    .nav-submenu a {
        padding: 5px 15px;
    }

    /* --- Overlay --- */

    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        background-color: var(--color-overlay);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .nav-overlay.is-active {
        opacity: 1;
        visibility: visible;
    }
}

/* ==========================================================================
   Mobile — the contact bar is hidden on the existing site below 768px
   ========================================================================== */

@media (max-width: 767px) {

    :root {
        --header-row-height: 100px;
    }

    .top-bar {
        display: none;
    }

    .header-main {
        padding: 11px 20px;
    }

    .site-logo img {
        width: clamp(85px, 24vw, 105px);
    }

    .main-nav {
        background-color: var(--color-maroon);
    }

    .nav-toggle svg {
        width: 27px;
        height: 27px;
    }
}
