/* ==========================================================================
   Header Tokens
   ========================================================================== */

:root {

    /* Header bar */
    --header-padding-y: 20px;
    --header-padding-y-mobile: 14px;

    /* Space between header items */
    --header-gap: 2px;        /* between items in the right-hand cluster */
    --header-gap-left: 40px;   /* between logo and nav */
    --header-gap-mobile: 2px;

    /* Logo */
    --header-logo-height: 40px;
    --header-logo-height-mobile: 32px;

}


/* ==========================================================================
   Header Shell
   ========================================================================== */

.ssc-header {
    position: relative;
    z-index: 100;
		border-bottom: 1px solid var(--color-border);
}

.ssc-header--sticky {
    position: sticky;
    top: 0;
}

.ssc-header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: calc(var(--container-width) + var(--block-padding-x) * 2);
    margin-inline: auto;
    padding-block: var(--header-padding-y);
    padding-inline: var(--block-padding-x);

}

.ssc-header__left,
.ssc-header__right {
    display: flex;
    align-items: center;
}

.ssc-header__left {
    gap: var(--header-gap-left);
}

.ssc-header__right {
    gap: var(--header-gap);
}
/* ==========================================================================
   Header Icon Buttons
   ========================================================================== */

.ssc-header__icons {
    display: flex;
    align-items: center;
    gap: var(--header-gap);
}

.ssc-header__search,
.ssc-header__toggle,
.ssc-header__icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.ssc-header__search:hover,
.ssc-header__search:focus-visible,
.ssc-header__icons a:hover,
.ssc-header__icons a:focus-visible {
    color: var(--color-primary);
}

.ssc-header__icons .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 1;
}


/* Phones
   --------------------------------------------------------------------------
   This block has to sit AFTER the rules it overrides, not before them.

   It used to live further up the file, above
   `.ssc-header__icons { display: flex }`. A media query adds nothing to
   specificity, so the two rules weighed the same and the later one won:
   the icons never hid, the right-hand cluster stayed about 90px wider
   than it should have been, and every page scrolled sideways below
   414px. The rule was correct and simply never applied.
   ========================================================================== */

@media (max-width: 600px) {

    /* Let both sides give way instead of overflowing. */
    .ssc-header__left,
    .ssc-header__right {
        min-width: 0;
    }

    .ssc-header__logo {
        min-width: 0;
        flex: 0 1 auto;
    }

    /*
     * The logo is what gives way when the right-hand cluster needs room,
     * but not past the point of being a logo. Below this it is a smudge,
     * and hiding the call to action on mobile (Site Settings → Header)
     * is the better trade than a mark nobody can read.
     */
    .ssc-header__logo img {
        height: auto;
        max-height: var(--header-logo-height-mobile);
        max-width: 100%;
        min-width: var(--header-logo-min-width-mobile, 72px);
    }

    /*
     * The logo, the call to action, search and the menu button are what a
     * phone has room for. Anything else in the right-hand cluster moves
     * into the menu, which is the one place that can hold all of it.
     *
     * These links have to be IN that menu for this to be a move rather
     * than a removal — there is nothing at runtime that checks.
     */
    .ssc-header__icons {
        display: none;
    }

    /*
     * Tighter CTA so it fits beside the logo, and kept on one line.
     *
     * Without the nowrap a two-word label — "Donate Now", "Buy Tickets" —
     * breaks across two lines at 375px and under, which makes the whole
     * bar taller rather than making anything fit. The logo is the thing
     * that gives way instead: it is flex: 0 1 auto above, so a longer
     * label shrinks the logo rather than pushing the bar off-screen.
     */
    .ssc-header__right .btn {
        padding-inline: var(--space-sm);
        font-size: 0.8125rem;
        white-space: nowrap;

        /*
         * Once the logo is at its floor, a long label has nowhere left to
         * push, so it truncates here rather than taking the page with it.
         * A clipped label is a bad look and a sideways-scrolling site is
         * a worse one; a site that hits this should shorten the label or
         * turn the button off on mobile.
         */
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /*
     * 30px of gutter each side is a tenth of a 320px screen. The header
     * is the one bar that has to fit a fixed set of controls, so it takes
     * the narrower gutter while the rest of the page keeps the wider one.
     */
    .ssc-header__container {
        padding-inline: var(--space-sm);
    }

    .ssc-header__search,
    .ssc-header__toggle {
        width: 40px;
    }

}

@media (max-width: 768px) {

    .ssc-header__container {
        max-width: calc(var(--container-width) + var(--block-padding-x-mobile) * 2);
        padding-block: var(--header-padding-y-mobile);
        padding-inline: var(--block-padding-x-mobile);
    }

    .ssc-header__left,
    .ssc-header__right {
        gap: var(--header-gap-mobile);
    }

}


/* ==========================================================================
   Background Variants
   ========================================================================== */

.ssc-header--white {
    background-color: var(--color-light);
}

.ssc-header--cream {
    background-color: var(--color-surface-subtle);
}

.ssc-header--dark {
    background-color: var(--color-dark);
    color: var(--color-light);
}

.ssc-header--transparent {
    background-color: transparent;
}


/* ==========================================================================
   Logo
   ========================================================================== */

.ssc-header__logo img {
    display: block;
    width: auto;
    height: var(--header-logo-height);
    max-width: 100%;
}

@media (max-width: 992px) {

    .ssc-header__logo img {
        height: var(--header-logo-height-mobile);
    }

}


/* ==========================================================================
   Announcement / Utility Bar
   ========================================================================== */

.ssc-utility-bar {
    background-color: var(--color-dark);
    color: var(--color-light);
}

.ssc-utility-bar__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem var(--block-padding-x);
    text-align: center;
}

