.ssb-hero {

    /*
     * The eyebrow follows the hero rather than taking the shared accent
     * color. It sits over a photograph, where the brand's primary is
     * whatever the picture underneath happens to leave of it.
     */
    --color-eyebrow: currentColor;

    /*
     * One token for every piece of text in the hero. The white-overlay
     * variant below re-points it rather than restating each rule.
     */
    --ssb-hero-fg: var(--color-light, #fff);
    --ssb-hero-link: var(--color-light, #fff);

    /*
     * What sits on top of --ssb-hero-fg: the outline button's label once
     * it fills in on hover. It cannot be the hero's background, because
     * on an image hero there is no one background color to name, and a
     * label the color of a photograph is no label at all.
     *
     * It moves with --ssb-hero-fg, every time, in all four places that
     * set it. They are a pair: one is the text and the other is what goes
     * on the text, and setting one without the other is how you get an
     * invisible word on a solid fill.
     */
    --ssb-hero-inverse: var(--color-text, #111);

    position: relative;

    padding: 2rem 0;
    color: var(--ssb-hero-fg);
    display: flex;
    align-items: center;
    background: #000;
    background-size: cover;

    /*
     * The focal point set on the image in the Media Library, when it has
     * one. The fallback is the hero's long-standing right-hand crop,
     * which is what every picture that was never given a focal point
     * goes on getting — the render only writes the property when there
     * is a real one to write, so nothing already on a site moves.
     */
    background-position: var(--ssb-hero-focal, 100% 50%);
}


/* Text color
   --------------------------------------------------------------------------
   Named on each element rather than left to inherit from .ssb-hero.

   Inheritance is the weakest thing in CSS: a rule that matches the heading
   itself beats an inherited color whatever its specificity, and the block
   editor puts several such rules into the canvas. On the front end nothing
   matches, so the heading inherits the white and all is well; in the editor
   one of those rules lands on the h1 and the title goes black.

   Two classes here, which clears an editor rule of the
   `.editor-styles-wrapper h1` shape. ssb-cta already does the same thing
   with `color: inherit` — this is that idea with the variants folded in.
   ========================================================================== */

.ssb-hero .ssb-hero__title,
.ssb-hero .ssb-hero__eyebrow,
.ssb-hero .ssb-hero__subtitle,
.ssb-hero .ssb-hero__breadcrumbs {
    color: var(--ssb-hero-fg);
}

.ssb-hero .ssb-hero__breadcrumbs a,
.ssb-hero .ssb-hero__subtitle a {
    color: var(--ssb-hero-link);
}

/*
 * The editor injects its heading rules inside .editor-styles-wrapper, which
 * lifts them a step above anything written for the front end. This is the
 * same declaration one step higher, so the preview matches the page.
 */
.editor-styles-wrapper .ssb-hero .ssb-hero__title,
.editor-styles-wrapper .ssb-hero .ssb-hero__eyebrow,
.editor-styles-wrapper .ssb-hero .ssb-hero__subtitle,
.editor-styles-wrapper .ssb-hero .ssb-hero__breadcrumbs {
    color: var(--ssb-hero-fg);
}
.ssb-hero--xsmall {
    min-height: 150px;
}
.ssb-hero--small {
    min-height: 225px;
}

.ssb-hero--medium {
    min-height: 450px;
}

.ssb-hero--large {
    min-height: 600px;
}

/*
 * min() rather than a flat 800px, so it caps itself instead of needing a
 * media query. 800px is taller than a phone is, and a hero that does not
 * fit on the screen it is the first thing on is a hero nobody scrolls
 * past. On a desktop the 800 wins; on a phone the 92vh does.
 */
.ssb-hero--xlarge {
    min-height: min(800px, 92vh);
}

.ssb-hero--center {
    text-align: center;
}


/* Vertical alignment
   --------------------------------------------------------------------------
   .ssb-hero is the flex container and the .container inside it is the one
   item that is laid out — the overlay is positioned out of the flow — so
   align-items is what moves the text up and down.

   There is only something to see here when the hero is taller than its
   text. The 2rem of padding on .ssb-hero is what keeps Top and Bottom off
   the edge.

   Center is written out rather than left to the base rule above. It is
   the same declaration, but a variant with no rule of its own is a class
   a child theme cannot hang anything on, and the next person reading the
   render wonders which of the three was forgotten.
   ========================================================================== */

.ssb-hero--valign-top {
    align-items: flex-start;
}

.ssb-hero--valign-center {
    align-items: center;
}

.ssb-hero--valign-bottom {
    align-items: flex-end;
}

.ssb-hero__content {
    max-width: 900px;
}

.ssb-hero--narrow .ssb-hero__content {
    max-width: 700px;
}

/*
 * The trail is an eyebrow, so .eyebrow carries its type and this
 * carries nothing but the gap beneath it.
 *
 * The font-size that used to live here is gone rather than left to
 * agree with the eyebrow's. It was the same 0.875rem, and the same
 * one class — but this stylesheet is enqueued when the block renders,
 * in the body, so it printed after design-system.css and won. Any
 * later change to --font-size-eyebrow would have moved every eyebrow
 * on the site except this one, silently.
 *
 * The colors stay where they are: .eyebrow is one class and the
 * hero's own `.ssb-hero .ssb-hero__breadcrumbs` is two, so the trail
 * keeps taking the foreground color that works over the image
 * instead of the eyebrow's brand color.
 */
.ssb-hero__breadcrumbs {
    margin-bottom: 1rem;
}

/*
 * Links keep their underline. Everything in the trail is now the same
 * size, weight and case, so with the underline gone the only thing
 * separating a link from the current page would be its color.
 */
/* Editor-only, printed by render.php while $is_preview is set. */
.ssb-hero__breadcrumbs-notice {
    margin: 0 0 1rem;
    padding: .5rem .75rem;
    border: 1px dashed currentColor;
    font-size: .8125rem;
}

.ssb-hero__breadcrumbs a {
    text-decoration: underline;
}

.ssb-hero__eyebrow {
    margin-bottom: 1rem;
}



.ssb-hero__subtitle {
    max-width: 800px;
    font-size: 1.125rem;
    line-height: 1.6;
}


/* Button
   --------------------------------------------------------------------------
   Optional, drawn only when a link is set.

   Solid is the brand button, untouched. Outline follows the hero's own
   foreground the way the breadcrumb and the subtitle do — .btn--outline
   is white wherever else it is used, which is invisible the moment a hero
   is pale, and a white overlay or a light flat background makes that a
   setting an editor can reach in two clicks.
   ========================================================================== */

.ssb-hero__actions {
    margin-top: var(--space-lg, 2rem);
}

.ssb-hero .btn--outline {
    color: var(--ssb-hero-fg);
    border-color: currentColor;
}

.ssb-hero .btn--outline:hover,
.ssb-hero .btn--outline:focus-visible {
    background: var(--ssb-hero-fg);
    color: var(--ssb-hero-inverse);
}

/* ==========================================================================
   Overlay

   A wash of color between the background image and the text, so the words
   stay readable over a busy photograph.
   ========================================================================== */

.ssb-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: var(--ssb-hero-overlay-opacity, .5);
    pointer-events: none;
}

/*
 * The content has to sit above the wash. .ssb-hero is already
 * position: relative, so a stacking context exists for both.
 */
.ssb-hero--has-overlay > .container {
    position: relative;
    z-index: 1;
}

/*
 * Each overlay sets its wash and the type that goes on it, together.
 *
 * Anything the client can pick has to come out legible without them
 * having to think about it, and what reads on a wash depends entirely on
 * the wash — so every variant below names its --color-on-* partner rather
 * than leaving the hero's white default in place and hoping.
 *
 * That is what lets Secondary be offered at all. It is a different color
 * on every site, and white on a gold secondary is 2.82:1 — which is why
 * the CTA Banner dropped Secondary rather than ship it. Asking for the
 * paired color gives 5.72:1 on a teal secondary and 5.77:1 on the gold,
 * with neither named here.
 *
 * --ssb-hero-inverse goes with --ssb-hero-fg every time. They are a pair:
 * one is the text, the other is what sits on the text, and setting one
 * without the other is how you get an invisible word on a solid fill.
 */

.ssb-hero--overlay-primary .ssb-hero__overlay {
    background-color: var(--color-primary);
}

.ssb-hero--overlay-primary {
    --ssb-hero-fg: var(--color-on-primary, var(--color-light, #fff));
    --ssb-hero-link: var(--color-on-primary, var(--color-light, #fff));
    --ssb-hero-inverse: var(--color-primary);
}

.ssb-hero--overlay-secondary .ssb-hero__overlay {
    background-color: var(--color-secondary);
}

.ssb-hero--overlay-secondary {
    --ssb-hero-fg: var(--color-on-secondary, var(--color-light, #fff));
    --ssb-hero-link: var(--color-on-secondary, var(--color-light, #fff));
    --ssb-hero-inverse: var(--color-secondary);
}

.ssb-hero--overlay-black .ssb-hero__overlay {
    background-color: var(--color-dark);
}

.ssb-hero--overlay-black {
    --ssb-hero-fg: var(--color-on-dark, var(--color-light, #fff));
    --ssb-hero-link: var(--color-on-dark, var(--color-light, #fff));
    --ssb-hero-inverse: var(--color-dark);
}

.ssb-hero--overlay-white .ssb-hero__overlay {
    background-color: var(--color-light);
}

/*
 * White text on a pale wash is unreadable, so a white overlay flips the
 * hero to charcoal type. The link stays the brand color, which is the one
 * place a link is better off not matching the body text around it.
 */
.ssb-hero--overlay-white {
    --ssb-hero-fg: var(--color-text);
    --ssb-hero-link: var(--color-primary);
    --ssb-hero-inverse: var(--color-light, #fff);
}


/* Flat color backgrounds
   --------------------------------------------------------------------------
   render.php measures the color the client picked and says which way the
   text should go, so any color reads correctly rather than only the ones
   somebody thought to list. A photograph gets no class — there is no one
   color to measure — and stays light, which is what it always was.
   ========================================================================== */

.ssb-hero--bg-light {
    --ssb-hero-fg: var(--color-text);
    --ssb-hero-link: var(--color-primary);
    --ssb-hero-inverse: var(--color-light, #fff);
}

.ssb-hero--bg-dark {
    --ssb-hero-fg: var(--color-light, #fff);
    --ssb-hero-link: var(--color-light, #fff);
    --ssb-hero-inverse: var(--color-text, #111);
}


/* Black and white
   --------------------------------------------------------------------------
   background-blend-mode rather than a filter.

   `filter: grayscale(1)` on the section would drain the text along with
   the photograph, and putting the image on a pseudo-element to filter it
   on its own would mean moving the inline background-image off the
   section, which every other option here depends on.

   Blending in luminosity mode takes the lightness of the top layer and the
   hue and saturation of the bottom one. The bottom layer is the hero's own
   background-color, which has no saturation to give, so what comes out is
   the photograph with its color removed — and nothing else on the element
   is touched. The overlay and the text are separate elements and carry on
   as they were.
   ========================================================================== */

.ssb-hero--grayscale {
    background-blend-mode: luminosity;
}


/* Surfaces
   --------------------------------------------------------------------------
   Background Color is one of the site's own surfaces rather than a hex an
   editor types. Every one of them is defined in the theme next to the text
   color that belongs on it, so the pairing is declared and there is nothing
   for this block to measure or to warn about.

   These come after .ssb-hero's own `background: #000`, which is what they
   have to beat — same one class, so it is source order doing it, and that
   is why they live here and not higher up the file.
   ========================================================================== */

.ssb-hero--surface-base {
    background: var(--color-surface, #fff);
    --ssb-hero-fg: var(--color-on-surface, var(--color-text));
    --ssb-hero-link: var(--color-primary);
    --ssb-hero-inverse: var(--color-surface, #fff);
}

.ssb-hero--surface-subtle {
    background: var(--color-surface-subtle, #f4f4f5);
    --ssb-hero-fg: var(--color-on-subtle, var(--color-text));
    --ssb-hero-link: var(--color-primary);
    --ssb-hero-inverse: var(--color-surface-subtle, #f4f4f5);
}

.ssb-hero--surface-primary {
    background: var(--color-primary);
    --ssb-hero-fg: var(--color-on-primary, #fff);
    --ssb-hero-link: var(--color-on-primary, #fff);
    --ssb-hero-inverse: var(--color-primary);
}

.ssb-hero--surface-secondary {
    background: var(--color-secondary);
    --ssb-hero-fg: var(--color-on-secondary, #fff);
    --ssb-hero-link: var(--color-on-secondary, #fff);
    --ssb-hero-inverse: var(--color-secondary);
}

.ssb-hero--surface-dark {
    background: var(--color-surface-dark, var(--color-dark));
    --ssb-hero-fg: var(--color-on-dark, #fff);
    --ssb-hero-link: var(--color-on-dark, #fff);
    --ssb-hero-inverse: var(--color-surface-dark, var(--color-dark));
}


/* Editor warning
   --------------------------------------------------------------------------
   Shown in the block preview only, when the chosen background color is a
   mid tone that no text color can be read against. Never reaches the
   front end: render.php prints it only while $is_preview is set.
   ========================================================================== */

.ssb-hero-contrast-warning {
    margin: 0 0 8px;
    padding: 10px 14px;
    background: #fdf3f4;
    border-left: 4px solid #b3202f;
    font-family: var(--font-body, sans-serif);
    font-size: 14px;
    line-height: 1.5;

    /* 8.6:1 on that pale pink. */
    color: #6b1019;
}