/* ===========================================================================
   GovBrief site header, round-four design (10/5/2026)
   Markup: inc/site-header.php (the bar) + GeneratePress's nav markup.
   Values from code/govbrief/site-header/design-r4/SiteHeader.dc.html.
   Every selector starts with `body` because GeneratePress prints its own
   CSS after the child stylesheets. @font-face is printed inline by PHP.
   =========================================================================== */

/* --- the bar ------------------------------------------------------------ */
body .gb-header {
    position: relative;
    z-index: 20;
    background: #16233f;
    color: #fff;
    border-top: 4px solid #e0561f;
    font-family: Barlow, system-ui, sans-serif;
}
body .gb-header .inside-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    height: 72px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    text-align: left;
}
body .gb-header a {
    color: #fff;
    text-decoration: none;
}
body .gb-header a:focus-visible,
body .gb-header button:focus-visible,
body .gb-header .dropdown-menu-toggle:focus-visible {
    outline: 2px solid #f08a5d;
    outline-offset: -2px;
}

/* --- brand -------------------------------------------------------------- */
body .gb-header .gb-brand {
    flex: none;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}
body .gb-header .gb-brand-mark {
    display: flex;
    gap: 4px;
    align-items: center;
    align-self: stretch;
}
body .gb-header .gb-brand-mark span {
    display: block;
    width: 7px;
    height: 40px;
    background: #6f8fe6;
    transform: skewX(-18deg);
}
body .gb-header .gb-brand-mark span:nth-child(1) { background: #e0561f; }
body .gb-header .gb-brand-mark span:nth-child(2) { background: #fff; }
body .gb-header .gb-brand-text {
    display: grid;
    gap: 4px;
    line-height: 1;
}
body .gb-header .gb-brand-name {
    display: flex;
    gap: 5px;
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-weight: 800;
    font-size: 32px;
    line-height: 1;
    letter-spacing: .01em;
    white-space: nowrap;
}
body .gb-header .gb-brand-today { color: #f08a5d; }
body .gb-header .gb-brand-tagline {
    font-size: 12px;
    font-style: italic;
    line-height: 1;
    color: #c5cee0;
    white-space: nowrap;
}

/* --- nav shell (GP markup) --------------------------------------------- */
body .gb-header .main-navigation {
    float: none;
    clear: none;
    margin: 0 0 0 auto;
    padding: 0;
    background: transparent;
    height: 100%;
    align-self: stretch;
}
body .gb-header .main-navigation .inside-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}
body .gb-header .gb-bar-subscribe,
body .gb-header .main-navigation .menu-toggle,
body .gb-header .gb-nav-tagline {
    display: none;
}

/* --- desktop menu ------------------------------------------------------- */
body .gb-header .main-nav { height: 100%; }
body .gb-header .main-nav > ul {
    display: flex;
    align-items: stretch;
    height: 100%;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}
body .gb-header .main-nav > ul > li {
    position: relative;
    display: flex;
    align-items: stretch;
    float: none;
    margin: 0;
}
body .gb-header .main-nav > ul > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 11px;
    line-height: 1.2;
    color: #fff;
    background: transparent;
    font-family: Barlow, system-ui, sans-serif;
    font-weight: 600;
    font-size: 15px;
    text-transform: none;
    border-radius: 0;
}
body .gb-header .main-nav > ul > li:hover > a,
body .gb-header .main-nav > ul > li:focus-within > a,
body .gb-header .main-nav > ul > li.sfHover > a {
    color: #fff;
    background: #22345a;
}
body .gb-header .main-nav > ul > li.current-menu-item > a,
body .gb-header .main-nav > ul > li.current-menu-ancestor > a {
    box-shadow: inset 0 -4px 0 #e0561f;
}

/* Subscribe: the one filled button. #c2451a (the design's deeper orange), not #e0561f:
   white on #e0561f is 3.80:1 and WCAG AA wants 4.5:1 for 17 px bold; #c2451a is 5.05:1 (George 10/5). */
body .gb-header .main-nav > ul > li.gb-nav-subscribe {
    align-items: center;
    margin-right: 8px;
}
body .gb-header .main-nav > ul > li.gb-nav-subscribe > a {
    height: auto;
    margin: 0;
    padding: 8px 14px;
    line-height: 1.2;
    background: #c2451a;
    color: #fff;
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .06em;
    text-transform: uppercase;
    box-shadow: none;
}
body .gb-header .main-nav > ul > li.gb-nav-subscribe:hover > a,
body .gb-header .main-nav > ul > li.gb-nav-subscribe:focus-within > a {
    background: #a63a15;
    color: #fff;
}

/* Before You Vote: the campaign pill through Election Day, on navy */
body .gb-header .main-nav > ul > li.gb-nav-vote { align-items: center; }
body .gb-header .main-nav > ul > li.gb-nav-vote > a {
    height: auto;
    margin: 0 4px;
    padding: 0 14px;
    line-height: 32px;
    border: 2px solid #f08a5d;
    border-radius: 999px;
    color: #fff;
    background: transparent;
    box-shadow: none;
}
body .gb-header .main-nav > ul > li.gb-nav-vote:hover > a,
body .gb-header .main-nav > ul > li.gb-nav-vote:focus-within > a,
body .gb-header .main-nav > ul > li.gb-nav-vote.current-menu-item > a {
    background: #c2451a; /* filled state: white text needs 4.5:1, #e0561f gave 3.80 */
    border-color: #c2451a;
    color: #fff;
    box-shadow: none;
}

/* Search: magnifier before the label */
body .gb-header .main-nav > ul > li.gb-nav-search > a::before {
    content: "";
    flex: none;
    width: 15px;
    height: 15px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6.5' cy='6.5' r='5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3Cpath d='M10.5 10.5 15 15' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") no-repeat center / 15px 15px;
}

/* Dropdown caret: the design's solid triangle in orange (GP's chevron icon hidden) */
body .gb-header .main-nav > ul > li > a .dropdown-menu-toggle {
    display: inline-flex;
    align-items: center;
    height: auto;
    margin: 0;
    padding: 0;
    clear: none;
    color: #f08a5d;
}
body .gb-header .main-nav .dropdown-menu-toggle .gp-icon { display: none; }
body .gb-header .main-nav > ul > li > a .dropdown-menu-toggle::after {
    content: "\25BC";
    font-size: 10px;
    line-height: 1;
    transition: transform .15s;
}
body .gb-header .main-nav > ul > li.sfHover > a .dropdown-menu-toggle::after {
    transform: rotate(180deg);
}

/* Dropdown panel */
body .gb-header .main-nav > ul > li > ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    width: 230px;
    margin: 0;
    padding: 8px 0;
    float: none;
    text-align: left;
    background: #fff;
    color: #16233f;
    border-top: 4px solid #e0561f;
    border-radius: 0;
    box-shadow: 0 14px 30px rgba(10, 18, 36, .28);
}
body .gb-header .main-nav > ul > li.sfHover > ul.sub-menu.toggled-on {
    left: 0;
    right: auto;
}
/* panels near the right edge open leftward */
body .gb-header .main-nav > ul > li:nth-last-child(-n+3).menu-item-has-children > ul.sub-menu,
body .gb-header .main-nav > ul > li:nth-last-child(-n+3).menu-item-has-children.sfHover > ul.sub-menu.toggled-on {
    left: auto;
    right: 0;
}
body .gb-header .main-nav ul ul li {
    display: grid;
    float: none;
    width: auto;
    margin: 0;
}
body .gb-header .main-nav ul ul li a {
    display: block;
    padding: 10px 18px;
    color: #16233f;
    background: transparent;
    border-left: 4px solid transparent;
    font-family: Barlow, system-ui, sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.15;
}
body .gb-header .main-nav ul ul li a:hover,
body .gb-header .main-nav ul ul li a:focus {
    color: #16233f;
    background: #eef1f6;
}
body .gb-header .main-nav ul ul li.current-menu-item > a {
    background: #fde6da;
    border-left-color: #e0561f;
}
body .gb-header .main-nav ul ul a:focus-visible {
    outline-color: #e0561f;
}

