/**
 * SOAPBOX ENGAGE MODERN — BAND CONTENT LAYOUT
 * css/bands.css
 *
 * Phase 40. Multi-column layout for band content, authored as an ordinary
 * bulleted list.
 *
 * ── Why the hook is a class on each <li> ────────────────────────────────────
 * Quill discards every structural hook you would normally reach for: a class on
 * the <ul>, a class on the <li>, a wrapper <div>, a data- attribute — all four
 * are stripped from pasted content and on every DOM->Delta sync. What it does
 * preserve is anything registered as a *format*, which is why band-modules.js
 * registers a Parchment class attributor and the resulting class lands on each
 * list item rather than on the container.
 *
 * That turns out to be the better place for it anyway: the hook travels with
 * the content instead of living on the module wrapper, so these rules apply
 * identically in all three surfaces the same markup is seen in —
 *
 *   1. the front end       (module content inside .sbxMod-content)
 *   2. the Quill editor    (contenteditable div, no module wrapper)
 *   3. the JCE editor      (TinyMCE iframe, no module wrapper either)
 *
 * Nothing here may depend on an ancestor, because two of those three contexts
 * do not have one. That is the single constraint this file must respect.
 *
 * ── Consumers ───────────────────────────────────────────────────────────────
 *   index.php                    <link> after template.css
 *   includes/jce-css-sync.php    emits an @import into the generated jce.css
 *   com_sbxtemplates tokeneditor <link> so Quill matches what publishes
 *
 * Do NOT copy these rules into jce.css — that file is generated and would
 * overwrite them on the next Site Defaults save. Import, never duplicate.
 *
 * Token names differ between surfaces: template.css exposes --sbx-accent,
 * the generated jce.css exposes --sbx-primary. Every var() below carries a
 * fallback chain covering both plus a literal, so the file is self-sufficient
 * in a bare document.
 */

/* ── The grid container ─────────────────────────────────────────────────────
 * :has() reaches from the item up to the list, which is the only way to style
 * a container we are not allowed to put a class on. Supported everywhere the
 * admin runs; the @supports block further down covers anything older. */
/* Two selector forms, one file:
 *   li.sbxcols-N    front end and JCE — written into the content on save
 *   .sbxcols-N ul   the Quill editor, where the class sits on .ql-editor
 *                   because Quill will not carry a class on the content
 * Both resolve to the same grid, so the editor matches what publishes. */
ul:has(> li[class*="sbxcols-"]),
[class*="sbxcols-"] > ul {
    display:         grid;
    gap:             1.75rem 2rem;
    list-style:      none;
    margin:          1.5rem 0 0;
    padding:         0;
}

/* minmax(0, 1fr), not 1fr: the bare keyword is minmax(auto, 1fr), so a long
 * word in one card widens that track and the columns come out visibly uneven.
 * Observed at narrow editor widths before this was pinned. */
ul:has(> li.sbxcols-2), .sbxcols-2 > ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
ul:has(> li.sbxcols-3), .sbxcols-3 > ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
ul:has(> li.sbxcols-4), .sbxcols-4 > ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ── The card ───────────────────────────────────────────────────────────────
 * Three different bullet mechanisms are in play across the three surfaces, and
 * all three have to be switched off:
 *
 *   background-image  templates/system/css paints bullet-default.png behind
 *                     every li. This is the one that actually shows on the
 *                     front end — list-style and ::marker do nothing to it,
 *                     which makes it look like the reset failed when it did
 *                     not. See "System Stylesheet Conflicts" in the schema.
 *   ::before          how Quill draws bullets inside its editor.
 *   list-style        the ordinary mechanism, used by JCE's iframe.
 *
 * padding-left goes with the background bullet: the system rule reserves room
 * for the PNG, which would otherwise push every card off-center. */
li[class*="sbxcols-"],
[class*="sbxcols-"] > ul > li {
    margin:           0;
    padding:          0;
    list-style:       none;
    background-image: none;
    text-align:       center;
    min-width:        0;
    overflow-wrap:    anywhere;
}