.ssc-utility-bar__message {
    font-size: 0.875rem;
    color: inherit;
    text-decoration: none;
}

.ssc-utility-bar__close {
    position: absolute;
    right: var(--block-padding-x);
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
}

.ssc-utility-bar.is-dismissed {
    display: none;
}


/* ==========================================================================
   Utility Nav
   ========================================================================== */

/*
 * The same box as .ssc-header__container below it.
 *
 * Without the max-width this row is as wide as the window while the
 * header under it stops at the container, so the two right edges only
 * agree at exactly the container width. At 1920 the utility link sat
 * 280px to the right of the menu button it is supposed to line up
 * with -- far enough out to read as a mistake, and invisible to
 * anyone developing at 1280.
 */
.ssc-header__utility-nav {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    max-width: calc(var(--container-width) + var(--block-padding-x) * 2);
    margin-inline: auto;
    padding: 0.5rem var(--block-padding-x);
    font-size: 0.8125rem;
}

.ssc-utility-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}


/* ==========================================================================
   CTA Visibility
   ========================================================================== */

@media (max-width: 992px) {

    .ssc-header__cta--hide-mobile {
        display: none;
    }

}


/* ==========================================================================
   Menu Button Visibility
   ========================================================================== */

/*
 * The menu button opens the Mobile Menu overlay, and some sites want it on
 * desktop as well as mobile — an extended menu alongside the primary nav.
 * Where they do not, Site Settings → Header → Hide Menu Button on Desktop
 * puts this class on it.
 *
 * 993px, not 992px, so it picks up exactly where the primary nav's own
 * breakpoint leaves off. Any other number leaves a band of widths with no
 * navigation at all: the primary nav hidden below 992px and the button
 * hidden above whatever this said.
 *
 * display: none rather than visibility or opacity, so the button leaves the
 * tab order and the accessibility tree with it. A focusable control for an
 * overlay nobody can see is worse than no control.
 */
@media (min-width: 993px) {

    .ssc-header__toggle--hide-desktop {
        display: none;
    }

}


/* ==========================================================================
   Primary Nav + Dropdowns
   ========================================================================== */

.ssc-menu,
.ssc-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ssc-menu {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.ssc-menu li {
    position: relative;
}

.ssc-menu a {
    display: block;
    padding: var(--space-xs) 0;
    color: inherit;
    text-decoration: none;
}

.ssc-menu a:hover,
.ssc-menu a:focus {
    color: var(--color-primary);
}

@media (max-width: 992px) {

    .ssc-header__nav {
        display: none;
    }

}


/* Parent item indicator */

.ssc-menu .menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    margin-left: .4em;
    border-left: .3em solid transparent;
    border-right: .3em solid transparent;
    border-top: .3em solid currentColor;
    vertical-align: middle;
}


/* Dropdown panel */

.ssc-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    min-width: 220px;
    padding: var(--space-xs) 0;
    background: var(--color-light);
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.ssc-menu .sub-menu a {
    padding: var(--space-xs) var(--space-sm);
    color: var(--color-text);
    white-space: nowrap;
}

.ssc-menu .sub-menu a:hover,
.ssc-menu .sub-menu a:focus {
    background: var(--color-surface-subtle);
    color: var(--color-primary);
}

.ssc-menu .menu-item-has-children:hover > .sub-menu,
.ssc-menu .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
}


/* ==========================================================================
   Menu Toggle
   ========================================================================== */

.ssc-header__toggle-icon,
.ssc-header__toggle-icon::before,
.ssc-header__toggle-icon::after {
    display: block;
    width: 20px;
    height: 2px;
    background-color: currentColor;
    transition: transform .25s ease, opacity .25s ease;
}

