/* Responsive header positioning, surfaces, and navigation. */

:root {
    --site-header-height: 0px;
    --site-admin-bar-offset: 0px;
    --header-state-duration: 240ms;
    --header-state-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --header-overlay-scrim: rgb(0 0 0 / 0.60);

    /* Minimum clearance below an overlay header. */
    --header-safe-top: 80px;
}

/* WordPress's classic admin-bar stylesheet does not expose a stable variable. */
body.admin-bar {
    --site-admin-bar-offset: 32px;
}

@media (max-width: 782px) {
    body.admin-bar {
        --site-admin-bar-offset: 46px;
    }
}

/* The template-part wrapper owns all viewport positioning. */
.site-header-shell {
    box-sizing: border-box;
    inline-size: 100%;
    margin-block: 0;
    z-index: 1000;
}

.site-header-shell--sticky-soft {
    position: sticky;
    top: var(--site-admin-bar-offset, 0px);
}

/* Core makes the mobile admin bar non-fixed at this breakpoint. Native sticky
 * chrome uses the viewport edge after it scrolls away; an absolute overlay
 * retains the 46px fallback until the enhanced driver measures its overlap. */
@media (max-width: 600px) {
    body.admin-bar .site-header-shell--sticky-soft {
        top: 0;
    }
}

:is(.site-header-shell--overlay-to-solid, .site-header-shell--overlay-transient) {
    position: absolute;
    top: var(--site-admin-bar-offset, 0px);
    right: 0;
    left: 0;
}

/* Absolute overlay chrome and the first content band must share y=0. Core's
 * top-level block-gap rule would otherwise reveal a strip of page background. */
:is(.site-header-shell--overlay-to-solid, .site-header-shell--overlay-transient)
    + .wp-block-post-content {
    margin-block-start: 0;
}

/* Reserve space for content beneath an overlay header. */
:is(.site-header-shell--overlay-to-solid, .site-header-shell--overlay-transient)
    + .wp-block-post-content
    .header-overlay-clearance {
    /* Include the header and admin bar in the content clearance. */
    --header-clearance: max(
        calc(var(--site-header-height, 0px) + var(--site-admin-bar-offset, 0px)),
        var(--header-safe-top)
    );
}

/* A cover centres its content, so its reservation is equal on both sides:
 * that keeps the content on the band's own centre line instead of pushing it
 * down, which makes this a no-op for a band that already had the room. It
 * lands on the inner container so the image and dim still paint the full band. */
:is(.site-header-shell--overlay-to-solid, .site-header-shell--overlay-transient)
    + .wp-block-post-content
    .header-overlay-clearance
    > .wp-block-cover__inner-container {
    padding-block: var(--header-clearance);
}

/* Use a spacer to prevent the first child's margin from collapsing. */
:is(.site-header-shell--overlay-to-solid, .site-header-shell--overlay-transient)
    + .wp-block-post-content
    .header-overlay-clearance:not(.wp-block-cover)::before {
    display: block;
    block-size: var(--header-clearance);
    content: "";
}

/* Fixed positioning applies only while the header script is active. */
html.header-state-js .site-header-shell--overlay-to-solid {
    position: fixed;
}

/*
 * The inner group owns the surface. Its padding, border width, and dimensions
 * are identical in both states; no state selector below changes layout.
 */