li[class*="sbxcols-"]::before,
[class*="sbxcols-"] > ul > li::before  { content: none; }
li[class*="sbxcols-"]::marker,
[class*="sbxcols-"] > ul > li::marker  { content: none; }

/* ── The display number ─────────────────────────────────────────────────────
 * Scoped to the FIRST strong in the item on purpose. Bolding a word mid-label
 * is a reasonable thing for an admin to do and must not promote that word to
 * 3rem; only a lead-in gets the treatment. */
li[class*="sbxcols-"] > strong:first-child,
[class*="sbxcols-"] > ul > li > strong:first-child {
    display:        block;
    font-family:    var(--sbx-font-heading, inherit);
    font-size:      clamp(2rem, 4vw, 3rem);
    line-height:    1.05;
    font-weight:    800;
    letter-spacing: -0.02em;
    color:          var(--sbx-accent, var(--sbx-primary, #375692));
    margin-bottom:  0.35rem;
}

/* ── Optional icon or image above the number ────────────────────────────────
 * Quill's image blot is inline, so an <img> is legal inside a list item and
 * survives the round trip. Sized here so a full-resolution upload does not
 * blow the card apart. */
li[class*="sbxcols-"] > img,
[class*="sbxcols-"] > ul > li > img {
    display:    block;
    margin:     0 auto 0.6rem;
    height:     48px;
    width:      auto;
    max-width:  100%;
}

/* ── Responsive ─────────────────────────────────────────────────────────────
 * Four and three both fall to two before going single-column, so a 4-up strip
 * does not jump straight to a very long stack. */
@media (max-width: 900px) {
    ul:has(> li.sbxcols-3), .sbxcols-3 > ul,
    ul:has(> li.sbxcols-4), .sbxcols-4 > ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    ul:has(> li.sbxcols-2), .sbxcols-2 > ul,
    ul:has(> li.sbxcols-3), .sbxcols-3 > ul,
    ul:has(> li.sbxcols-4), .sbxcols-4 > ul { grid-template-columns: 1fr; }

    li[class*="sbxcols-"] > strong:first-child,
    [class*="sbxcols-"] > ul > li > strong:first-child { font-size: 2.25rem; }
}

/* ── Fallback where :has() is unavailable ───────────────────────────────────
 * The container cannot be selected at all, so columns come from the items
 * themselves. Equal heights are lost; legibility is not. */
@supports not selector(ul:has(> li)) {
    li[class*="sbxcols-"] {
        display:        inline-block;
        vertical-align: top;
        padding:        0 1rem;
    }
    li.sbxcols-2 { width: 48%; }
    li.sbxcols-3 { width: 31.5%; }
    li.sbxcols-4 { width: 23%; }

    @media (max-width: 600px) {
        li[class*="sbxcols-"] { display: block; width: auto; }
    }
}

/* ── Token text colour ───────────────────────────────────────────────────────
 * Written by the editor's colour picker as a CLASS, never a literal hex, so the
 * value resolves through the design tokens at render time and follows the brand
 * variant. Same three-surface reasoning as the column layout: the hook travels
 * in the content, so the front end, the Quill editor and JCE all resolve it
 * from this one file.
 *
 * "action" is --sbx-primary, the color the admin screens call the Action Color
 * and the only brand color an admin actually picks. It is deliberately NOT
 * --sbx-accent: that is a cool slate ADR 3.2 defines as internal chrome for
 * inactive pills and secondary borders, never exposed to an admin. This rule
 * resolved it until v11 and painted the customer's words in a color they had
 * never seen and could not change. */
.sbxink-action { color: var(--sbx-primary, #375692); }
.sbxink-muted  { color: var(--sbx-text-muted, #6b7280); }

/* Brand palette slots. These resolve to nothing until a site defines a palette,
 * and the fallback is deliberately `inherit` rather than the accent: if a site
 * removes palette color 2, content still carrying .sbxink-alt2 should quietly
 * become ordinary body text, not silently adopt a different brand color the
 * admin never chose there. Losing a color is diagnosable; gaining an unexpected
 * one is not.
 *
 * Never wired into the derived cascade — see token-renderer.php for why. */
.sbxink-alt1 { color: var(--sbx-palette-1, inherit); }
.sbxink-alt2 { color: var(--sbx-palette-2, inherit); }
.sbxink-alt3 { color: var(--sbx-palette-3, inherit); }

/* On an inverted surface the paired foreground wins: an accent tuned for light
 * grounds is not guaranteed to carry on a dark one, and the surface pairing is
 * what makes contrast predictable. */
.sbxsurf-dark  .sbxink-action,
.sbxsurf-image .sbxink-action { color: var(--sbx-text-on-primary, #fff); }
.sbxsurf-dark  .sbxink-muted,
.sbxsurf-image .sbxink-muted  { color: var(--sbx-text-on-dark, #d0d8ec); }

/* Palette slots yield on inverted surfaces for the same reason the accent does,
 * and more so: these are colors the customer picked, with no guarantee they
 * carry on a dark ground. The surface pairing is what makes contrast
 * predictable, so it wins. */
.sbxsurf-dark  .sbxink-alt1, .sbxsurf-image .sbxink-alt1,
.sbxsurf-dark  .sbxink-alt2, .sbxsurf-image .sbxink-alt2,
.sbxsurf-dark  .sbxink-alt3, .sbxsurf-image .sbxink-alt3 {
    color: var(--sbx-text-on-primary, #fff);
}

/* ── Text highlight (mark) ───────────────────────────────────────────────────
 * A colored bar behind inline text, drawn from the brand palette. Two live
 * references, and they are the same mechanism with different settings:
 *
 *   Easter Seals   <h1>Donate <span>Now</span></h1> — one word, static,
 *                  rounded, amber bar under dark text
 *   Humane League  whole lines, wiping in left to right, white on red
 *
 * The bar is a background-IMAGE whose size animates, not a background-color
 * that fades. That is what makes the swept variant wipe rather than appear,
 * and it costs nothing in the static case.
 *
 * WHY box-decoration-break: clone. Highlighted text wraps. Without it the
 * browser paints ONE box spanning the whole inline run, which on a wrap paints
 * across empty space at the end of the first line and starts the second already
 * covered. With clone, each line fragment gets its own bar sized to itself.
 * The Humane League implementation solves the same problem by splitting the
 * headline into per-line spans in JavaScript; clone gets there in one
 * declaration, and it also means our swept variant needs no script at all.
 *
 * The trade is that the fragments sweep together rather than in sequence. That
 * is a deliberate simplification: the sequential version needs JS to measure
 * line boxes, and re-measure on every resize and font swap.
 *
 * Padding and radius are em-relative on purpose. Their reference is 14px/10px
 * against a 46px heading; the same figures on 16px band copy would swallow the
 * text. Everything scales with whatever it is applied to.
 *
 * PAIRED FOREGROUND, NOT inherit. This is the one place palette colors sit
 * behind text, which is exactly what ADR 38.2 kept them out of everywhere else.
 * Each slot carries the foreground sbx_pick_foreground() already computed at
 * render — that is what the --sbx-palette-N-on tokens were emitted for. */

.sbxmark-action,
.sbxmark-alt1,
.sbxmark-alt2,
.sbxmark-alt3 {
    display:                     inline;
    -webkit-box-decoration-break: clone;
    box-decoration-break:         clone;
    padding:                     0.04em 0.28em 0.10em;
    border-radius:               0.18em;
    background-repeat:           no-repeat;
    background-position:         0 0;
    background-size:             100% 100%;
}

/* --sbx-primary, NOT --sbx-accent.
 *
 * The picker calls this "Action" because that is what the admin screens call
 * --sbx-primary: the Action Color, the one a customer actually chooses.
 * --sbx-accent is a cool slate that ADR 3.2 defines as explicitly NOT a brand
 * color — internal chrome for inactive pills and secondary borders, never
 * exposed to an admin. Highlighting a phrase in it would paint the customer's
 * words in a color they have never seen and cannot change.
 *
 * Caught by asking for "the orange brand color" and getting slate blue.
 *
 * The value is named `action`, not `accent`, precisely so it cannot be read as
 * a reference to --sbx-accent. Both sbxink and sbxmark used to store `accent`
 * and resolve different colors from it; renaming the value is what removed the
 * ambiguity, rather than repointing one of them and leaving the name. */
.sbxmark-action {
    background-image: linear-gradient(var(--sbx-primary, #375692),
                                      var(--sbx-primary, #375692));
    color:            var(--sbx-text-on-primary, #fff);
}
.sbxmark-alt1 {
    background-image: linear-gradient(var(--sbx-palette-1, #375692), var(--sbx-palette-1, #375692));
    color:            var(--sbx-palette-1-on, #fff);
}
.sbxmark-alt2 {
    background-image: linear-gradient(var(--sbx-palette-2, #375692), var(--sbx-palette-2, #375692));
    color:            var(--sbx-palette-2-on, #fff);
}
.sbxmark-alt3 {
    background-image: linear-gradient(var(--sbx-palette-3, #375692), var(--sbx-palette-3, #375692));
    color:            var(--sbx-palette-3-on, #fff);
}

/* ── The swept variant ───────────────────────────────────────────────────────
 * Opt-in per brand variant, gated by a class on <html> rather than by a class
 * on the mark: whether highlights animate is a decision about the brand, not
 * about one word. An admin who marks three phrases should not have to remember
 * to set them all the same way.
 *
 * WAITS FOR THE CURTAIN TO ACTUALLY END, rather than for a delay computed from
 * its duration. The delay version assumed both animations start their clocks at
 * the same instant. They do not: the mark starts when its element is styled
 * during body parsing, the curtain's pseudo-element starts when <html> first
 * paints. Measured on the lane, the sweep finished 540ms BEFORE the curtain even
 * began to fade — it swept, in full, underneath an opaque cover.
 *
 * So the gate is a state, not a guess. No curtain on this load, no wait. Curtain
 * present, wait for .sbx-curtain-done, which index.php sets on the curtain's own
 * animationend. */
/* ANIMATION IS DECIDED PER MARK, FULL STOP. THE VARIANT NO LONGER HAS A SAY.
 *
 * There were two mechanisms: html.sbx-mark-sweep from a template-wide setting,
 * and .sbxsweep-on/-off per phrase. The template-wide half is gone. Whether a
 * particular highlight sweeps is a decision about that phrase in that block --
 * a headline that sweeps above a standing pull-quote is the case this was
 * written for -- and a site-wide switch could only ever be a default that every
 * instance then argued with.
 *
 * So: a mark animates if and when it says so. Nothing else animates.
 *
 * The curtain gate still applies: no curtain, no wait; curtain present, wait
 * for .sbx-curtain-done, which index.php sets on the curtain's own animationend.
 */
html:not(.sbx-curtain) [class*="sbxmark-"].sbxsweep-on,
html.sbx-curtain-done   [class*="sbxmark-"].sbxsweep-on {
    animation: sbx-mark-sweep 620ms ease-out both;
}

/* .sbxsweep-off is no longer written by the admin -- with no variant default to
   argue with, "do not animate" is simply the absence of .sbxsweep-on. The rule
   stays for content saved while the setting existed, where it still means
   exactly what it said. */
[class*="sbxmark-"].sbxsweep-off {
    animation: none;
}

/* Held at zero width while a curtain is still up, so the bar cannot be seen
   already-drawn the instant the curtain clears. */
/* Held at zero width while a curtain is still up, so the bar cannot be seen
   already-drawn the instant the curtain clears. Only for marks that are actually
   going to animate — holding a static mark at zero width would hide it until the
   curtain lifted and then pop it in, which is the opposite of what off means. */
html.sbx-curtain:not(.sbx-curtain-done) [class*="sbxmark-"].sbxsweep-on {
    background-size: 0 100%;
}
@keyframes sbx-mark-sweep {
    from { background-size: 0    100%; }
    to   { background-size: 100% 100%; }
}

/* ── One mark held still while the rest sweep ────────────────────────────────
 * The variant sets the default; a single mark can opt out of it.
 *
 * I originally argued animation was purely a brand-level decision — that an
 * admin marking three phrases should not have to set them all the same way.
 * That holds for the common case and breaks for a real one: a page whose
 * headline sweeps in and whose standing pull-quote does not. Mixing the two on
 * one page is a composition, not an inconsistency, and the rigid version could
 * not express it at all.
 *
 * Specificity is written out per slot rather than leaning on an attribute
 * selector, so this rule reads as the deliberate override of the one above it. */
/* ── Sequencing: each line after the one before it ───────────────────────────
 * Marks in the same parent start in document order rather than together, so a
 * stacked headline reads as one continuous wipe travelling down the block
 * instead of three bars growing at once.
 *
 * --sbx-mark-stagger is deliberately shorter than the 620ms sweep, so each line
 * begins while the one above it is still filling. Strictly sequential — each
 * starting only when the last finished — put three lines at 1.9 seconds before
 * the final one lit, which is a long time to hold a reader on a decoration.
 *
 * nth-of-type counts SPANS among siblings, not marks. A band mixing a highlight
 * with an ink-colored span would offset the count by one; the effect is a
 * slightly different delay, never a broken animation, and mixing the two inside
 * one heading is rare enough not to pay for a script to handle it.
 *
 * Six steps because a headline longer than six lines is not a headline. Past
 * that they share the sixth delay and start together, which degrades quietly. */
/* Scoped to the marks that actually animate, since only those have a delay to
   stagger. Under the old brand-level switch this keyed on html.sbx-mark-sweep,
   which no longer exists. */
[class*="sbxmark-"].sbxsweep-on:nth-of-type(2)   { animation-delay: calc(var(--sbx-mark-delay, 0ms) + 1 * var(--sbx-mark-stagger, 300ms)); }
[class*="sbxmark-"].sbxsweep-on:nth-of-type(3)   { animation-delay: calc(var(--sbx-mark-delay, 0ms) + 2 * var(--sbx-mark-stagger, 300ms)); }
[class*="sbxmark-"].sbxsweep-on:nth-of-type(4)   { animation-delay: calc(var(--sbx-mark-delay, 0ms) + 3 * var(--sbx-mark-stagger, 300ms)); }
[class*="sbxmark-"].sbxsweep-on:nth-of-type(5)   { animation-delay: calc(var(--sbx-mark-delay, 0ms) + 4 * var(--sbx-mark-stagger, 300ms)); }
[class*="sbxmark-"].sbxsweep-on:nth-of-type(n+6) { animation-delay: calc(var(--sbx-mark-delay, 0ms) + 5 * var(--sbx-mark-stagger, 300ms)); }

/* .sbxmark--still existed to hold ONE mark still while the variant swept the
   rest. With no variant sweeping anything it is redundant -- not adding
   .sbxsweep-on says the same thing -- but content written while the setting
   existed still carries it, so it keeps working. */
.sbxmark-action.sbxmark--still,
.sbxmark-alt1.sbxmark--still,
.sbxmark-alt2.sbxmark--still,
.sbxmark-alt3.sbxmark--still {
    /* The shorthand clears any delay the stagger rules assigned by position —
       a held mark is held whatever order it sits in. */
    animation:       none;
    background-size: 100% 100%;
}

/* No half-painted text, ever: the end state, immediately. */
@media (prefers-reduced-motion: reduce) {
    /* EVERY mark. The guard was once scoped to html.sbx-mark-sweep, which let a
       mark carrying .sbxsweep-on animate straight through a reduced-motion
       preference on a variant that never asked for animation at all. */
    /* !important because a media query adds NO specificity, and the animation
       selectors still outrank this one: html + :not(.sbx-curtain) + the mark +
       .sbxsweep-on. Without it the guard silently lost and marks animated
       straight through a reduced-motion preference. That became
       true the moment the curtain gate added :not(.sbx-curtain) to those
       selectors; the guard has been losing since. A vestibular-safety rule is
       exactly where !important earns its place. */
    [class*="sbxmark-"] {
        animation: none !important;
        background-size: 100% 100% !important;
    }
}

/* On an inverted surface the mark keeps its own pairing — unlike .sbxink-*,
 * which yields to the surface foreground. A bar carries its own ground with it,
 * so it stays legible on any surface; text tinted with the same color does not. */


/* ==========================================================================
   CONTENT BUTTON (sbxbtn-*)
   ==========================================================================
   An editorial call-to-action. Deliberately NOT a new button design: on the
   front end every value resolves through the same --sbx-btn-* tokens that
   dress the platform's real action buttons, so a CTA an admin writes into a
   band is the same object as the Donate button it sits above, and a rebrand
   moves both together.

   THIS LIVES IN bands.css, NOT template.css, for the reason the ink and mark
   classes do: the class travels in the content, so it must render identically
   in the front end, the band editor and JCE. jce.css imports this file and
   defines only a subset of the tokens, which is why every var() here carries a
   literal fallback — the same discipline the rest of this file follows. The
   fallbacks are what a JCE author sees; the tokens are what the site renders.

     sbxbtn-primary     solid, brand primary
     sbxbtn-secondary   outlined
     sbxbtn-ghost       no border, quiet until hover
     sbxbtn-alt1/2/3    solid, brand palette slots 1-3

   No size or width variants: a second attributor would let an admin build a
   small quiet button that vanishes on a dark band, and width is better handled
   by the medium — buttons go full width below 600px on their own, which is the
   only thing a width control would have been used for.

   Added: v11, 2026-08-23
   ========================================================================== */

/* WHY !important ON color AND text-decoration, AND ONLY THOSE TWO.
   #content a:not(.btn):not(.readon):not(.button):not(.share-link):not(.modal)
   in template.css (:634) is specificity (1,5,1) and forces link blue plus an
   underline on any content <a>. These classes are not in that exclusion list
   and no selector we can reasonably write outweighs (1,5,1). Same situation as
   .item-list > a at template.css:6309, resolved the same way and documented
   there: intentionally overriding a structural global rule for one scope.
   Nothing else needs it — the global rule sets only those two properties. */
[class*="sbxbtn-"] {
    -webkit-appearance: none;
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    background:      var(--sbx-btn-primary-bg, var(--sbx-primary, #375692));
    color:           var(--sbx-btn-primary-text, var(--sbx-text-on-primary, #fff)) !important;
    border:          1px solid transparent;
    border-radius:   var(--sbx-radius-btn, 6px);
    font-family:     var(--sbx-font-ui, var(--sbx-font-body, inherit));
    font-size:       var(--sbx-font-size-btn, 1rem);
    font-weight:     700;
    line-height:     1.2;
    padding:         var(--sbx-btn-padding, 0.75rem 1.5rem);
    min-height:      var(--sbx-btn-height, 48px);
    margin:          0 var(--sbx-space-xs, 4px) var(--sbx-space-xs, 4px) 0;
    box-sizing:      border-box;
    text-align:      center;
    text-decoration: none !important;
    cursor:          pointer;
    transition:      background   var(--sbx-transition, 150ms ease),
                     border-color var(--sbx-transition, 150ms ease),
                     box-shadow   var(--sbx-transition, 150ms ease),
                     transform    var(--sbx-transition, 150ms ease);
}

[class*="sbxbtn-"]:hover  { background: var(--sbx-primary-dark, rgb(40, 63, 110)); }
[class*="sbxbtn-"]:focus  { outline: none; box-shadow: var(--sbx-shadow-focus, 0 0 0 3px rgba(55, 86, 148, 0.22)); }
[class*="sbxbtn-"]:active { background: var(--sbx-primary-darker, rgb(28, 44, 78)); transform: translateY(1px); box-shadow: none; }

/* ── Outlined ────────────────────────────────────────────────────────────── */
.sbxbtn-secondary {
    background:   transparent;
    border-color: var(--sbx-primary, #375692);
    color:        var(--sbx-primary, #375692) !important;
}
.sbxbtn-secondary:hover,
.sbxbtn-secondary:active { background: var(--sbx-primary-pale, rgb(220, 228, 243)); }

/* ── Quiet ───────────────────────────────────────────────────────────────── */
.sbxbtn-ghost {
    background:   transparent;
    border-color: transparent;
    color:        var(--sbx-primary, #375692) !important;
}
.sbxbtn-ghost:hover,
.sbxbtn-ghost:active { background: var(--sbx-primary-pale, rgb(220, 228, 243)); }

/* ── Palette slots ───────────────────────────────────────────────────────── */
/* Same slots as .sbxink-alt1..3 and the same storage discipline: the class is a
   REFERENCE resolved at render, never a baked hex, so a button built before a
   rebrand follows the rebrand and follows a variant.

   The fallback is the primary color, not `inherit`. An admin who defines two
   palette colors and later picks slot 3 gets the primary button — legible —
   rather than a transparent button with invisible text. The picker hides
   undefined slots, so this is the net for content that outlives a palette
   being shortened. */
.sbxbtn-alt1 { background: var(--sbx-palette-1, #375692); color: var(--sbx-palette-1-on, #fff) !important; }
.sbxbtn-alt2 { background: var(--sbx-palette-2, #375692); color: var(--sbx-palette-2-on, #fff) !important; }
.sbxbtn-alt3 { background: var(--sbx-palette-3, #375692); color: var(--sbx-palette-3-on, #fff) !important; }

/* No separate hover tone. A slot is one color, and deriving a darker one at
   runtime is the automatic-contrast trap this file already refuses — the paired
   foreground was chosen against THIS color, not against a shade of it. Dimming
   the whole control keeps the pairing intact. */
.sbxbtn-alt1:hover,  .sbxbtn-alt2:hover,  .sbxbtn-alt3:hover  { filter: brightness(0.92); }
.sbxbtn-alt1:active, .sbxbtn-alt2:active, .sbxbtn-alt3:active { filter: brightness(0.85); }

/* ── Surfaces ────────────────────────────────────────────────────────────── */
/* .sbx-band > .sbxMod.sbxsurf-dark a (template.css:15943) is specificity
   (0,3,1) and repaints link color on inverted grounds. Solid buttons already
   win on `color` above, but the outlined variants would take the surface's link
   color and lose their border pairing — so they are re-paired here, matching
   the pre-paired discipline the surfaces already use. */
.sbxsurf-dark  .sbxbtn-secondary, .sbxsurf-image .sbxbtn-secondary,
.sbxsurf-dark  .sbxbtn-ghost,     .sbxsurf-image .sbxbtn-ghost {
    border-color: var(--sbx-text-on-primary, #fff);
    color:        var(--sbx-text-on-primary, #fff) !important;
}
.sbxsurf-dark  .sbxbtn-secondary:hover, .sbxsurf-image .sbxbtn-secondary:hover,
.sbxsurf-dark  .sbxbtn-ghost:hover,     .sbxsurf-image .sbxbtn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* sbxsurf-brand IS a primary ground as of v236, so a solid primary button on it
   really would be primary-on-primary. It inverts to the paired foreground as its
   own ground — the one case where a variant must change color to stay itself.
   Outlined and quiet re-pair the same way they do on dark.

   This rule existed, was removed, and is back. It was written first on the
   assumption that "brand surface" meant the brand color, removed when rendering
   showed the surface was actually --sbx-primary-pale and the inversion produced
   white on pale peach, and restored now that the surface means what its name
   says. The tint kept the old behavior under sbxsurf-tint, which needs no help.

   sbxsurf-tint is deliberately absent below: a solid primary button on a pale
   wash has full contrast already. */
.sbxsurf-brand .sbxbtn-primary {
    background: var(--sbx-text-on-primary, #fff);
    color:      var(--sbx-primary-darker, rgb(28, 44, 78)) !important;
}
.sbxsurf-brand .sbxbtn-primary:hover { background: var(--sbx-primary-pale, rgb(220, 228, 243)); }

.sbxsurf-brand .sbxbtn-secondary,
.sbxsurf-brand .sbxbtn-ghost {
    border-color: var(--sbx-text-on-primary, #fff);
    color:        var(--sbx-text-on-primary, #fff) !important;
}
.sbxsurf-brand .sbxbtn-secondary:hover,
.sbxsurf-brand .sbxbtn-ghost:hover { background: rgba(255, 255, 255, 0.14); }

/* Follow links and inks pair the same way on a primary ground. */
.sbxsurf-brand .sbx-follow-link {
    background: rgba(255, 255, 255, 0.16);
    color:      var(--sbx-text-on-primary, #fff) !important;
}
.sbxsurf-brand .sbx-follow-link:hover { background: rgba(255, 255, 255, 0.28); }

/* A highlight on a brand ground would paint the brand color onto itself — an
   invisible bar with legible text, which is a highlight that does nothing. It
   inverts to the paired foreground as its bar, the same move .sbxbtn-primary
   makes on this surface and for the same reason. */
.sbxsurf-brand .sbxmark-action {
    background-image: linear-gradient(var(--sbx-text-on-primary, #fff),
                                      var(--sbx-text-on-primary, #fff));
    color:            var(--sbx-primary-darker, rgb(28, 44, 78));
}

.sbxsurf-brand .sbxink-action,
.sbxsurf-brand .sbxink-alt1,
.sbxsurf-brand .sbxink-alt2,
.sbxsurf-brand .sbxink-alt3 { color: var(--sbx-text-on-primary, #fff); }

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    [class*="sbxbtn-"]        { transition: none; }
    [class*="sbxbtn-"]:active { transform: none; }
}

/* ── Small screens ───────────────────────────────────────────────────────── */
/* Full width rather than a wrapped nub — and the reason there is no width
   control, since this is the only place one would have been used. */
@media (max-width: 600px) {
    [class*="sbxbtn-"] {
        display: flex;
        width:   100%;
        margin:  0 0 var(--sbx-space-sm, 8px) 0;
    }
}

/* ==========================================================================
   Click-to-load video (.sbx-video)
   ==========================================================================
   Authored in a band block, stored as a single <a> with no children so Quill
   can carry it as a registered block embed -- an element with children is not
   safe as one, and everything visible here is drawn with CSS instead.

   The anchor points at the video's own page, so with JavaScript off it is a
   working link. With JavaScript, the click swaps in the iframe and nothing
   third-party is contacted before that.
   ========================================================================== */

.sbx-video {
    display: block;
    position: relative;
    width: 100%;
    /* 16:9 without the padding-top hack. Every browser this template supports
       has aspect-ratio; the fallback below covers the rest. */
    aspect-ratio: 16 / 9;
    border-radius: var(--sbx-radius-card);
    overflow: hidden;
    background-color: var(--sbx-surface-dark);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-decoration: none;
    margin: var(--sbx-space-md) 0;
}

@supports not (aspect-ratio: 16 / 9) {
    .sbx-video { height: 0; padding-bottom: 56.25%; }
}

/* Darkened only where there IS a poster, so a play button stays legible over a
   bright photograph. With no poster the surface is already dark. */
.sbx-video.has-poster::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .28);
    transition: background .15s ease;
}
.sbx-video.has-poster:hover::before { background: rgba(0, 0, 0, .12); }

/* The play button, drawn rather than shipped as an image: one less request, and
   it takes the brand color without anyone exporting a new asset. */
.sbx-video::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 18px 0 18px 30px;
    border-color: transparent transparent transparent var(--sbx-text-on-primary);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .55));
    transition: transform .15s ease;
}
.sbx-video:hover::after { transform: translate(-50%, -50%) scale(1.08); }

.sbx-video:focus-visible {
    outline: 3px solid var(--sbx-primary);
    outline-offset: 3px;
}

/* Once playing, the anchor is gone and this wraps the iframe instead. */
.sbx-video.is-playing { background: #000; }
.sbx-video.is-playing::before,
.sbx-video.is-playing::after { content: none; }

.sbx-video.is-playing iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .sbx-video.has-poster::before,
    .sbx-video::after { transition: none; }
    .sbx-video:hover::after { transform: translate(-50%, -50%); }
}