/* --- phone (under the design's desktop switch) --------------------------- */
@media (max-width: 1039px) {
    body .gb-header .inside-header {
        height: 58px;
        padding: 0 16px;
        gap: 10px;
    }
    body .gb-header .gb-brand { gap: 10px; }
    body .gb-header .gb-brand-mark span { height: 30px; }
    body .gb-header .gb-brand-name { font-size: 24px; }
    body .gb-header .gb-brand-tagline { display: none; }

    body .gb-header .main-navigation {
        position: static;
        height: auto;
        align-self: center;
    }
    body .gb-header .main-navigation .inside-navigation {
        position: static; /* GP makes it relative for its search bar; the panel positions against the bar instead */
        height: auto;
        gap: 8px;
    }
    body .gb-header .gb-bar-subscribe {
        display: flex;
        align-items: center;
        height: 36px;
        padding: 0 10px;
        background: #c2451a; /* AA: 5.05:1 with white; the design's #e0561f is 3.80 */
        color: #fff;
        font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
        font-weight: 700;
        font-size: 14px;
        letter-spacing: .06em;
        text-transform: uppercase;
        white-space: nowrap;
    }
    body .gb-header .gb-bar-subscribe:hover,
    body .gb-header .gb-bar-subscribe:focus { background: #a63a15; color: #fff; }

    body .gb-header .main-navigation .menu-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        height: 44px;
        min-width: 44px;
        margin: 0;
        padding: 0 6px 0 10px;
        flex-grow: 0;
        background: none;
        border: 0;
        border-radius: 0;
        color: #fff;
        font-family: Barlow, system-ui, sans-serif;
        font-weight: 600;
        font-size: 15px;
        line-height: 1;
        text-transform: none;
    }
    body .gb-header .main-navigation .menu-toggle:hover,
    body .gb-header .main-navigation .menu-toggle:focus { background: none; color: #fff; }
    body .gb-header .menu-toggle .mobile-menu { order: 1; padding: 0; }
    body .gb-header .menu-toggle .gp-icon { order: 2; display: inline-flex; }
    body .gb-header .menu-toggle .gp-icon svg { width: 20px; height: 20px; fill: currentColor; }

    /* in-menu Subscribe is replaced by the bar button on phones */
    body .gb-header .main-navigation .main-nav > ul > li.gb-nav-subscribe,
    body .gb-header .main-navigation.toggled .main-nav > ul > li.gb-nav-subscribe { display: none; }

    /* the panel */
    body .gb-header .main-navigation .main-nav { height: auto; }
    body .gb-header .main-navigation .main-nav > ul { display: none; }
    body .gb-header .main-navigation.toggled .main-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 30;
        order: 0;
        flex-basis: auto;
        background: #16233f;
        border-top: 1px solid #33456b;
        box-shadow: 0 18px 30px rgba(10, 18, 36, .35);
    }
    body .gb-header .main-navigation.toggled .main-nav > ul {
        display: grid;
        height: auto;
        gap: 0;
        margin: 0;
        padding: 6px 0 14px;
    }
    body .gb-header .main-navigation.toggled .main-nav > ul > li {
        display: grid;
        position: static;
        width: 100%;
        border-bottom: 1px solid #2b3d66;
    }
    body .gb-header .main-navigation.toggled .main-nav > ul > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-height: 52px;
        height: auto;
        padding: 0 16px;
        line-height: 1.1;
        color: #fff;
        background: none;
        border-left: 4px solid transparent;
        box-shadow: none;
        text-align: left;
        font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
        font-weight: 700;
        font-size: 21px;
        letter-spacing: .03em;
        text-transform: none;
    }
    body .gb-header .main-navigation.toggled .main-nav > ul > li:hover > a,
    body .gb-header .main-navigation.toggled .main-nav > ul > li.sfHover > a,
    body .gb-header .main-navigation.toggled .main-nav > ul > li:focus-within > a {
        background: none;
    }
    body .gb-header .main-navigation.toggled .main-nav > ul > li.current-menu-item > a,
    body .gb-header .main-navigation.toggled .main-nav > ul > li.current-menu-ancestor > a {
        border-left-color: #e0561f;
        box-shadow: none;
    }
    body .gb-header .main-navigation.toggled .main-nav > ul > li.gb-nav-search > a {
        justify-content: flex-start;
    }
    body .gb-header .main-navigation.toggled .main-nav > ul > li.gb-nav-vote > a {
        margin: 8px 16px;
        min-height: 40px;
        padding: 0 16px;
        justify-content: center;
        border: 2px solid #f08a5d;
        border-radius: 999px;
    }
    body .gb-header .main-navigation.toggled .main-nav > ul > li.gb-nav-vote.current-menu-item > a {
        background: #c2451a;
        border-color: #c2451a;
    }

    /* + / - on items with a submenu */
    body .gb-header .main-navigation.toggled .main-nav > ul > li > a .dropdown-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        float: none;
        min-width: 44px;
        min-height: 44px;
        margin: 0 -10px 0 0;
        padding: 0;
        color: #f08a5d;
    }
    body .gb-header .main-navigation.toggled .dropdown-menu-toggle .gp-icon { display: none; }
    body .gb-header .main-navigation.toggled .dropdown-menu-toggle::after {
        content: "+";
        font-family: Barlow, system-ui, sans-serif;
        font-size: 22px;
        font-weight: 500;
        line-height: 1;
    }
    body .gb-header .main-navigation.toggled li.sfHover > a > .dropdown-menu-toggle::after {
        content: "\2212";
    }

    body .gb-header .main-navigation.toggled .main-nav ul ul.sub-menu {
        display: none;
        position: static;
        width: 100%;
        margin: 0;
        padding: 4px 0 10px;
        background: #0f1a31;
        border: 0;
        box-shadow: none;
    }
    body .gb-header .main-navigation.toggled .main-nav ul ul.sub-menu.toggled-on {
        display: block;
        visibility: visible;
        opacity: 1;
        height: auto;
        left: auto;
        right: auto;
        float: none;
        overflow: visible;
        pointer-events: auto;
    }
    body .gb-header .main-navigation.toggled .main-nav ul ul li {
        display: block;
        border: 0;
    }
    body .gb-header .main-navigation.toggled .main-nav ul ul li a {
        display: flex;
        align-items: baseline;
        gap: 10px;
        min-height: 46px;
        box-sizing: border-box;
        padding: 12px 16px 10px 34px;
        color: #fff;
        background: none;
        border: 0;
        font-family: Barlow, system-ui, sans-serif;
        font-size: 17px;
        font-weight: 500;
        line-height: 1.3;
    }
    body .gb-header .main-navigation.toggled .main-nav ul ul li a:hover,
    body .gb-header .main-navigation.toggled .main-nav ul ul li a:focus {
        color: #fff;
        background: #16233f;
    }
    body .gb-header .main-navigation.toggled .main-nav ul ul li.current-menu-item > a {
        font-weight: 700;
        background: none;
    }
    body .gb-header .main-navigation.toggled .main-nav ul ul a:focus-visible {
        outline-color: #f08a5d;
    }

    body .gb-header .main-navigation.toggled .gb-nav-tagline {
        display: block;
        margin: 0;
        padding: 0 16px 18px;
        font-size: 14px;
        font-style: italic;
        color: #c5cee0;
    }
}

/* Under 420 px the menu button is icon-only; "Menu" stays for screen readers. */
@media (max-width: 419px) {
    body .gb-header .main-navigation .menu-toggle { padding: 0 6px; gap: 0; }
    body .gb-header .menu-toggle .mobile-menu {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    body .gb-header .main-nav > ul > li > a .dropdown-menu-toggle::after { transition: none; }
}
