/* ═══════════════════════════════════════════════════
   VICTOR HEADER STYLES
   Loaded site-wide.
   Yellow bar, flat nav, search + CTA on the right.
   Mobile: tapping the toggle adds .is-menu-open on .victor-header
   and reveals nav + actions stacked below logo.
   ═══════════════════════════════════════════════════ */

.victor-header {
    background: var(--victor-bg-yellow);
    padding: var(--victor-space-md) 0;
    position: relative;
    z-index: 100;
}

.victor-header__inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--victor-space-md);
}

/* ── LOGO ── */
.victor-header__logo {
    flex-shrink: 0;
    margin-right: auto;
}
.victor-header__logo-link {
    display: inline-flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--victor-primary);
    line-height: 1;
}
.victor-header__logo-img {
    max-height: 60px;
    width: auto;
    display: block;
}
.victor-header__logo-text {
    font-size: var(--victor-fs-xl);
    font-weight: var(--victor-fw-bold);
    color: var(--victor-primary);
    text-transform: capitalize;
}
.victor-header__logo-tagline {
    font-size: var(--victor-fs-xs);
    color: var(--victor-primary);
    font-style: italic;
    margin-top: 2px;
}

/* ── MOBILE TOGGLE ── */
.victor-header__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--victor-primary);
    padding: 0;
    flex-shrink: 0;
}
.victor-header__toggle:focus-visible {
    outline: 3px solid var(--victor-primary);
    outline-offset: 2px;
    border-radius: var(--victor-radius-sm);
}
.victor-hamburger {
    display: inline-block;
    width: 24px;
    height: 18px;
    position: relative;
}
.victor-hamburger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2.5px;
    background: var(--victor-primary);
    border-radius: 2px;
    transition: transform var(--victor-transition),
                opacity var(--victor-transition),
                top var(--victor-transition);
}
.victor-hamburger span:nth-child(1) { top: 0; }
.victor-hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.victor-hamburger span:nth-child(3) { top: 100%; transform: translateY(-100%); }

/* Open state: hamburger morphs into X */
.victor-header.is-menu-open .victor-header__toggle[aria-expanded="true"] .victor-hamburger span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}
.victor-header.is-menu-open .victor-header__toggle[aria-expanded="true"] .victor-hamburger span:nth-child(2) {
    opacity: 0;
}
.victor-header.is-menu-open .victor-header__toggle[aria-expanded="true"] .victor-hamburger span:nth-child(3) {
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
}

/* ── NAV (mobile: hidden until menu open) ── */
.victor-header__nav {
    display: none;
    flex-basis: 100%;
    order: 3;
}
.victor-header.is-menu-open .victor-header__nav {
    display: block;
    padding-top: var(--victor-space-md);
}

.victor-header__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--victor-space-xs);
}
.victor-header__menu > li > a {
    display: block;
    padding: var(--victor-space-sm) var(--victor-space-md);
    color: var(--victor-primary);
    font-weight: var(--victor-fw-bold);
    text-decoration: none;
    text-transform: uppercase;
    font-size: var(--victor-fs-sm);
    letter-spacing: 0.04em;
    border-radius: var(--victor-radius-sm);
    min-height: 44px;
    line-height: 1.4;
}
.victor-header__menu > li > a:hover,
.victor-header__menu > li > a:focus-visible,
.victor-header__menu > li.current-menu-item > a {
    background: rgba(1, 34, 85, 0.08);
}
.victor-header__menu > li.current-menu-item > a {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ── ACTIONS (mobile: hidden until menu open) ── */
.victor-header__actions {
    display: none;
    flex-basis: 100%;
    order: 4;
    flex-direction: column;
    gap: var(--victor-space-md);
    padding-top: var(--victor-space-md);
    margin-top: var(--victor-space-sm);
    border-top: 1px solid rgba(1, 34, 85, 0.15);
}
.victor-header.is-menu-open .victor-header__actions {
    display: flex;
}

.victor-header__search {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: var(--victor-radius-full);
    height: 44px;
    width: 100%;
    max-width: 320px;
    padding: 4px 4px 4px 6px;
    box-sizing: border-box;
}
.victor-header__search-input,
.victor-header input[type="search"].victor-header__search-input {
    flex: 1;
    border: 0;
    padding: 0 var(--victor-space-sm) 0 var(--victor-space-md);
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: var(--victor-text);
    font-size: var(--victor-fs-sm);
    height: 100%;
    min-height: 0;
    min-width: 0;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
}
.victor-header__search-input::-webkit-search-decoration,
.victor-header__search-input::-webkit-search-cancel-button,
.victor-header__search-input::-webkit-search-results-button,
.victor-header__search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}
.victor-header__search-input::placeholder {
    color: var(--victor-text-muted);
    font-style: italic;
}
.victor-header__search:focus-within {
    outline: 3px solid var(--victor-primary);
    outline-offset: 2px;
}
.victor-header__search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-height: 38px;
    border: 0;
    background: var(--victor-primary);
    color: #fff;
    cursor: pointer;
    border-radius: var(--victor-radius-full);
    flex-shrink: 0;
    padding: 0;
    transition: background-color var(--victor-transition);
}
.victor-header__search-btn:hover,
.victor-header__search-btn:focus-visible {
    background: var(--victor-primary-dark);
}
.victor-header__search-btn svg {
    width: 20px !important;
    height: 20px !important;
    max-width: none;
    max-height: none;
    display: block;
    pointer-events: none;
}