.site-header-shell :is(.header-behavior-sticky-soft, .header-behavior-overlay) {
    /* Two tiers: the -solid tokens are the always-opaque vocabulary (no-JS
     * fallback, forced-solid pages, nav modal and submenu panels); the
     * surface pair is what the two states actually paint, and only the
     * driver-scoped treatment rules below ever make it non-opaque. */
    --header-start-solid: var(--wp--preset--color--base, #ffffff);
    --header-scrolled-solid: var(--header-start-solid);
    --header-start-surface: var(--header-start-solid);
    --header-scrolled-surface: var(--header-scrolled-solid);
    --header-foreground: var(--wp--preset--color--contrast, #111111);
    --header-start-shadow: none;
    --header-scrolled-shadow: 0 10px 30px rgb(0 0 0 / 0.12);

    box-sizing: border-box;
    inline-size: 100%;
    min-inline-size: 0;
    color: var(--header-foreground) !important;
    background-color: var(--header-start-surface) !important;
    background-image: none !important;
    box-shadow: var(--header-start-shadow);
    transition-property: background-color, box-shadow;
    transition-duration: var(--header-state-duration);
    transition-timing-function: var(--header-state-ease);
}

.site-header-shell .header-behavior-overlay {
    /* Darken the image beneath light header text. */
    --header-start-surface: var(--header-overlay-scrim);
    --header-scrolled-solid: var(--wp--preset--color--contrast, #111111);
    --header-foreground: var(--wp--preset--color--base, #ffffff);

    padding-left: var(--wp--style--root--padding-left, var(--wp--preset--spacing--md));
    padding-right: var(--wp--style--root--padding-right, var(--wp--preset--spacing--md));
}

/* Header background colors. */
.site-header-shell .header-start-transparent { --header-start-surface: var(--header-overlay-scrim); }

/* Transparent header background before scrolling. */
html.header-state-js
    .site-header-shell
    .header-behavior-overlay.header-top-transparent {
    --header-start-surface: transparent;

    /* The fixed header can move over a different section between frames.
     * Snap the protective solid paint on/off so a timed transparent-to-solid
     * interpolation never exposes that changing underlay; the shadow remains
     * the smooth visual cue for motion-enabled themes. */
    transition-property: box-shadow;
}
.site-header-shell .header-start-base { --header-start-solid: var(--wp--preset--color--base, #ffffff); }
.site-header-shell .header-start-contrast { --header-start-solid: var(--wp--preset--color--contrast, #111111); }
.site-header-shell .header-start-primary { --header-start-solid: var(--wp--preset--color--primary, #333333); }
.site-header-shell .header-start-secondary { --header-start-solid: var(--wp--preset--color--secondary, #eeeeee); }
.site-header-shell .header-start-accent { --header-start-solid: var(--wp--preset--color--accent, #555555); }

.site-header-shell .header-scrolled-base { --header-scrolled-solid: var(--wp--preset--color--base, #ffffff); }
.site-header-shell .header-scrolled-contrast { --header-scrolled-solid: var(--wp--preset--color--contrast, #111111); }
.site-header-shell .header-scrolled-primary { --header-scrolled-solid: var(--wp--preset--color--primary, #333333); }
.site-header-shell .header-scrolled-secondary { --header-scrolled-solid: var(--wp--preset--color--secondary, #eeeeee); }
.site-header-shell .header-scrolled-accent { --header-scrolled-solid: var(--wp--preset--color--accent, #555555); }

.site-header-shell .header-foreground-base { --header-foreground: var(--wp--preset--color--base, #ffffff); }
.site-header-shell .header-foreground-contrast { --header-foreground: var(--wp--preset--color--contrast, #111111); }
.site-header-shell .header-foreground-primary { --header-foreground: var(--wp--preset--color--primary, #333333); }
.site-header-shell .header-foreground-secondary { --header-foreground: var(--wp--preset--color--secondary, #eeeeee); }
.site-header-shell .header-foreground-accent { --header-foreground: var(--wp--preset--color--accent, #555555); }

/* Keep the shared readable foreground on navigation chrome in both states. */
.site-header-shell
    :is(.header-behavior-sticky-soft, .header-behavior-overlay)
    :where(
        .wp-block-site-title,
        .wp-block-site-title a,
        .wp-block-site-tagline,
        .wp-block-navigation,
        .wp-block-navigation-item__content,
        .wp-block-navigation__responsive-container-open,
        .wp-block-navigation__responsive-container-close
    ) {
    /* Allow a navigation block's own text color to override this default. */
  color: var(--header-foreground);
}

/* Core gives unstyled desktop submenus a white panel. Give every nested menu
 * the same verified opaque pair as the mobile modal instead. */
.site-header-shell
    :is(.header-behavior-sticky-soft, .header-behavior-overlay)
    .wp-block-navigation__submenu-container {
    color: var(--header-foreground) !important;
    background-color: var(--header-scrolled-solid) !important;
}

/* Driver-scrolled pages use the treatment-aware scrolled surface; explicitly
 * forced pages take the opaque token directly — force-solid means solid. */
html.header-is-scrolled
    .site-header-shell
    :is(.header-behavior-sticky-soft, .header-behavior-overlay) {
    background-color: var(--header-scrolled-surface) !important;
    box-shadow: var(--header-scrolled-shadow);
}

.site-header-shell--force-solid
    :is(.header-behavior-sticky-soft, .header-behavior-overlay) {
    background-color: var(--header-scrolled-solid) !important;
    box-shadow: var(--header-scrolled-shadow);
}

/* Optional transparent and glass header surfaces. */
html.header-state-js
    .site-header-shell
    .header-behavior-sticky-soft.header-top-transparent {
    --header-start-surface: transparent;
}

/* Use an opaque fallback when glass effects are unsupported. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px)))
    and (background-color: color-mix(in srgb, red 80%, transparent)) {
    html.header-state-js
        .site-header-shell
        .header-behavior-sticky-soft.header-top-glass {
        --header-start-surface: color-mix(in srgb, var(--header-start-solid) 80%, transparent);
    }

    html.header-state-js
        .site-header-shell
        .header-behavior-sticky-soft.header-scrolled-glass {
        --header-scrolled-surface: color-mix(in srgb, var(--header-scrolled-solid) 80%, transparent);
    }

    /* Blur behind glass states via the same non-ancestor pseudo-element
     * pattern the overlay uses, so the filter cannot turn the fixed
     * responsive-nav modal into a header-relative containing block. */
    html.header-state-js
        .site-header-shell
        .header-behavior-sticky-soft:is(.header-top-glass, .header-scrolled-glass) {
        position: relative;
    }

    html.header-state-js
        .site-header-shell
        .header-behavior-sticky-soft:is(.header-top-glass, .header-scrolled-glass)::before {
        position: absolute;
        z-index: 0;
        inset: 0;
        content: "";
        pointer-events: none;
        -webkit-backdrop-filter: blur(14px) saturate(115%);
        backdrop-filter: blur(14px) saturate(115%);
    }

    html.header-state-js
        .site-header-shell
        .header-behavior-sticky-soft:is(.header-top-glass, .header-scrolled-glass) > * {
        position: relative;
        z-index: 1;
    }

    /* Disable blur beneath an opaque background. */
    html.header-state-js.header-is-scrolled
        .site-header-shell
        .header-behavior-sticky-soft:not(.header-scrolled-glass)::before {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* Users who ask for less transparency get the verified opaque pair; these
 * override the treatment rules above by cascade order at equal specificity. */
@media (prefers-reduced-transparency: reduce) {
    html.header-state-js
        .site-header-shell
        .header-behavior-sticky-soft:is(.header-top-transparent, .header-top-glass) {
        --header-start-surface: var(--header-start-solid);
    }

    /* The clear overlay start returns to the verified scrim veil. */
    html.header-state-js
        .site-header-shell
        .header-behavior-overlay.header-top-transparent {
        --header-start-surface: var(--header-overlay-scrim);
    }

    html.header-state-js
        .site-header-shell
        .header-behavior-sticky-soft.header-scrolled-glass {
        --header-scrolled-surface: var(--header-scrolled-solid);
    }

    html.header-state-js
        .site-header-shell
        .header-behavior-sticky-soft:is(.header-top-glass, .header-scrolled-glass)::before {
        content: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* Rounded header row within a transparent outer rail. */
.site-header-shell .header-archetype--floating-pill,
html.header-is-scrolled .site-header-shell .header-archetype--floating-pill,
.site-header-shell--force-solid .header-archetype--floating-pill {
    background-color: transparent !important;
    box-shadow: none;
}

/* Apply the overlay background to the rounded row. */
.site-header-shell .header-archetype--floating-pill.header-behavior-overlay .header-pill,
html.header-state-js
    .site-header-shell
    .header-archetype--floating-pill.header-behavior-overlay.header-top-transparent
    .header-pill {
    --header-pill-surface: var(--header-start-surface, var(--header-overlay-scrim));
}
html.header-state-js
    .site-header-shell
    .header-archetype--floating-pill.header-behavior-overlay.header-top-transparent {
    --header-start-surface: var(--header-overlay-scrim);
}
html.header-is-scrolled .site-header-shell .header-archetype--floating-pill.header-behavior-overlay .header-pill {
    --header-pill-surface: var(--header-scrolled-surface, var(--header-scrolled-solid));
}

html.header-state-js .site-header-shell
    .header-archetype--floating-pill.header-behavior-sticky-soft.header-top-transparent {
    --header-start-surface: var(--header-start-solid);
}

/* A static root has no behavior variables; read the token off its core class. */
.site-header-shell .header-archetype--floating-pill.has-base-background-color { --header-pill-solid: var(--wp--preset--color--base, #ffffff); }
.site-header-shell .header-archetype--floating-pill.has-contrast-background-color { --header-pill-solid: var(--wp--preset--color--contrast, #111111); }
.site-header-shell .header-archetype--floating-pill.has-primary-background-color { --header-pill-solid: var(--wp--preset--color--primary, #333333); }
.site-header-shell .header-archetype--floating-pill.has-secondary-background-color { --header-pill-solid: var(--wp--preset--color--secondary, #eeeeee); }
.site-header-shell .header-archetype--floating-pill.has-accent-background-color { --header-pill-solid: var(--wp--preset--color--accent, #555555); }

.site-header-shell .header-archetype--floating-pill .header-pill {
    --header-pill-surface: var(--header-start-surface, var(--header-pill-solid, var(--wp--preset--color--base, #ffffff)));
    --header-pill-shadow: 0 6px 24px rgb(0 0 0 / 0.08);

    position: relative;
    box-sizing: border-box;
    inline-size: fit-content;
    max-inline-size: 100%;
    min-inline-size: 0;
    margin-inline: auto;
    padding-block: 0.375rem;
    padding-inline: 1.25rem 0.5rem;
    border: 1px solid color-mix(in srgb, var(--header-foreground, currentColor) 12%, transparent);
    border-radius: 999px;
    background-color: var(--header-pill-surface);
    box-shadow: var(--header-pill-shadow);
    transition-property: background-color, box-shadow;
    transition-duration: var(--header-state-duration);
    transition-timing-function: var(--header-state-ease);
}

html.header-is-scrolled .site-header-shell .header-archetype--floating-pill .header-pill {
    --header-pill-surface: var(--header-scrolled-surface, var(--header-pill-solid, var(--wp--preset--color--base, #ffffff)));
    --header-pill-shadow: 0 10px 30px rgb(0 0 0 / 0.12);
}

.site-header-shell--force-solid .header-archetype--floating-pill .header-pill {
    --header-pill-surface: var(--header-scrolled-solid, var(--header-pill-solid, var(--wp--preset--color--base, #ffffff))) !important;
}

/* The wordmark yields before the row wraps; the nav collapses on its own. */
.site-header-shell .header-archetype--floating-pill .header-pill .wp-block-site-title {
    min-inline-size: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Inside a pill every boxed control is a pill too. */
.site-header-shell .header-archetype--floating-pill .header-pill .wp-block-button__link,
.site-header-shell .header-archetype--floating-pill .header-pill .wp-block-navigation-item__content {
    border-radius: 999px;
}

.site-header-shell .header-archetype--floating-pill .header-pill .wp-block-navigation-item__content {
    padding: 0.35em 0.75em;
}

/* Mark the current section with an outline. Keep the surface unchanged
 * because a tint can reduce the verified text contrast. */
.site-header-shell .header-archetype--floating-pill .header-pill .wp-block-navigation-item.is-current-section > .wp-block-navigation-item__content,
.site-header-shell .header-archetype--bar-center-cta .header-bar-center .wp-block-navigation-item.is-current-section > .wp-block-navigation-item__content {
    box-shadow: inset 0 0 0 1px currentColor;
    border-radius: 999px;
    transition: box-shadow var(--header-state-duration) var(--header-state-ease);
}
.site-header-shell .header-archetype--bar-center-cta .header-bar-center .wp-block-navigation-item.is-current-section > .wp-block-navigation-item__content {
    padding: 0.35em 0.75em;
    margin: -0.35em -0.75em;
}

/* Below the hamburger breakpoint the pill spans the rail so a long wordmark,
 * the CTA and the menu button all fit. */
@media (max-width: 600px) {
    .site-header-shell .header-archetype--floating-pill .header-pill {
        inline-size: 100%;
        padding-inline: 1rem 0.5rem;
        /* Keep the title, action, and menu button on one row on small screens. */
        gap: var(--wp--preset--spacing--sm, 0.75rem);
    }

    .site-header-shell .header-archetype--floating-pill .header-pill > .wp-block-site-title {
        flex: 1 1 auto;
    }

    .site-header-shell .header-archetype--floating-pill .header-pill > .wp-block-navigation,
    .site-header-shell .header-archetype--floating-pill .header-pill > .wp-block-buttons {
        flex: 0 0 auto;
    }

    .site-header-shell .header-archetype--floating-pill .header-pill .wp-block-button__link {
        white-space: nowrap;
        font-size: var(--wp--preset--font-size--caption, 0.875rem);
        padding: 0.6em 1em;
    }
}

/* Center navigation independently of the title and action widths. */
.site-header-shell .header-archetype--bar-center-cta .header-bar-center {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--wp--preset--spacing--md, 1.5rem);
}

.site-header-shell .header-archetype--bar-center-cta .header-bar-center > .wp-block-site-title,
.site-header-shell .header-archetype--bar-center-cta .header-bar-center > .wp-block-site-logo {
    justify-self: start;
    min-inline-size: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.site-header-shell .header-archetype--bar-center-cta .header-bar-center > :is(.wp-block-navigation, .wp-block-group:has(.wp-block-navigation)) {
    justify-self: center;
}

.site-header-shell .header-archetype--bar-center-cta .header-bar-center > .wp-block-buttons {
    justify-self: end;
}

/* Rounded header action. */
.site-header-shell .header-archetype--bar-center-cta .header-bar-center .wp-block-button__link {
    border-radius: 999px;
}

/* Below the hamburger breakpoint the centered column is the menu button;
 * it moves next to the CTA so the wordmark keeps the start edge. */
@media (max-width: 782px) {
    .site-header-shell .header-archetype--bar-center-cta .header-bar-center {
        grid-template-columns: minmax(0, 1fr) auto auto;
        column-gap: var(--wp--preset--spacing--sm, 0.75rem);
    }

    .site-header-shell .header-archetype--bar-center-cta .header-bar-center > :is(.wp-block-navigation, .wp-block-group:has(.wp-block-navigation)) {
        justify-self: end;
    }
}

/* Spread navigation across the space after the site title. */
.site-header-shell .header-archetype--spread-nav .header-spread {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--wp--preset--spacing--lg, 3rem);
}

/* Keep full-width rows within the page gutters. */
.site-header-shell .header-archetype--spread-nav .header-spread.alignfull {
    padding-inline: var(--wp--style--root--padding-left, 1.25rem) var(--wp--style--root--padding-right, 1.25rem);
}

.site-header-shell .header-archetype--spread-nav .header-spread > .wp-block-site-title,
.site-header-shell .header-archetype--spread-nav .header-spread > .wp-block-site-logo {
    justify-self: start;
    min-inline-size: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.site-header-shell .header-archetype--spread-nav .header-spread > :is(.wp-block-navigation, .wp-block-group:has(.wp-block-navigation)) {
    justify-self: stretch;
    min-inline-size: 0;
}

.site-header-shell .header-archetype--spread-nav .header-spread .wp-block-navigation .wp-block-navigation__container {
    inline-size: 100%;
    justify-content: space-between;
}

/* The spread bar uses the same outline as the pill. */
.site-header-shell .header-archetype--spread-nav .header-spread .wp-block-navigation-item.is-current-section > .wp-block-navigation-item__content {
    box-shadow: inset 0 0 0 1px currentColor;
    border-radius: 999px;
    padding: 0.35em 0.75em;
    margin: -0.35em -0.75em;
}

@media (max-width: 782px) {
    .site-header-shell .header-archetype--spread-nav .header-spread {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: var(--wp--preset--spacing--sm, 0.75rem);
    }

    .site-header-shell .header-archetype--spread-nav .header-spread > :is(.wp-block-navigation, .wp-block-group:has(.wp-block-navigation)) {
        justify-self: end;
    }
}

/* Glass blurs behind the pill, not behind the transparent rail. The
 * pseudo-element pattern is the same as the root's: never an ancestor of
 * the navigation, so a fixed responsive menu keeps the viewport as its
 * containing block. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px)))
    and (background-color: color-mix(in srgb, red 80%, transparent)) {
    html.header-state-js
        .site-header-shell
        .header-archetype--floating-pill:is(.header-top-glass, .header-scrolled-glass)::before {
        content: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    html.header-state-js
        .site-header-shell
        .header-archetype--floating-pill:is(.header-top-glass, .header-scrolled-glass)
        .header-pill::before {
        position: absolute;
        z-index: 0;
        inset: 0;
        content: "";
        border-radius: inherit;
        pointer-events: none;
        -webkit-backdrop-filter: blur(14px) saturate(115%);
        backdrop-filter: blur(14px) saturate(115%);
    }

    html.header-state-js
        .site-header-shell
        .header-archetype--floating-pill:is(.header-top-glass, .header-scrolled-glass)
        .header-pill > * {
        position: relative;
        z-index: 1;
    }

    html.header-state-js.header-is-scrolled
        .site-header-shell
        .header-archetype--floating-pill:not(.header-scrolled-glass)
        .header-pill::before {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* Blur behind the rounded row until its background becomes opaque. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .site-header-shell .header-archetype--floating-pill.header-behavior-overlay::before {
        content: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .site-header-shell .header-archetype--floating-pill.header-behavior-overlay .header-pill::before {
        position: absolute;
        z-index: 0;
        inset: 0;
        content: "";
        border-radius: inherit;
        pointer-events: none;
        -webkit-backdrop-filter: blur(14px) saturate(115%);
        backdrop-filter: blur(14px) saturate(115%);
    }

    .site-header-shell .header-archetype--floating-pill.header-behavior-overlay .header-pill > * {
        position: relative;
        z-index: 1;
    }

    html.header-is-scrolled
        .site-header-shell
        .header-archetype--floating-pill.header-behavior-overlay
        .header-pill::before,
    .site-header-shell--force-solid
        .header-archetype--floating-pill.header-behavior-overlay
        .header-pill::before {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

@media (prefers-reduced-transparency: reduce) {
    html.header-state-js
        .site-header-shell
        .header-archetype--floating-pill:is(.header-top-glass, .header-scrolled-glass)
        .header-pill::before,
    .site-header-shell .header-archetype--floating-pill.header-behavior-overlay .header-pill::before {
        content: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* A forced solid surface needs no blur in either state. */
.site-header-shell.site-header-shell--force-solid .header-archetype--floating-pill .header-pill::before {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .site-header-shell .header-archetype--floating-pill .header-pill {
        transition-duration: 0s !important;
    }
}

/* Progressive glass enhancement for image-led opening compositions. The
 * pseudo-element is not an ancestor of the navigation, so its filter cannot
 * turn a fixed responsive menu into a header-relative containing block. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .site-header-shell .header-behavior-overlay {
        position: relative;
    }

    .site-header-shell .header-behavior-overlay::before {
        position: absolute;
        z-index: 0;
        inset: 0;
        content: "";
        pointer-events: none;
        -webkit-backdrop-filter: blur(14px) saturate(115%);
        backdrop-filter: blur(14px) saturate(115%);
    }

    .site-header-shell .header-behavior-overlay > * {
        position: relative;
        z-index: 1;
    }

    html.header-is-scrolled
        .site-header-shell
        .header-behavior-overlay::before,
    .site-header-shell--force-solid .header-behavior-overlay::before {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    /* A clear resting state must actually be clear: no frosted blur band
     * over the hero while the surface is transparent. */
    html.header-state-js
        .site-header-shell
        .header-behavior-overlay.header-top-transparent::before {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* A WordPress responsive-nav modal must never expose content behind its text.
 * It also must not inherit the desktop row justification (nav-at-end headers
 * otherwise glue labels to the viewport edge and clip them). */
.site-header-shell
    :is(.header-behavior-sticky-soft, .header-behavior-overlay)
    .wp-block-navigation__responsive-container.is-menu-open {
    --navigation-layout-justification-setting: flex-start;
    --navigation-layout-justify: flex-start;
    color: var(--header-foreground) !important;
    background-color: var(--header-scrolled-solid) !important;
    background-image: none !important;

    /* Match the navigation panel to the header colors. */
    --menu-panel-ink: var(--header-foreground);
    --menu-panel-surface: var(--header-scrolled-solid);
}

.site-header-shell
    :is(.header-behavior-sticky-soft, .header-behavior-overlay)
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__responsive-container-content,
.site-header-shell
    :is(.header-behavior-sticky-soft, .header-behavior-overlay)
    .wp-block-navigation__responsive-container.is-menu-open
    :is(.wp-block-navigation__container, .wp-block-page-list) {
    align-items: stretch !important;
    justify-content: flex-start !important;
    text-align: start !important;
}

/* Measured by header.js, including restored-scroll and responsive layouts.
 * Only chrome that survives the scroll can cover an anchor target, so the
 * driver marks that case and a transient overlay keeps the native offset. */
html.header-state-js.header-chrome-persistent {
    scroll-padding-top: calc(
        var(--site-header-height, 0px)
        + var(--site-admin-bar-offset, 0px)
    );
}

.site-header-shell .header-transition-instant {
    transition-duration: 0s !important;
}

@media (prefers-reduced-motion: reduce) {
    .site-header-shell
        :is(.header-behavior-sticky-soft, .header-behavior-overlay),
    .site-header-shell
        :is(.header-behavior-sticky-soft, .header-behavior-overlay) * {
        transition-duration: 0s !important;
    }
}

@media print {
    /* A printed header takes its own space, so nothing overlaps the opening
     * and the reserved zone would only be a blank strip on the page. Zeroing
     * the whole clearance, not just its floor: the driver's measured height
     * outlives the media switch and would otherwise still be reserved. Same
     * selector as the rule it overrides, so cascade order decides. */
    :is(.site-header-shell--overlay-to-solid, .site-header-shell--overlay-transient)
        + .wp-block-post-content
        .header-overlay-clearance {
        --header-clearance: 0px;
    }

    html.header-state-js,
    html.header-state-js.header-chrome-persistent {
        scroll-padding-top: 0;
    }

    .site-header-shell,
    html.header-state-js .site-header-shell--overlay-to-solid {
        position: static !important;
        inset: auto !important;
        inline-size: auto;
        box-shadow: none !important;
    }

    .site-header-shell
        :is(.header-behavior-sticky-soft, .header-behavior-overlay),
    html.header-is-scrolled
        .site-header-shell
        :is(.header-behavior-sticky-soft, .header-behavior-overlay),
    .site-header-shell--force-solid
        :is(.header-behavior-sticky-soft, .header-behavior-overlay) {
        color: #000000 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        transition: none !important;
    }

    .site-header-shell
        :is(.header-behavior-sticky-soft, .header-behavior-overlay)
        :where(
            .wp-block-site-title,
            .wp-block-site-title a,
            .wp-block-site-tagline,
            .wp-block-navigation,
            .wp-block-navigation-item__content
    ) {
        color: #000000 !important;
    }

    .site-header-shell
        :is(.header-behavior-sticky-soft, .header-behavior-overlay)
        .wp-block-navigation__responsive-container.is-menu-open {
        position: static !important;
        inset: auto !important;
        color: #000000 !important;
        background: #ffffff !important;
    }

    .site-header-shell
        :is(
            .wp-block-navigation__responsive-container-open,
            .wp-block-navigation__responsive-container-close
        ) {
        display: none !important;
    }

    .site-header-shell
        :is(.header-behavior-overlay, .header-behavior-sticky-soft)::before {
        content: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    .site-header-shell .header-archetype--floating-pill .header-pill {
        border: 0;
        background: #ffffff !important;
        box-shadow: none !important;
    }

    .site-header-shell .header-archetype--floating-pill .header-pill::before {
        content: none !important;
    }
}

/* Keep the open navigation above other controls in the pill. */
.site-header-shell .header-archetype--floating-pill .header-pill > :has(.wp-block-navigation__responsive-container.is-menu-open) {
    z-index: 2;
}

@media (max-width: 782px) {
    .site-header-shell :is(.header-archetype--bar-center-cta, .header-archetype--spread-nav)
        .wp-block-navigation__responsive-container:not(.is-menu-open) {
        display: none;
    }
    .site-header-shell :is(.header-archetype--bar-center-cta, .header-archetype--spread-nav)
        .wp-block-navigation__responsive-container-open {
        display: flex;
    }
}