.ssc-header__toggle-icon {
    position: relative;
}

.ssc-header__toggle-icon::before,
.ssc-header__toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
}

.ssc-header__toggle-icon::before {
    top: -6px;
}

.ssc-header__toggle-icon::after {
    top: 6px;
}


/* Open state — bars become an X */

.ssc-header__toggle[aria-expanded="true"] .ssc-header__toggle-icon {
    background-color: transparent;
}

.ssc-header__toggle[aria-expanded="true"] .ssc-header__toggle-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.ssc-header__toggle[aria-expanded="true"] .ssc-header__toggle-icon::after {
    top: 0;
    transform: rotate(-45deg);
}


/* ==========================================================================
   Off-canvas Menu (slides in from the right)
   ========================================================================== */

.ssc-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.ssc-menu-overlay[hidden] {
    display: none;
}

.ssc-menu-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ssc-menu-overlay.is-open .ssc-menu-overlay__backdrop {
    opacity: 1;
}

.ssc-menu-overlay__panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(90vw, 400px);
    background: var(--color-light, #fff);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.ssc-menu-overlay.is-open .ssc-menu-overlay__panel {
    transform: translateX(0);
}

.ssc-menu-overlay__close {
    display: block;
    margin-left: auto;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--color-heading, #111);
}

.ssc-menu-overlay__nav {
    margin-top: 1rem;
}

.ssc-menu-overlay__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ssc-menu-overlay__nav li {
    border-bottom: 1px solid var(--color-border, #ddd);
}

.ssc-menu-overlay__nav a {
    display: block;
    padding: 0.85rem 0.25rem;
    font-size: 1.1rem;
    color: var(--color-heading, #111);
    text-decoration: none;
}

.ssc-menu-overlay__nav a:hover,
.ssc-menu-overlay__nav a:focus {
    color: var(--color-primary, #0055cc);
}

/* Added/removed by header.js while the panel is open */
body.ssc-menu-open {
    overflow: hidden;
}

/* Off-canvas submenu accordion */

.ssc-menu-overlay__expand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    width: 100%;
    padding: 0.85rem 0.25rem;
    background: none;
    border: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.ssc-menu-overlay__expand-icon {
    position: relative;
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
}

.ssc-menu-overlay__expand-icon::before,
.ssc-menu-overlay__expand-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 12px;
    height: 2px;
    background-color: currentColor;
    transform: translateY(-50%);
    transition: transform .2s ease, opacity .2s ease;
}

.ssc-menu-overlay__expand-icon::after {
    transform: translateY(-50%) rotate(90deg);
}

.ssc-menu-overlay__expand[aria-expanded="true"] .ssc-menu-overlay__expand-icon::after {
    transform: translateY(-50%) rotate(0deg);
    opacity: 0;
}

.ssc-menu-overlay__nav .sub-menu[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {

    .ssc-menu-overlay__expand-icon::before,
    .ssc-menu-overlay__expand-icon::after {
        transition: none;
    }

}
/* ==========================================================================
   Search
   ========================================================================== */

.ssc-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
}

.ssc-search-overlay[hidden] {
    display: none;
}

.ssc-search-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    opacity: 0;
    transition: opacity .25s ease;
}

.ssc-search-overlay.is-open .ssc-search-overlay__backdrop {
    opacity: 1;
}

.ssc-search-overlay__panel {
    position: relative;
    max-width: calc(var(--container-width) + var(--block-padding-x) * 2);
    margin-inline: auto;
    padding: var(--space-xl) var(--block-padding-x);
    background: var(--color-light);
    transform: translateY(-100%);
    transition: transform .25s ease;
}

.ssc-search-overlay.is-open .ssc-search-overlay__panel {
    transform: translateY(0);
}

.ssc-search-overlay__close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    padding: var(--space-xs);
    background: none;
    border: 0;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--color-text);
    cursor: pointer;
}

.ssc-search-overlay__title {
    margin: 0 0 var(--space-md);
}

.ssc-search-overlay__form {
    display: flex;
    gap: var(--space-xs);
}

.ssc-search-overlay__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--color-border);
    font-size: 1rem;
}

body.ssc-search-open {
    overflow: hidden;
}


/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .ssc-menu .sub-menu,
    .ssc-header__toggle-icon,
    .ssc-header__toggle-icon::before,
    .ssc-header__toggle-icon::after,
    .ssc-menu-overlay__backdrop,
    .ssc-menu-overlay__panel,
    .ssc-search-overlay__backdrop,
    .ssc-search-overlay__panel {
        transition: none;
    }

}