.victor-header__cta {
    border-radius: var(--victor-radius-full);
    white-space: nowrap;
    padding: 0 var(--victor-space-lg);
    color: var(--victor-text-on-navy);
    background-color: var(--victor-primary);
    border: 2px solid var(--victor-primary);
    transition: background-color var(--victor-transition),
                color var(--victor-transition),
                border-color var(--victor-transition);
}
.victor-header__cta:hover,
.victor-header__cta:focus-visible,
.victor-header__cta:active {
    background-color: #FFFFFF;
    color: var(--victor-primary);
    border-color: var(--victor-primary);
}

/* ═══════════════════════════════════════
   DESKTOP (1024px+)
   ═══════════════════════════════════════ */
@media (min-width: 64rem) {

    .victor-header__inner {
        gap: var(--victor-space-xl);
        flex-wrap: nowrap;
    }

    /* Hide hamburger on desktop */
    .victor-header__toggle {
        display: none;
    }

    /* Nav inline, flex grow centers it between logo and actions */
    .victor-header__nav {
        display: flex;
        flex-basis: auto;
        order: 2;
        justify-content: center;
        flex: 1;
        padding-top: 0;
    }
    .victor-header__menu {
        flex-direction: row;
        gap: var(--victor-space-xs);
    }
    .victor-header__menu > li > a {
        padding: var(--victor-space-sm) var(--victor-space-md);
        text-transform: none;
        letter-spacing: 0;
        font-size: var(--victor-fs-base);
        font-weight: var(--victor-fw-bold);
        background: transparent !important;
    }
    .victor-header__menu > li > a:hover,
    .victor-header__menu > li > a:focus-visible {
        text-decoration: underline;
        text-underline-offset: 4px;
    }

    /* Actions inline on the right */
    .victor-header__actions {
        display: flex;
        flex-basis: auto;
        order: 3;
        flex-direction: row;
        align-items: center;
        gap: var(--victor-space-md);
        padding: 0;
        margin: 0;
        border: 0;
        flex-shrink: 0;
    }
    .victor-header__search {
        width: 180px;
        max-width: none;
    }
}

@media (min-width: 80rem) {
    .victor-header__inner {
        gap: var(--victor-space-2xl);
    }
    .victor-header__search {
        width: 210px;
    }
}

/* ═══════════════════════════════════════════════════
   HEADER COLOR STYLES (data-style attribute)
   Three pre-approved presets, all WCAG AA contrast-safe.
   Default (yellow) is already styled above.
   ═══════════════════════════════════════════════════ */

/* ── NAVY VARIANT ── */
.victor-header[data-style="navy"] {
    background: var(--victor-bg-navy);
}
.victor-header[data-style="navy"] .victor-header__logo-link,
.victor-header[data-style="navy"] .victor-header__logo-text,
.victor-header[data-style="navy"] .victor-header__logo-tagline,
.victor-header[data-style="navy"] .victor-header__menu > li > a {
    color: var(--victor-text-on-navy);
}
.victor-header[data-style="navy"] .victor-hamburger span {
    background: var(--victor-text-on-navy);
}
.victor-header[data-style="navy"] .victor-header__menu > li > a:hover,
.victor-header[data-style="navy"] .victor-header__menu > li > a:focus-visible,
.victor-header[data-style="navy"] .victor-header__menu > li.current-menu-item > a {
    background: rgba(255, 255, 255, 0.12);
}
.victor-header[data-style="navy"] .victor-header__actions {
    border-top-color: rgba(255, 255, 255, 0.15);
}
.victor-header[data-style="navy"] .victor-header__search-btn {
    background: var(--victor-accent);
    color: var(--victor-text-on-yellow);
}
.victor-header[data-style="navy"] .victor-header__search-btn:hover,
.victor-header[data-style="navy"] .victor-header__search-btn:focus-visible {
    background: var(--victor-accent-dark);
}
.victor-header[data-style="navy"] .victor-header__cta {
    background: var(--victor-accent);
    color: var(--victor-text-on-yellow);
    border-color: var(--victor-accent);
}
.victor-header[data-style="navy"] .victor-header__cta:hover,
.victor-header[data-style="navy"] .victor-header__cta:focus-visible {
    background: var(--victor-bg-navy);
    color: var(--victor-accent);
    border-color: var(--victor-accent);
}
.victor-header[data-style="navy"] .victor-header__toggle:focus-visible {
    outline-color: var(--victor-accent);
}

/* On desktop, override the !important transparent background on menu hover */
@media (min-width: 64rem) {
    .victor-header[data-style="navy"] .victor-header__menu > li > a {
        background: transparent !important;
    }
    .victor-header[data-style="navy"] .victor-header__menu > li > a:hover,
    .victor-header[data-style="navy"] .victor-header__menu > li > a:focus-visible {
        text-decoration: underline;
        text-decoration-color: var(--victor-accent);
    }
}

/* ── WHITE VARIANT ── */
.victor-header[data-style="white"] {
    background: #FFFFFF;
    border-bottom: 1px solid rgba(1, 34, 85, 0.10);
}
.victor-header[data-style="white"] .victor-header__logo-link,
.victor-header[data-style="white"] .victor-header__logo-text,
.victor-header[data-style="white"] .victor-header__logo-tagline,
.victor-header[data-style="white"] .victor-header__menu > li > a {
    color: var(--victor-primary);
}
.victor-header[data-style="white"] .victor-hamburger span {
    background: var(--victor-primary);
}
.victor-header[data-style="white"] .victor-header__menu > li > a:hover,
.victor-header[data-style="white"] .victor-header__menu > li > a:focus-visible,
.victor-header[data-style="white"] .victor-header__menu > li.current-menu-item > a {
    background: rgba(1, 34, 85, 0.06);
}
.victor-header[data-style="white"] .victor-header__actions {
    border-top-color: rgba(1, 34, 85, 0.10);
}
/* Search and CTA already navy on white = correct contrast, no override needed */
