/* ============= Theme palette & dark-mode support =============
 *
 * Every public theme MUST expose its colour palette as CSS custom
 * properties on :root and provide a `prefers-color-scheme: dark`
 * override that re-binds those properties for dark mode. This is a
 * theme-wide rule, not a default-theme detail — the assumption is
 * that the browser-level dark-mode preference is respected by every
 * Warhol theme so visitors see consistent behaviour across sites.
 *
 * Tokens are namespaced `--site-*` (chrome / surfaces / borders /
 * text) and `--color-primary-*` / `--color-accent-*` (brand). The :root block carries
 * light-mode values; the prefers-color-scheme: dark block carries
 * dark-mode values. Components below should read from these tokens
 * rather than hard-coding hex / rgba.
 *
 * Author content (cms.slide.bg-color, cms.slide.text-color on carousel
 * slides) is author-chosen and intentionally not re-mapped — those are
 * the operator's deliberate brand choices. A text highlight carries no
 * author colour: it names an intent, and the --text-highlight-* tokens
 * below are the palette.
 */
:root {
    --typography-font-family-fixed: "Courier New", Courier;
    --typography-font-family: "Archivo";
    /* Display face for headings and large editorial type (riverside
     * design plan §3): a high-contrast serif carries the "concert
     * hall" voice while the utility face does everything else. */
    --typography-font-family-display: "Fraunces";
    --typography-htmlFontSize: 16px;
    --typography-fontSize: 14px;
    --typography-fontWeightThin: 100;
    --typography-fontWeightLight: 300;
    --typography-fontWeightRegular: 400;
    --typography-fontWeightMedium: 500;
    --typography-fontWeightBold: 700;
    --typography-fontWeightBlack: 900;

    /* Type scale — a strict editorial scale; components read these
     * instead of hand-rolling clamp()s so hierarchy stays consistent. */
    --type-display: clamp(2.6rem, 6vw, 4.6rem);
    --type-h2: clamp(1.9rem, 3.6vw, 2.8rem);
    --type-h3: 1.25rem;
    --type-eyebrow: 0.78rem;

    /* Chrome surfaces + text — warm paper field, deep ink text. */
    --site-bg: #fafaf7;
    --site-text: #1b2129;
    --site-text-muted: #3d4654;
    --site-surface: #ffffff;
    --site-surface-alt: #efede6;
    --site-border: #d9d5c9;
    --site-border-strong: #b9b4a4;
    --site-shadow: rgba(27, 33, 41, 0.08);
    /* The ground behind a logo (sponsor tiles, contain-fit images): light in
     * both schemes, since most logos are drawn in dark ink. */
    --site-logo-tile: #ffffff;
    /* The dark band (the footer, the scrolled filled header) and its inks.
     * Dark by design, not by preference, so the dark block does not re-bind
     * them. A palette tints the band from its primary and binds the link
     * hover from its dark-half accent; muted and faint stay the theme's. */
    --site-dark-band: #1b2129;
    --site-dark-band-text: #d4d9e0;
    --site-dark-band-muted: #8d96a5;
    --site-dark-band-faint: #868f9c;
    --site-dark-band-link-hover: #c9974a;

    /* Sticky header geometry, kept current by scripts.js: the resting
     * height and how far the scrolled header has shrunk from it. The
     * defaults stand until the script runs; 7rem covers the resting
     * header (two 1.5rem paddings, the 56px logo, the 3px rule). */
    --site-header-h: 7rem;
    --site-header-shrink: 0px;

    /* Rhythm + polish primitives */
    --section-gap: clamp(3rem, 8vw, 6.5rem);
    --measure: 66ch;
    /* Rows, header and footer insides hold to --page-max. --page-gutter is the
     * side padding that centres them, never below the fluid phone-to-desktop
     * minimum; full-bleed bands cancel it with negative margins and pad their
     * insides by it. Not re-bound in dark mode. */
    --page-max: 80rem;
    --page-gutter: max(clamp(1rem, 4vw, 3rem), calc((100vw - var(--page-max)) / 2));
    /* Feature-format carousel stage: at least the floor; its 16/9 growth
     * stops at the smaller cap. The floor wins where they conflict. */
    --carousel-stage-floor: min(70vh, 680px);
    --carousel-stage-cap-height: 65vh;
    --carousel-stage-cap-width: 40vw;
    --radius-sm: 4px;
    --radius-lg: 10px;
    --shadow-card: 0 1px 2px rgba(27, 33, 41, 0.08), 0 8px 24px rgba(27, 33, 41, 0.1);
    --shadow-lift: 0 2px 4px rgba(27, 33, 41, 0.12), 0 16px 40px rgba(27, 33, 41, 0.16);

    /* Brand. Fill tokens paint fills only; -text and -link colour text on
     * the page. A palette re-binds all twelve brand tokens. */
    --color-primary-fill: #1a3a5c;
    --color-primary-fill-hover: #2a4a6c;
    --color-primary-text-on-fill: #ffffff;
    --color-primary-text: #1a3a5c;
    --color-primary-link: #1a3a5c;
    --color-primary-link-hover: #2a4a6c;

    /* Filled header band and the title band under it: the light brand
     * colour in BOTH schemes, so the dark block repeats these values. */
    --site-header-band: #1a3a5c;
    --site-header-band-hover: #2a4a6c;
    --site-header-band-ink: #ffffff;

    /* Accent — warm brass, used sparingly: CTAs, event date stubs,
     * active states. The single non-neutral besides the brand blue.
     * Darkened from #a87b2d (3.79:1 with white text, fails WCAG 1.4.3)
     * to clear 4.5:1 on the pricing CTA buttons; hover darkened
     * to match so the two states stay visually distinct. Accent text and
     * links take the darker hover tone, for contrast on the page. */
    --color-accent-fill: #8f6926;
    --color-accent-fill-hover: #72541f;
    --color-accent-text-on-fill: #ffffff;
    --color-accent-text: #72541f;
    --color-accent-link: #72541f;
    --color-accent-link-hover: #72541f;
    /* The primary action over a photo: the light accent in both schemes,
     * since the backdrop is a photo plus scrim either way. Not re-bound
     * in dark mode. */
    --site-photo-cta: #8f6926;
    --site-photo-cta-hover: #72541f;
    --site-photo-cta-ink: #ffffff;
    /* Over-photo eyebrows and the carousel's current bar, constant across
     * schemes for the same reason; a palette binds its dark-half accent. */
    --site-photo-eyebrow: #e6c37a;
    --site-photo-current: #c9974a;

    /* Featured — deep velvet, rarer than the accent: the event ticket
     * card and is-featured surfaces only. */
    --color-featured: #5c1a24;
    --color-on-featured: #f3e9e3;

    /* The featured For Sale CTA header the rendering model paints: the
     * brand pair. */
    --color-feature-accent-bg: var(--color-primary-fill);
    --color-feature-accent-text: var(--color-primary-text-on-fill);

    /* Scrim tokens — text over imagery ALWAYS sits on one of these
     * (systemic rule; see the carousel-slide and
     * simple-cta overlays). --scrim-bottom anchors bottom-weighted
     * text; --scrim-full protects author-positioned text anywhere in
     * the frame; its alpha holds the white overlay text at 4.5:1 or
     * better over a pure white photo pixel. Like the overlay tokens below
     * they are intentionally NOT re-bound in dark mode — the backdrop is
     * a photo either way. */
    --scrim-bottom: linear-gradient(180deg, rgba(20, 23, 29, 0) 30%, rgba(20, 23, 29, 0.78) 82%);
    --scrim-full: rgba(20, 23, 29, 0.65);

    /* Semantic — success (for-sale checkmarks, "tickets available" badge).
     * Mirrors the brand pattern: the fill lightens in dark mode while its
     * on-colour flips dark, so green-on-card and text-on-badge both stay
     * legible across modes. */
    --color-success: #2e7d32;
    --color-on-success: #ffffff;

    /* Overlay palette — white text / controls that sit on author media or
     * the darkening scrim (carousel dots, simple-cta over a photo); a stage
     * without an image takes --color-primary-text-on-fill instead. Intentionally NOT
     * re-bound for dark mode: the backdrop is a photo or a black scrim in
     * both modes, so these stay
     * white — same reasoning as the author slide colours above, which are
     * likewise not re-mapped. */
    --site-overlay-text: #ffffff;
    --site-overlay-text-muted: rgba(255, 255, 255, 0.92);
    --site-overlay-control-border: rgba(255, 255, 255, 0.85);
    --site-overlay-control-bg: rgba(255, 255, 255, 0.4);
    --site-overlay-control-bg-hover: rgba(255, 255, 255, 0.75);

    /* Text highlight intents — the author picks an intent, the theme owns
     * the pairing. The scrim is the background's own colour, so an
     * image-free band paints the background exactly and a photo reads as
     * a tinted wash; its alpha keeps the text at 4.5:1 or better even over a
     * pure black or pure white photo pixel. A palette re-binds emphasis and
     * accent from its own family, with a scrim alpha that keeps that
     * guarantee; muted and warning stay the theme's. The rendering model
     * requires all twelve, in both modes. */
    --text-highlight-emphasis-bg: #1a3a5c;
    --text-highlight-emphasis-text: #ffffff;
    --text-highlight-emphasis-scrim: rgba(26, 58, 92, 0.7);
    --text-highlight-accent-bg: #5e4419;
    --text-highlight-accent-text: #ffffff;
    --text-highlight-accent-scrim: rgba(94, 68, 25, 0.75);
    --text-highlight-muted-bg: #efede6;
    --text-highlight-muted-text: #1b2129;
    --text-highlight-muted-scrim: rgba(239, 237, 230, 0.6);
    --text-highlight-warning-bg: #f2c14e;
    --text-highlight-warning-text: #1b2129;
    --text-highlight-warning-scrim: rgba(242, 193, 78, 0.7);
}

@media (prefers-color-scheme: dark) {
    :root {
        --site-bg: #14171d;
        --site-text: #e8e5de;
        --site-text-muted: #a3a9b3;
        --site-surface: #1c2027;
        --site-logo-tile: #ffffff;
        --site-surface-alt: rgba(255, 255, 255, 0.045);
        --site-border: rgba(255, 255, 255, 0.12);
        --site-border-strong: rgba(255, 255, 255, 0.22);
        --site-shadow: rgba(0, 0, 0, 0.5);
        --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.45);
        --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.45), 0 16px 40px rgba(0, 0, 0, 0.55);

        /* Brand tones lighten in dark mode so they read against the
         * dark surface; text-on-fill flips to the surface colour.
         * Lightened but still saturated — not a kid's-bedroom blue.
         * Primary text (the site title) takes the neutral cream: large
         * tinted display text reads as decorative on a dark surface. */
        --color-primary-fill: #8eb1d4;
        --color-primary-fill-hover: #a5c4e0;
        --color-primary-text-on-fill: #16181c;
        --color-primary-text: var(--site-text);
        --color-primary-link: #8eb1d4;
        --color-primary-link-hover: #a5c4e0;
        --site-header-band: #1a3a5c;
        --site-header-band-hover: #2a4a6c;
        --site-header-band-ink: #ffffff;

        /* Accent follows the brand pattern: the brass lightens so it
         * reads on the dark surface, and its on-colour flips dark. */
        --color-accent-fill: #c9974a;
        --color-accent-fill-hover: #d8a95e;
        --color-accent-text-on-fill: #14171d;
        --color-accent-text: #d8a95e;
        --color-accent-link: #d8a95e;
        --color-accent-link-hover: #d8a95e;

        /* Velvet stays deep in dark mode (it is already a dark surface);
         * only its on-colour warms slightly for contrast. */
        --color-featured: #6b2530;
        --color-on-featured: #f6ece6;
        --color-feature-accent-bg: var(--color-primary-fill);
        --color-feature-accent-text: var(--color-primary-text-on-fill);

        /* Success lightens and its on-colour flips dark — same move as the
         * brand tokens above, so the badge text and checkmark both stay
         * readable on the dark surface. */
        --color-success: #66bb6a;
        --color-on-success: #16181c;

        /* Text highlight intents follow the brand pattern: the fills
         * lighten and the text flips dark, except muted, which becomes
         * the dark surface. Warning stays amber in both modes. */
        --text-highlight-emphasis-bg: #8eb1d4;
        --text-highlight-emphasis-text: #16181c;
        --text-highlight-emphasis-scrim: rgba(142, 177, 212, 0.9);
        --text-highlight-accent-bg: #dcae66;
        --text-highlight-accent-text: #14171d;
        --text-highlight-accent-scrim: rgba(220, 174, 102, 0.9);
        --text-highlight-muted-bg: #1c2027;
        --text-highlight-muted-text: #e8e5de;
        --text-highlight-muted-scrim: rgba(28, 32, 39, 0.7);
        --text-highlight-warning-bg: #f2c14e;
        --text-highlight-warning-text: #1b2129;
        --text-highlight-warning-scrim: rgba(242, 193, 78, 0.7);
    }
}

html {
    font-size: var(--typography-htmlFontSize);
    font-family: var(--typography-font-family), sans-serif;
    font-weight: var(--typography-fontWeightRegular);
    line-height: 1.5;
}


body {
    font-family: var(--typography-font-family), "Helvetica Neue", Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.6;
    background-color: var(--site-bg);
    color: var(--site-text);
}

/* ============= Wrapper Contract: empty slots =============
 * Every attribute access emits a [data-cms-a] slot wrapper, including
 * an empty one (data-cn="0") when the attribute holds no values. Empty
 * slots are first-class structural facts for editorial tooling (drag-
 * drop targets, slot-validation indicators) but must not render on the
 * delivered public page. This base rule hides them; a theme that wants
 * a visible public empty-state overrides it for a specific slot
 * (e.g. [data-an="cms.cta"][data-cn="0"] { display: block; }).
 * See doc/architecture/rendering-model.md § Wrapper Contract / Empty slots.
 */
[data-cms-a]:where([data-cn="0"]) {
    display: none;
}

/* Tags are authoring/search metadata, not public content — the generic
 * <@kds.rest> pass would otherwise print them on every subtype that
 * doesn't exclude them. !important because structural
 * child selectors (e.g. text-highlight's `> div:not([aria-hidden])`
 * content column) also match the tags slot at higher specificity and
 * would re-display it; suppression here is categorical. */
[data-cms-a][data-an="cms.tags"] {
    display: none !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--typography-font-family-display), Georgia, "Times New Roman", serif;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

/* ============= Skip-to-content link (WCAG 2.4.1 Bypass Blocks) =============
 * First focusable element on the page, ahead of the header nav. Off-screen
 * until :focus, then drops into view above the header so a keyboard or
 * screen-reader visitor can jump straight to #main-content. Selected
 * structurally by its href, not a class — the default theme is class-free;
 * layout.ftlh emits a single `body > a[href="#main-content"]`.
 */
body > a[href="#main-content"] {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 999;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm);
    background-color: var(--color-primary-fill);
    color: var(--color-primary-text-on-fill);
    font-weight: var(--typography-fontWeightBold);
    transform: translateY(-150%);
    transition: transform 200ms ease;
}

/* box-shadow lives only in the :focus state: the base rule's blur radius
 * (--shadow-lift is 40px+) spills past the translateY(-150%) offscreen
 * offset and paints in the top-left corner of every public page even while
 * "hidden". */
body > a[href="#main-content"]:focus {
    transform: translateY(0);
    box-shadow: var(--shadow-lift);
}

/* Skip-link target: the empty anchor layout.ftlh places ahead of
 * the rendered page (see the sidebar/non-sidebar branches there). Both
 * branches put it where it would otherwise become a flex item — a sibling
 * inside the `body > div:has(> aside)` row, or a direct child of the
 * flex-column <body> — perturbing the gap/sizing of <main>/<aside>.
 * position:absolute pulls it out of flow entirely so it can't affect
 * either; NOT display:none, which would drop it from the accessibility
 * tree and break the skip link's focus handoff. */
#main-content {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============= Site header =============
 * White content area sits below a thin primary-colour accent bar at
 * the very top of the page and a 3 px primary-colour rule at the
 * bottom — bookends that mark the header as branded chrome without
 * overwhelming the content below. Soft shadow underneath gives a
 * little elevation; logo sits to the left of the org name in a flex
 * row, both vertically centred. No hover motion.
 *
 * Org-name typography is the display face at 700 in the primary colour with
 * tightened letter-spacing, sized fluidly via clamp() so it stays
 * readable on phones (1.5 rem) without growing unwieldy on wide
 * displays (~2 rem).
 */
/* The page chrome header is the direct child of <body> (entity
 * templates may emit their own <header> deep in the content, so the
 * chrome rules are scoped to `body > header` to stay off them). The logo
 * <img> and org-name <h2> both sit inside the header's <a> (one
 * accessible name, sourced from the visible <h2> text, not the img alt);
 * no wrapper classes — the structure is the hook. */
body > header {
    /* Sticky: the page scrolls behind it. scripts.js marks it data-scrolled
     * once the page has scrolled; see "Sticky header" below. */
    position: sticky;
    top: 0;
    z-index: 100;
    /* Flex row: the logo / org-name <section> takes the left and grows,
     * pushing the main-nav <nav> to the right edge. flex-wrap lets the
     * nav drop to its own (still right-aligned) row when the header is
     * too narrow to hold both on one line. */
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    /* A whisper of warmth — barely off-white but enough that the
     * header reads as its own surface rather than disappearing into
     * the page. The token (--site-surface) flips to a dark surface
     * in prefers-color-scheme: dark; shadow / border tokens follow
     * the same light/dark split. */
    background-color: var(--site-surface);
    border-bottom: 3px solid var(--color-primary-fill);
    box-shadow: 0 4px 12px var(--site-shadow);
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    /* Holds the header's resting place in the flow while it shrinks. */
    margin-bottom: var(--site-header-shrink);
    transition: padding 200ms ease, color 200ms ease, background-color 200ms ease, box-shadow 200ms ease;
}

/* Thin primary-colour accent bar pinned to the very top of the
 * header; uses ::before so it doesn't take a DOM node. */
body > header::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    background: linear-gradient(
        to right,
        var(--color-primary-fill),
        var(--color-primary-fill-hover)
    );
}

body > header > section {
    /* Grow to fill the header row so the sibling <nav> is pushed to the
     * right; min-width:0 lets a long org name shrink instead of forcing
     * the nav off the row prematurely. The brand <a> below is section's
     * only child and carries its own flex row for the logo + title. */
    flex: 1 1 auto;
    min-width: 0;
}

/* Header brand link — wraps the logo <img> and the org-name/site-title
 * <h2> together; grows/shrinks like the old <section> row did. */
body > header > section > a {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 8px;
    /* The nested <h2> is now inside the link -- undo the
     * default anchor underline it would otherwise inherit, same reset
     * errorLayout's .standalone-bar-org uses for the same shape. */
    text-decoration: none;
}

body > header > section > a:focus-visible {
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 3px;
}

/* Height-led, so a wide wordmark keeps its shape and a square logo lands at
 * 56 × 56. Not rounded: a site's own stylesheet may round it. It may shrink
 * beside the title, contained rather than squashed. */
body > header img {
    width: auto;
    max-width: 16rem;
    min-width: 0;
    object-fit: contain;
    height: 56px;
    display: block;
    transition: height 200ms ease;
}

/* Logo slots (kdrm-default.ftlh headerLogo): with a dark or on-brand logo set,
 * each image names the slots it fills in data-logo and one shows. Main by
 * default; dark wherever the header is dark; on-brand on the filled band at
 * rest. A state whose slot has no image keeps main (the :has() guards). */
body > header img[data-logo]:not([data-logo~="main"]) {
    display: none;
}

@media (prefers-color-scheme: dark) {
    body > header:not([data-header-style="filled"]):has(img[data-logo~="dark"]) img[data-logo]:not([data-logo~="dark"]) {
        display: none;
    }

    body > header:not([data-header-style="filled"]):has(img[data-logo~="dark"]) img[data-logo~="dark"] {
        display: block;
    }
}

/* Org-name title. */
body > header > section > a > h2 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: var(--typography-font-family-display), Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--color-primary-text);
    letter-spacing: -0.015em;
    line-height: 1.2;
}

/* ============= Filled header style ============= */
body > header[data-header-style="filled"] {
    background-color: var(--site-header-band);
    color: var(--site-header-band-ink);
    border-bottom: none;
    box-shadow: none;
}

body > header[data-header-style="filled"]::before {
    content: none;
}

/* A light plate keeps a dark logo mark legible on the band, unless the
 * image is the site's own choice for that surface. */
body > header[data-header-style="filled"]:not([data-scrolled]) img:not([data-logo~="on-brand"]),
body > header[data-header-style="filled"][data-scrolled] img:not([data-logo~="dark"]) {
    box-sizing: border-box;
    padding: 0.25rem;
    background-color: var(--site-header-band-ink);
}

body > header[data-header-style="filled"]:not([data-scrolled]):has(img[data-logo~="on-brand"]) img[data-logo]:not([data-logo~="on-brand"]) {
    display: none;
}

body > header[data-header-style="filled"]:not([data-scrolled]):has(img[data-logo~="on-brand"]) img[data-logo~="on-brand"] {
    display: block;
}

body > header[data-header-style="filled"] > section > a,
body > header[data-header-style="filled"] > section > a > h2,
body > header[data-header-style="filled"] > nav > ul > li > :is(a, span, button) {
    color: inherit;
}

body > header[data-header-style="filled"] > nav > ul > li > :is(a, span, button):is(:hover, :focus-visible) {
    background-color: var(--site-header-band-hover);
    color: inherit;
}

body > header[data-header-style="filled"] > section > a:focus-visible,
body > header[data-header-style="filled"] > nav > ul > li > :is(a, span, button):focus-visible {
    outline-color: currentColor;
}

/* ============= Sticky header =============
 * Scrolled (data-scrolled, from scripts.js) is compact in both styles:
 * plain keeps its surface and lifts onto the card shadow, filled becomes
 * the dark band. Without the script the header stays sticky at rest. */
html {
    /* Anchor targets and focused elements land below the header. */
    scroll-padding-top: var(--site-header-h);
    /* No scroll anchoring: its correction for the shrinking header would
     * scroll the page back over the threshold and flip the header's state. */
    overflow-anchor: none;
}

body > header[data-scrolled] {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

body > header[data-scrolled] img {
    height: 40px;
}

body > header[data-scrolled] > section > a > h2 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}

body > header[data-header-style="plain"][data-scrolled] {
    box-shadow: var(--shadow-card);
}

body > header[data-header-style="filled"][data-scrolled] {
    background-color: var(--site-dark-band);
    color: var(--site-dark-band-text);
    box-shadow: var(--shadow-card);
}

body > header[data-header-style="filled"][data-scrolled]:has(img[data-logo~="dark"]) img[data-logo]:not([data-logo~="dark"]) {
    display: none;
}

body > header[data-header-style="filled"][data-scrolled]:has(img[data-logo~="dark"]) img[data-logo~="dark"] {
    display: block;
}

/* Filled, over a landing page that leads with a carousel (after an
 * invisible title, if any): the header takes no room in the flow and at
 * rest is transparent, its text on a top-edge scrim; the slide text
 * starts below it. Scrolled, it is the dark band as on any page. */
body:has(> main[data-sn="landing-page"] > [data-cms-a] > :is([data-cms-e][data-sn="content-carousel"]:first-child, [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="content-carousel"])) > header[data-header-style="filled"] {
    margin-bottom: calc(var(--site-header-shrink) - var(--site-header-h));
}

body:has(> main[data-sn="landing-page"] > [data-cms-a] > :is([data-cms-e][data-sn="content-carousel"]:first-child, [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="content-carousel"])) > header[data-header-style="filled"]:not([data-scrolled]) {
    background-color: transparent;
    background-image: linear-gradient(var(--scrim-full), transparent);
    color: var(--site-overlay-text);
}

/* Over the photo the header is dark: the dark logo, else main (never
 * on-brand), and the plate only on an image that is not the dark one. */
body:has(> main[data-sn="landing-page"] > [data-cms-a] > :is([data-cms-e][data-sn="content-carousel"]:first-child, [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="content-carousel"])) > header[data-header-style="filled"]:not([data-scrolled]) img[data-logo]:not([data-logo~="main"]) {
    display: none;
}

body:has(> main[data-sn="landing-page"] > [data-cms-a] > :is([data-cms-e][data-sn="content-carousel"]:first-child, [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="content-carousel"])) > header[data-header-style="filled"]:not([data-scrolled]) img[data-logo~="main"] {
    display: block;
}

body:has(> main[data-sn="landing-page"] > [data-cms-a] > :is([data-cms-e][data-sn="content-carousel"]:first-child, [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="content-carousel"])) > header[data-header-style="filled"]:not([data-scrolled]):has(img[data-logo~="dark"]) img[data-logo]:not([data-logo~="dark"]) {
    display: none;
}

body:has(> main[data-sn="landing-page"] > [data-cms-a] > :is([data-cms-e][data-sn="content-carousel"]:first-child, [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="content-carousel"])) > header[data-header-style="filled"]:not([data-scrolled]):has(img[data-logo~="dark"]) img[data-logo~="dark"] {
    display: block;
    padding: 0;
    background-color: transparent;
}

body:has(> main[data-sn="landing-page"] > [data-cms-a] > :is([data-cms-e][data-sn="content-carousel"]:first-child, [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="content-carousel"])) > header[data-header-style="filled"]:not([data-scrolled]) img[data-logo~="on-brand"]:not([data-logo~="dark"]) {
    box-sizing: border-box;
    padding: 0.25rem;
    background-color: var(--site-header-band-ink);
}

/* An open small-screen menu needs a surface of its own. */
body:has(> main[data-sn="landing-page"] > [data-cms-a] > :is([data-cms-e][data-sn="content-carousel"]:first-child, [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="content-carousel"])) > header[data-header-style="filled"]:not([data-scrolled]):has(> nav > button[aria-expanded="true"]) {
    background-color: var(--site-dark-band);
    background-image: none;
    color: var(--site-dark-band-text);
}

body:has(> header[data-header-style="filled"]) > main[data-sn="landing-page"] > [data-cms-a] > :is([data-cms-e][data-sn="content-carousel"]:first-child, [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="content-carousel"]) > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div:not([aria-hidden]) {
    padding-top: calc(3rem + var(--site-header-h));
}

@media (prefers-reduced-motion: reduce) {
    body > header,
    body > header img {
        transition: none;
    }
}

/* An open small-screen menu can outgrow the viewport; the header scrolls
 * within itself rather than trapping its last links off-screen. */
@media (max-width: 600px) {
    body > header {
        max-height: 100svh;
        overflow-y: auto;
    }

    /* A wide wordmark leaves the title half the row. */
    body > header img {
        max-width: 50%;
    }
}

/* ============= Main + footer navigation — horizontal dropdown nav =====
 * The main nav (cms.site.mainnav) and the footer nav (cms.site.footernav)
 * both render class-free as a <nav><ul><li> tree (see
 * views/website/includes/nav.ftlh): top-level <li>s are the bar items, and
 * a nested <ul> under an <li> is that item's submenu. The default theme
 * lays the top level out as a horizontal bar and reveals each submenu as a
 * panel that eases in / out. The two bars share one base treatment and
 * diverge only where noted:
 *   - HEADER: hugs the right of the header row, heavier weight, panels
 *     drop DOWN (right-aligned so they never run off a right-justified bar).
 *   - FOOTER: centered, lighter weight, panels open UPWARD (the bar sits at
 *     the page bottom).
 *
 * Reveal is hover + keyboard (:focus-within) + a JS-set `.nav-open` class
 * for touch devices (see scripts.js initMainNavTap). A parent with no link
 * of its own renders as a disclosure <button>, which scripts.js lets toggle
 * the panel (`.nav-closed` shuts one focus is inside). All colours read from the
 * chrome tokens (--site-surface / --site-border / --site-shadow /
 * --site-text / --color-primary-link / --color-primary-fill), so both bars track light / dark for free.
 * Scoped under `body > header` / `body > footer` so in-content <nav>s are
 * untouched.
 */
body > :where(header, footer) nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Top-level bar: horizontal, wraps on narrow widths. */
body > :where(header, footer) > nav > ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

/* Each item anchors its own dropdown. */
body > :where(header, footer) nav li {
    position: relative;
}

/* A disclosure <button> sheds its control chrome and wears whatever its
 * context gives a span. Zero specificity bar the element, so every nav rule
 * below wins. */
:where(body > :is(header, footer) nav li, [data-cms-e][data-sn="nav-marker"] li) > button {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: inherit;
    text-transform: inherit;
}

/* Links and non-link (span / button) parents share one pill treatment. */
body > :where(header, footer) nav a,
body > :where(header, footer) nav span,
body > :where(header, footer) nav li > button {
    display: block;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    color: var(--site-text);
    font-weight: var(--typography-fontWeightMedium);
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

body > :where(header, footer) nav a:hover,
body > :where(header, footer) nav a:focus-visible,
body > :where(header, footer) nav span:focus-visible,
body > :where(header, footer) nav li > button:focus-visible {
    background-color: var(--site-surface-alt);
    color: var(--color-primary-link);
}

/* The pill above is the hover treatment, and on its own it is not a focus
 * indicator: measured against the header surface it is 1.17:1 in light and
 * 1.13:1 in dark, and the colour change it pairs with is a change of the text
 * itself. Focus gets the outline the logo anchor above already uses — same
 * shape, same token, and 11.64:1 / 7.31:1 against the surface it sits on.
 * This is the argument in that rule's own comment, applied to the nav. */
body > :where(header, footer) nav a:focus-visible,
body > :where(header, footer) nav span:focus-visible,
body > :where(header, footer) nav li > button:focus-visible {
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 2px;
}

/* The current page (rendered by nav.ftlh as a non-link aria-current span or button) is
 * bolded so it reads as "you are here". */
body > :where(header, footer) nav [aria-current="page"] {
    font-weight: var(--typography-fontWeightBold);
    cursor: default;
}

/* Caret on items that own a submenu; flips when the panel is open. */
body > :where(header, footer) nav li:has(> ul) > a::after,
body > :where(header, footer) nav li:has(> ul) > span::after,
body > :where(header, footer) nav li:has(> ul) > button::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.45em;
    border-left: 0.3em solid transparent;
    border-right: 0.3em solid transparent;
    border-top: 0.34em solid currentColor;
    vertical-align: 0.14em;
    transition: transform 200ms ease;
}

body > :where(header, footer) nav li:has(> ul):hover > a::after,
body > :where(header, footer) nav li:has(> ul):hover > span::after,
body > :where(header, footer) nav li:has(> ul):focus-within > a::after,
body > :where(header, footer) nav li:has(> ul):focus-within > span::after,
body > :where(header, footer) nav li:has(> ul).nav-open > a::after,
body > :where(header, footer) nav li:has(> ul).nav-open > span::after,
body > :where(header, footer) nav li:has(> ul):hover > button::after,
body > :where(header, footer) nav li:has(> ul):focus-within > button::after,
body > :where(header, footer) nav li:has(> ul).nav-open > button::after {
    transform: rotate(180deg);
}

/* Dropdown / flyout panels (every nested <ul>): hidden by default,
 * eased in / out. The delayed `visibility` keeps the panel in the
 * accessibility tree long enough for the fade-out to play. */
body > :where(header, footer) nav ul ul {
    position: absolute;
    min-width: 12rem;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    background-color: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px var(--site-shadow);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.4rem);
    transition: opacity 200ms ease, transform 200ms ease,
                visibility 0s linear 200ms;
}

/* Submenu entries fill the panel width and read left-aligned in both bars
 * (the footer's muted/lighter top-level colour does not cascade in here). */
body > :where(header, footer) nav ul ul a,
body > :where(header, footer) nav ul ul span,
body > :where(header, footer) nav ul ul button {
    border-radius: 5px;
    white-space: normal;
    text-align: left;
    font-weight: var(--typography-fontWeightMedium);
    color: var(--site-text);
}

/* Third level and deeper fly out to the side, aligned with the parent. */
body > :where(header, footer) nav ul ul ul {
    top: -0.35rem;
    right: 100%;
    left: auto;
    margin-right: 0.4rem;
    transform: translateX(0.4rem);
}

/* Reveal on hover, keyboard focus, or touch (.nav-open). */
body > :where(header, footer) nav li:hover > ul,
body > :where(header, footer) nav li:focus-within > ul,
body > :where(header, footer) nav li.nav-open > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 200ms ease, transform 200ms ease, visibility 0s;
}

/* Flyout panels land at translate(0) too (override the X offset). */
body > :where(header, footer) nav ul ul li:hover > ul,
body > :where(header, footer) nav ul ul li:focus-within > ul,
body > :where(header, footer) nav ul ul li.nav-open > ul {
    transform: translateX(0);
}

/* Shut by its disclosure button, over hover and focus alike. */
body > :where(header, footer) nav li.nav-closed > ul {
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, transform 200ms ease,
                visibility 0s linear 200ms;
}

body > :where(header, footer) nav li:has(> ul).nav-closed > :is(a, button)::after {
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    body > :where(header, footer) nav ul ul,
    body > :where(header, footer) nav li:has(> ul) > a::after,
    body > :where(header, footer) nav li:has(> ul) > span::after,
    body > :where(header, footer) nav li:has(> ul) > button::after {
        transition: none;
    }
}

/* ---- Header bar: hug the right, heavier weight ---- */
body > header > nav {
    flex: 0 0 auto;
    margin-left: auto; /* hug the right edge of the header row */
}

body > header > nav > ul {
    justify-content: flex-end;
}

/* Slightly heavier top-level items than the footer bar. */
body > header > nav > ul > li > a,
body > header > nav > ul > li > span,
body > header > nav > ul > li > button {
    padding: 0.6rem 1rem;
    font-size: 1.0625rem;
    font-weight: var(--typography-fontWeightBold);
    letter-spacing: 0.005em;
}

/* Header second level drops BELOW its item, right-aligned so a
 * right-justified bar never pushes a panel off-screen. */
body > header > nav > ul > li > ul {
    top: calc(100% + 0.4rem);
    right: 0;
    left: auto;
}

/* ---- Footer bar: static column groups, no drop-ups ---- */
body > footer > nav {
    margin: 0 0 1.5rem;
}

body > footer > nav > ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1.75rem 2.5rem;
    align-items: start;
    text-align: left;
}

/* Column heading. */
body > footer > nav > ul > li > a,
body > footer > nav > ul > li > span,
body > footer > nav > ul > li > button {
    padding: 0 0 0.15rem;
    margin-bottom: 0.55rem;
    font-size: 0.78rem;
    font-weight: var(--typography-fontWeightBold);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--site-dark-band-muted);
}

body > footer nav a:hover,
body > footer nav a:focus-visible,
body > footer nav span:focus-visible,
body > footer nav li > button:focus-visible {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--site-dark-band-link-hover);
}

/* The band is a constant dark (--site-dark-band) in both schemes, so the brand
 * outline every focusable thing in it would otherwise wear — a navy in light
 * mode — would disappear into it. The band's link hover instead: the colour the
 * focused nav text already takes, and the contrast gate holds it at 4.5:1 or
 * better on the band. Scheme tokens do not describe what is behind it. This
 * re-colours a content link in the band too (its outline is set further down). */
body > footer a:focus-visible,
body > footer menu button:focus-visible,
body > footer nav span:focus-visible,
body > footer nav li > button:focus-visible {
    outline-color: var(--site-dark-band-link-hover);
}

/* Footer submenu: a list in the flow, not a panel. */
body > footer nav ul ul {
    position: static;
    min-width: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
    background-color: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
}

/* Column links: list entries, not pills. */
body > footer nav ul ul :is(a, span, button) {
    padding: 0.15rem 0.4rem;
    margin-left: -0.4rem;
    font-size: 0.9rem;
    font-weight: var(--typography-fontWeightRegular);
}

/* No disclosure caret. */
body > footer nav li:has(> ul) > :is(a, span, button)::after {
    content: none;
}

/* Small-screen menu toggle (scripts.js builds it; no JS, no button). */
body > header > nav > button {
    display: none;
}

/* Narrow screens: disclosure menu. The nav overlies the logo row as a
 * subgrid to stay one landmark, so it passes clicks through to the logo. */
@media (max-width: 600px) {
    body > header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        align-items: center;
        row-gap: 0;
    }

    body > header > section {
        grid-column: 1;
        grid-row: 1;
    }

    body > header > nav {
        grid-column: 1 / -1;
        grid-row: 1 / span 2;
        display: grid;
        grid-template-columns: subgrid;
        grid-template-rows: subgrid;
        align-items: center;
        margin-left: 0;
        pointer-events: none;
    }

    body > header > nav > :is(button, ul) {
        pointer-events: auto;
    }

    body > header > nav > button {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        display: grid;
        place-items: center;
        min-width: 2.75rem;
        min-height: 2.75rem;
        padding: 0;
        border: 0;
        border-radius: 6px;
        background-color: transparent;
        color: var(--site-text);
        font: inherit;
        cursor: pointer;
    }

    /* Three bars drawn in the button's own colour. */
    body > header > nav > button::before {
        content: "";
        width: 1.5rem;
        height: 2px;
        background-color: currentColor;
        box-shadow: 0 -0.45rem 0 currentColor, 0 0.45rem 0 currentColor;
    }

    /* The "Menu" label names the button for assistive technology only. */
    body > header > nav > button > span {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    body > header > nav > ul {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    body > header > nav > button:focus-visible {
        outline: 2px solid var(--color-primary-fill);
        outline-offset: 2px;
    }

    /* Filled: the opened menu and its submenus sit in the band itself. */
    body > header[data-header-style="filled"] > nav > button,
    body > header[data-header-style="filled"] nav ul ul :is(a, span, button) {
        color: inherit;
    }

    body > header[data-header-style="filled"] nav ul ul :is(a, span, button):is(:hover, :focus-visible) {
        background-color: var(--site-header-band-hover);
        color: inherit;
    }

    body > header[data-header-style="filled"] > nav > button:focus-visible,
    body > header[data-header-style="filled"] nav ul ul :is(a, span, button):focus-visible {
        outline-color: currentColor;
    }

    body > header > nav:has(> button[aria-expanded='false']) > ul {
        display: none;
    }

    body > header > nav > ul {
        justify-content: flex-start;
        flex-direction: column;
        align-items: stretch;
        margin-top: 0.5rem;
        gap: 0.1rem;
    }

    body > header nav ul ul {
        position: static;
        min-width: 0;
        margin-left: 0.85rem;
        padding: 0;
        background-color: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
    }

    /* No disclosure caret: the submenus are already open. */
    body > header nav li:has(> ul) > :is(a, span, button)::after {
        content: none;
    }
}

/* ============= Page chrome — header, main, footer =============
 * Default theme keeps content away from the viewport edges via
 * fluid left/right padding on the three top-level page regions, and
 * marks the footer with a subtle background tint + centred contents
 * so the visual end of the page is clear.
 *
 * clamp(min, fluid, max) keeps the side padding readable on phones
 * (1rem) and from getting absurd on wide displays (3rem at 4vw).
 */

/* Sticky footer: make the body a full-height flex column so <main>
 * absorbs any spare vertical space. On a short page this anchors the
 * footer to the bottom of the viewport; on a long page the footer sits
 * below the fold and scrolls into view normally. svh (with a vh
 * fallback) measures the small viewport so the footer is never hidden
 * behind mobile browser chrome on a short page. */
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    /* 100vw counts a classic scrollbar, so clip the few px a bleed overshoots. */
    overflow-x: clip;
}

body > header,
main,
body > footer {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
}

/* Breathing room at the top of <main> so (a) the header's drop
 * shadow has somewhere to land instead of being covered by the
 * first content element, and (b) full-bleed-ish content (hero
 * images, carousels) doesn't slam against the header's bottom
 * accent rule. */
main {
    /* Grow to fill the spare height in the body flex column (sticky
     * footer); flex-shrink 0 keeps content from being squeezed. */
    flex: 1 0 auto;
    padding-top: 1.5rem;
}

/* ============= Sidebar layout =============
 * When a page resolves an effective sidebar (its own cms.sidebar, or one
 * inherited from a URL ancestor), layout.ftlh wraps <main> and an <aside> in a
 * flex-row <div> — the only body > div that carries an <aside>. The content
 * column flexes to fill; the sidebar is a fixed-width (25rem) rail on the right, set
 * off by a divider so the page region reads as two sections. On narrow
 * viewports the row stacks and the rail drops below the content. Class-free —
 * :has() selects the wrapper off the <aside> the template emits (:has() is
 * already a baseline dependency of this theme; see the nav rules above). */
body > div:has(> aside) {
    display: flex;
    flex: 1 0 auto; /* take <main>'s old role in the body flex column */
    align-items: flex-start;
    gap: clamp(1.5rem, 3vw, 2.5rem);
}
body > div:has(> aside) > main {
    flex: 1 1 auto;
    min-width: 0; /* let the content shrink instead of overflowing the row */
    padding-right: 0; /* the gap + aside provide the right-hand gutter */
}
body > div:has(> aside) > aside {
    /* One rail width on every page: a fixed content box, not its content's
     * min-content, so a long title wraps instead of widening the rail; the
     * gutter pads it outside. */
    flex: 0 0 auto;
    width: 25rem;
    min-width: 0;
    box-sizing: content-box;
    padding-top: 1.5rem;
    padding-left: clamp(1.5rem, 3vw, 2.5rem);
    padding-right: var(--page-gutter);
    border-left: 1px solid var(--site-border);
}
/* Sidebar components render at the card format; space them down the rail. */
body > div:has(> aside) > aside > [data-cms-e] {
    display: block;
    margin: 0 0 1.5rem 0;
}
/* One even gap down the rail: [data-sn][data-fmt] out-specifies each subtype's own margin,
 * a format's included ([data-sn="cms-event"][data-fmt="card"]). */
body > div:has(> aside) > aside > [data-cms-e][data-sn][data-fmt] {
    margin: 0 0 1.5rem 0;
}

/* Rail simple-cta: a compact tile. */
body > div:has(> aside) > aside [data-cms-e][data-sn="simple-cta"] {
    min-height: 0;
    padding: 1.25rem 1rem;
}
body > div:has(> aside) > aside [data-cms-e][data-sn="simple-cta"] > h3 {
    font-size: var(--type-h3);
}
body > div:has(> aside) > aside [data-cms-e][data-sn="simple-cta"] > h3:has(+ [data-cms-a][data-atype="text"])::after {
    width: 3rem;
    margin: 0.5rem auto;
}
body > div:has(> aside) > aside [data-cms-e][data-sn="simple-cta"] > [data-cms-a][data-atype="text"] {
    font-size: 0.875rem;
}

/* Rail web-event-listing: an unstriped ledger of small date stub, linked title
 * and venue name; the ticket link and venue address are dropped. */
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > header {
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin: 0 0 0.5rem 0;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > header::after {
    content: none;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > header > h2 {
    font-size: var(--type-h3);
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > header > a {
    font-size: 0.8125rem;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li:nth-child(even) {
    background-color: transparent;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li:last-child {
    border-bottom: none;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li > [data-cms-e][data-sn="cms-event"] {
    gap: 0.75rem;
    padding: 0.6rem 0.25rem;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li > [data-cms-e][data-sn="cms-event"] > p {
    flex-basis: 3.4rem;
    margin: 0;
    padding: 0.3rem 0.2rem 0.25rem;
    border-top-width: 2px;
    gap: 0;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li > [data-cms-e][data-sn="cms-event"] > p > time:nth-of-type(1) {
    font-size: 0.55rem;
    letter-spacing: 0.12em;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li > [data-cms-e][data-sn="cms-event"] > p > time:nth-of-type(2) {
    font-size: 1.2rem;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li > [data-cms-e][data-sn="cms-event"] > p > time:nth-of-type(3) {
    font-size: 0.55rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li > [data-cms-e][data-sn="cms-event"] > div > h3 {
    margin: 0.125rem 0 0 0;
    font-size: 1rem;
    line-height: 1.25;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li > [data-cms-e][data-sn="cms-event"] > div > address {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-style: normal;
    font-size: 0.8125rem;
}
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li > [data-cms-e][data-sn="cms-event"] > div > address > [data-an="cms.event.venue-address"],
body > div:has(> aside) > aside > [data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li > [data-cms-e][data-sn="cms-event"] > div > div {
    display: none;
}
/* With a sidebar present the lead image / title-overlay figure must NOT
 * full-bleed at all: a bleed pulls the left edge out to the page margin while
 * the right edge butts the content edge (the gap + divider provide the
 * right-hand gutter), reading as padding on one side only. Drop both negative
 * margins so the image sits flush inside the content box with symmetric
 * gutters on each side, matching how a text-highlight block aligns. */
body > div:has(> aside) > [data-cms-e][data-sn="simple-page"] > [data-cms-a] > figure[data-sn="image"]:first-of-type,
body > div:has(> aside) > [data-cms-e][data-sn="simple-page"] > figure {
    margin-left: 0;
    margin-right: 0;
}
/* When a sidebar page shows a title at the top of its body, drop the rail so
 * it starts below the title (its box top = the title's bottom) rather than
 * level with it. Each offset is matched to the title block above it: <main>'s
 * 1.5rem top padding, the title's top margin, a one-line h1 (a long wrapping
 * title may sit a little higher) and, on a landing page, the ornament.
 * Simple Page renders its title as a leading <h1>; a Landing Page shows one
 * only via a page-title-marker as its first row — overlay-title pages have no
 * separate title box, so they intentionally don't match. Side by side only. */
@media (min-width: 48.0625rem) {
    body:not(:has(> header[data-header-style="filled"])) > div:has(> aside) > [data-cms-e][data-sn="simple-page"]:has(> h1:first-of-type) + aside {
        margin-top: calc(clamp(1.875rem, 1.25rem + 2.5vw, 2.75rem) * 1.15 + 1.5rem);
    }

    body:not(:has(> header[data-header-style="filled"])) > div:has(> aside) > [data-cms-e][data-sn="landing-page"]:has(> [data-cms-a] > [data-cms-e][data-sn="page-title-marker"]:first-child) + aside {
        margin-top: calc(1.5rem + var(--section-gap) * 0.6 + clamp(1.875rem, 1.25rem + 2.5vw, 2.75rem) * 1.15 + 0.75rem + 0.975rem);
    }

    body > div:has(> aside) > [data-cms-e][data-sn="landing-page"]:has(> [data-cms-a] > [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="page-title-marker"]) + aside {
        margin-top: calc(1.5rem + var(--section-gap) + clamp(1.875rem, 1.25rem + 2.5vw, 2.75rem) * 1.15 + 0.75rem + 0.975rem);
    }

    /* Band: hairline, 2rem and 2.25rem padding, a one-line h1. */
    body:has(> header[data-header-style="filled"]) > div:has(> aside) > [data-cms-e][data-sn="simple-page"]:has(> h1:first-child) + aside,
    body:has(> header[data-header-style="filled"]) > div:has(> aside) > [data-cms-e][data-sn="landing-page"]:has(> [data-cms-a] > [data-cms-e][data-sn="page-title-marker"]:first-child) + aside {
        margin-top: calc(1px + 4.25rem + clamp(1.875rem, 1.25rem + 2.5vw, 2.75rem) * 1.15);
    }

    /* Beside the rail a landing row's carousel or text highlight does not
     * bleed: <main> has no right-hand gutter to cancel, so the band stays in
     * the content column and its text keeps the component's own padding. */
    body > div:has(> aside) > [data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="content-carousel"], [data-sn="text-highlight"]) {
        margin-inline: 0;
        width: auto;
    }

    body > div:has(> aside) article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header,
    body > div:has(> aside) > [data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]):is([data-fmt="feature"], [data-fmt="full"]) {
        margin-inline: 0;
        width: auto;
        padding-inline: 2rem;
    }

    body > div:has(> aside) > [data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]),
    body > div:has(> aside) > main [data-cms-e][data-sn="text-highlight"][data-fmt="feature"] > div:not([aria-hidden]) {
        padding-inline: 2rem;
    }

    body > div:has(> aside) > [data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div:not([aria-hidden]) {
        padding-inline: 3rem;
    }
}
@media (max-width: 48rem) {
    body > div:has(> aside) {
        flex-direction: column;
        gap: 0;
    }
    body > div:has(> aside) > main {
        padding-right: var(--page-gutter);
    }
    body > div:has(> aside) > aside {
        flex: 1 1 auto;
        width: 100%;
        box-sizing: border-box;
        margin-top: 1.5rem;
        padding-left: var(--page-gutter);
        border-left: none;
        border-top: 1px solid var(--site-border);
    }
}

/* The app menu's Sign out and the restricted page's Sign out: a form submit styled as a link. */
footer menu form {
    display: contents;
}

:where(footer menu button, main form[action="/logout"] > button) {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

/* Content-area hyperlinks. Browser defaults read fine in light mode
 * but turn unreadable in dark mode (default link blue against a dark
 * surface). Use --color-primary-link which the token system already maps
 * light/dark, and a slightly-thicker underline that grows on hover.
 *
 * Wrapped in :where() so this rule has zero specificity — any
 * component-specific link styling (simple-cta title `color: inherit`,
 * the CTA-button rules below, etc.) wins without needing !important.
 * Button-shaped anchors are styled by their semantic context further
 * down, and those rules carry real specificity so they override this. */
:where(main, footer, body > section) a,
:where(footer menu button, main form[action="/logout"] > button) {
    color: var(--color-primary-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
    transition: color 150ms ease, text-decoration-thickness 150ms ease;
}

:where(main, footer, body > section) a:hover,
:where(main, footer, body > section) a:focus-visible,
:where(footer menu button, main form[action="/logout"] > button):hover,
:where(footer menu button, main form[action="/logout"] > button):focus-visible {
    color: var(--color-primary-link-hover);
    text-decoration-thickness: 2px;
}

/* The pair above changes the link itself — a darker ink and one more pixel of
 * underline — which reads the same whether the pointer is on it or the keyboard
 * is. Focus gets its own indicator, the outline the header nav already uses;
 * inside the page-closing band the rule above re-colours it to the band's link hover. */
:where(main, footer) a:focus-visible,
:where(footer menu button, main form[action="/logout"] > button):focus-visible {
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 2px;
}

/* Dark ink footer in BOTH colour schemes — the page closes on a
 * house-lights-down band (riverside plan §1.5). The constant
 * --site-dark-band group rather than the scheme-flipping tokens, same
 * reasoning as the overlay palette: this surface is dark by design,
 * not by preference. Scoped to the page's own footer: a card's <footer>
 * draws its own band. */
body > footer {
    text-align: center;
    background-color: var(--site-dark-band);
    border-top: none;
    padding-top: 2.75rem;
    padding-bottom: 2.25rem;
    margin-top: 0;
    color: var(--site-dark-band-muted);
    font-size: 0.92rem;
}

/* Colophon: hairline above the copyright line. Quieter than the band's own
 * text, but this line is 12.8px, so the dimming stops at 4.5:1 against the
 * band — WCAG AA for text this size; the contrast gate holds it. */
body > footer > div {
    margin: 1.25rem 0 0.25rem 0;
    border-top: 1px solid #2a3140;
    padding-top: 1.2rem;
    font-size: 0.8rem;
    color: var(--site-dark-band-faint);
}

/* Links inside the dark band: quiet silver, the band's link hover — override
 * the light-surface link + nav-pill colours scoped to the footer. */
body > footer a,
body > footer nav span,
body > footer nav li > button,
body > footer menu button {
    color: var(--site-dark-band-text);
}

body > footer a:hover,
body > footer a:focus-visible,
body > footer menu button:hover,
body > footer menu button:focus-visible {
    color: var(--site-dark-band-link-hover);
    background-color: transparent;
}

body > footer nav ul ul :is(a, span, button) {
    color: var(--site-dark-band-text);
}

footer menu {
    list-style: none;
    margin: 0.5rem 0 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
}

footer menu li {
    margin: 0;
}

/* Footer content (cms.site.footer-content): its own band between the page and
 * the footer, its text on the page content edge. */
body > section {
    padding: 2.5rem var(--page-gutter);
    background-color: var(--site-surface-alt);
    border-top: 1px solid var(--site-border);
    color: var(--site-text);
}

body > section :is(p, h2, h3, h4) {
    margin-block: 0;
}

body > section :is(h2, h3, h4) {
    margin-bottom: 0.35rem;
    font-size: var(--type-h3);
}

/* Flat footer menu (no entry has children). `order` puts the copyright ahead
 * of the <nav> it follows in the markup; the slashes carry empty alt text so
 * they are not announced. The copyright takes at most 40% of the row and
 * wraps beyond it, so a long signed-in handle cannot push the row past the
 * viewport. */
body > footer:has(> nav > ul):not(:has(> nav ul ul)) {
    display: grid;
    grid-template-columns: fit-content(40%) minmax(0, 1fr) auto;
    align-items: center;
    row-gap: 0.75rem;
    font-size: var(--type-eyebrow);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body > footer:has(> nav > ul):not(:has(> nav ul ul)) > div {
    order: -1;
    margin: 0 2rem 0 0;
    padding: 0;
    border-top: none;
    font-size: inherit;
    text-align: left;
    overflow-wrap: anywhere;
}

body > footer:has(> nav > ul):not(:has(> nav ul ul)) > nav {
    margin: 0;
}

body > footer:has(> nav > ul):not(:has(> nav ul ul)) > nav > ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0;
}

body > footer:has(> nav > ul):not(:has(> nav ul ul)) > menu {
    margin: 0;
    gap: 0;
}

body > footer:has(> nav > ul):not(:has(> nav ul ul)) :is(nav > ul, menu) > li {
    display: flex;
    align-items: center;
}

body > footer:has(> nav > ul):not(:has(> nav ul ul)) > nav > ul > li > :is(a, span, button),
body > footer:has(> nav > ul):not(:has(> nav ul ul)) > menu > li :is(a, button) {
    margin: 0;
    padding: 0.25rem 0.4rem;
    font-size: inherit;
    font-weight: var(--typography-fontWeightRegular);
    letter-spacing: inherit;
    text-transform: inherit;
    text-decoration: none;
    color: var(--site-dark-band-text);
}

body > footer:has(> nav > ul):not(:has(> nav ul ul)) > nav > ul > li + li::before,
body > footer:has(> nav > ul):not(:has(> nav ul ul)) > menu > li::before {
    content: "/" / "";
}

/* Narrow: the row stacks, centred. */
@media (max-width: 768px) {
    body > footer:has(> nav > ul):not(:has(> nav ul ul)) {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
    }

    body > footer:has(> nav > ul):not(:has(> nav ul ul)) > div {
        margin: 0;
        text-align: center;
    }

    body > footer:has(> nav > ul):not(:has(> nav ul ul)) > nav > ul {
        justify-content: center;
    }

    body > footer:has(> nav > ul):not(:has(> nav ul ul)) > menu > li:first-child::before {
        content: none;
    }
}

/* Slight rounding on content images. Subtle by design — enough to
 * soften the corner without looking decorative. Per-component CSS
 * (the content-carousel slide bg below, for instance) overrides
 * back to 0 where edge-to-edge rendering is the point. */
main img {
    border-radius: var(--radius-sm);
}

/* ============= Buttons — public-site CTA anchors =============
 * The public theme has no .button class (semantic markup only). CTA
 * anchors are identified by their semantic context — the carousel-slide
 * action <nav>, a cover's action <nav> and the for-sale-cta
 * <footer>. Primary
 * (solid) vs secondary (outlined) is by DOM position within a multi-
 * action group; a lone CTA renders primary. Colours use theme tokens.
 *
 * inline-flex so the label centres against the padding and button
 * groups lay out via the parent's flex layout.
 */
[data-cms-e][data-sn="content-carousel-slide"] nav a,
[data-cms-e][data-sn="for-sale-cta"] > footer a,
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] nav a,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] nav a,
[data-cms-e][data-sn="cms-event"]:not([data-fmt="full"], [data-fmt="card"]) nav a,
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > nav a {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: var(--typography-fontWeightMedium);
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

[data-cms-e][data-sn="content-carousel-slide"] nav a:hover,
[data-cms-e][data-sn="content-carousel-slide"] nav a:focus-visible,
[data-cms-e][data-sn="for-sale-cta"] > footer a:hover,
[data-cms-e][data-sn="for-sale-cta"] > footer a:focus-visible,
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] nav a:hover,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] nav a:hover,
[data-cms-e][data-sn="cms-event"]:not([data-fmt="full"], [data-fmt="card"]) nav a:hover,
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] nav a:focus-visible,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] nav a:focus-visible,
[data-cms-e][data-sn="cms-event"]:not([data-fmt="full"], [data-fmt="card"]) nav a:focus-visible,
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > nav a:hover,
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > nav a:focus-visible {
    text-decoration: none;
}

/* The pair above is the button's own fill and border darkening, identical under
 * the pointer. The focus ring is separate, and over a photo it is the overlay
 * border rather than a brand colour, for the reason the carousel dots give. */
[data-cms-e][data-sn="content-carousel-slide"] nav a:focus-visible,
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] nav a:focus-visible,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] nav a:focus-visible,
[data-cms-e][data-sn="cms-event"]:not([data-fmt="full"], [data-fmt="card"]) nav a:focus-visible,
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > nav a:focus-visible {
    outline: 2px solid var(--site-overlay-control-border);
    outline-offset: 2px;
}

/* Primary (solid) — the first / lone action in a group. CTAs wear the
 * accent, not the brand blue: over a photo a solid accent fill is the
 * only treatment that stays legible on any image, and
 * the card-context CTAs match so "the brass button is the action" reads
 * site-wide. Over a photo the fill is the --site-photo-cta group. */
[data-cms-e][data-sn="content-carousel-slide"] nav a:first-child,
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] nav a:first-child,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] nav a:first-child,
[data-cms-e][data-sn="cms-event"]:not([data-fmt="full"], [data-fmt="card"]) nav a:first-child,
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > nav a:first-child {
    background-color: var(--site-photo-cta);
    color: var(--site-photo-cta-ink);
    border-color: var(--site-photo-cta);
    font-weight: var(--typography-fontWeightMedium);
    letter-spacing: 0.03em;
}

[data-cms-e][data-sn="content-carousel-slide"] nav a:first-child:hover,
[data-cms-e][data-sn="content-carousel-slide"] nav a:first-child:focus-visible,
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] nav a:first-child:hover,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] nav a:first-child:hover,
[data-cms-e][data-sn="cms-event"]:not([data-fmt="full"], [data-fmt="card"]) nav a:first-child:hover,
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] nav a:first-child:focus-visible,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] nav a:first-child:focus-visible,
[data-cms-e][data-sn="cms-event"]:not([data-fmt="full"], [data-fmt="card"]) nav a:first-child:focus-visible,
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > nav a:first-child:hover,
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > nav a:first-child:focus-visible {
    background-color: var(--site-photo-cta-hover);
    border-color: var(--site-photo-cta-hover);
}

[data-cms-e][data-sn="for-sale-cta"] > footer a {
    background-color: var(--color-accent-fill);
    color: var(--color-accent-text-on-fill);
    border-color: var(--color-accent-fill);
    font-weight: var(--typography-fontWeightMedium);
    letter-spacing: 0.03em;
}

[data-cms-e][data-sn="for-sale-cta"] > footer a:hover,
[data-cms-e][data-sn="for-sale-cta"] > footer a:focus-visible {
    background-color: var(--color-accent-fill-hover);
    border-color: var(--color-accent-fill-hover);
}

/* Secondary — the second action in a slide's <nav>. Sits over a photo,
 * so it is "quiet": white label + white outline over the scrim, never a
 * brand-colour outline that vanishes on a dark image. */
[data-cms-e][data-sn="content-carousel-slide"] nav a:nth-child(2),
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] nav a:nth-child(2),
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] nav a:nth-child(2),
[data-cms-e][data-sn="cms-event"]:not([data-fmt="full"], [data-fmt="card"]) nav a:nth-child(2),
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > nav a:nth-child(2) {
    background-color: transparent;
    color: var(--site-overlay-text);
    border: 1.5px solid var(--site-overlay-control-border);
}

[data-cms-e][data-sn="content-carousel-slide"] nav a:nth-child(2):hover,
[data-cms-e][data-sn="content-carousel-slide"] nav a:nth-child(2):focus-visible,
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] nav a:nth-child(2):hover,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] nav a:nth-child(2):hover,
[data-cms-e][data-sn="cms-event"]:not([data-fmt="full"], [data-fmt="card"]) nav a:nth-child(2):hover,
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] nav a:nth-child(2):focus-visible,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] nav a:nth-child(2):focus-visible,
[data-cms-e][data-sn="cms-event"]:not([data-fmt="full"], [data-fmt="card"]) nav a:nth-child(2):focus-visible,
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > nav a:nth-child(2):hover,
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > nav a:nth-child(2):focus-visible {
    background-color: rgba(255, 255, 255, 0.16);
    color: var(--site-overlay-text);
}

/* Disabled CTA (aria-disabled, no href). */
[data-cms-e][data-sn="content-carousel-slide"] nav a[aria-disabled="true"],
[data-cms-e][data-sn="for-sale-cta"] > footer a[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============= "Read more" CTA on embedded articles =============
 * An article with a public address (a slug beneath its subtype's template page)
 * closes its embedded / feature / card render with a direct-child <a> linking to
 * its own page. Targeted structurally — no class, per the theme's
 * semantic-markup contract — as a text-style call to action with a trailing
 * arrow. full.ftlh omits the link (the reader is already on the article page),
 * so this paints only on the embedded forms. data-sn matches both the canonical
 * and webcontent etypes; bio renders through the article templates, so
 * every article rule below names it too.
 */
[data-cms-e]:is([data-sn="article"], [data-sn="bio"]) > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    font-family: inherit;
    font-weight: var(--typography-fontWeightMedium);
    color: var(--color-primary-link);
    text-decoration: none;
}

[data-cms-e]:is([data-sn="article"], [data-sn="bio"]) > a::after {
    content: "\2192"; /* → */
    transition: transform 150ms ease;
}

[data-cms-e]:is([data-sn="article"], [data-sn="bio"]) > a:hover,
[data-cms-e]:is([data-sn="article"], [data-sn="bio"]) > a:focus-visible {
    text-decoration: underline;
}

[data-cms-e]:is([data-sn="article"], [data-sn="bio"]) > a:focus-visible {
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 2px;
}

[data-cms-e]:is([data-sn="article"], [data-sn="bio"]) > a:hover::after,
[data-cms-e]:is([data-sn="article"], [data-sn="bio"]) > a:focus-visible::after {
    transform: translateX(2px);
}

/* ============= CMS Media =============
 * Public-site render of <@kds.render etype="media" ... />.
 * Targets the entity-wrapper data-* attributes the template emits via
 * <@kds.entityAttrs /> — the default theme intentionally adds no
 * classes to media templates, so attribute selectors are the contract.
 * See doc/architecture/rendering-model.md § Themes ("The default theme
 * intentionally introduces no classes.")
 */
[data-cms-e][data-etype="media"] {
    margin: 0 0 1rem 0;
    padding: 0;
}

[data-cms-e][data-etype="media"] img,
[data-cms-e][data-etype="media"] video {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 0.25rem;
}

[data-cms-e][data-etype="media"] figcaption {
    font-size: 0.875rem;
    color: var(--site-text-muted);
    margin-top: 0.25rem;
}

/* ============= Content Carousel =============
 * Public-site render of <@kds.render etype="webcontent" sn="content-carousel" />
 * and its slides: every entity in the cms.slides slot, of any subtype,
 * dispatched at cover. JS in scripts.js handles rotation; CSS here owns
 * layout, background sizing/positioning, and the read-only "view not
 * supported" placeholder.
 *
 * Selectors target the data-cms-e[data-sn="..."] wrapper emitted by
 * <@kds.entityAttrs /> per the rendering-model convention — the default
 * theme intentionally introduces no classes (see doc/architecture/rendering-model.md
 * § Themes, and the existing media block above for the same pattern).
 * The background layer is the slide's aria-hidden <div>; the foreground
 * is the plain content <div> — targeted via [aria-hidden] /
 * :not([aria-hidden]). Author presentation (colour / opacity / layout /
 * bg sizing) is bound per slide to its [data-eid] by the head-injected
 * PresentationCssService CSS. Description renders into its auto-emitted
 * [data-cms-a][data-atype="text"] wrapper; CTA buttons
 * live inside a semantic <nav>.
 * The .button primary/secondary classes on slide CTAs are the app-wide
 * button primitive (from app/components.css) — they're a global UI
 * contract, not theme markup.
 */
[data-cms-e][data-sn="content-carousel"] {
    position: relative;
    /* Vertical panning and pinch stay the browser's; a horizontal drag
     * reaches the swipe handler in scripts.js. */
    touch-action: pan-y pinch-zoom;
    width: 100%;
    /* The slides slot's heights read the stage width (cqi). */
    container-type: inline-size;
    overflow: hidden;
    margin: 0 0 1rem 0;
    background-color: #000;
}

/* The slides stack in one grid cell, so the stage is at least 16/9 and
 * grows to its tallest slide's text instead of clipping it. */
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] {
    display: grid;
    min-height: calc(100cqi * 9 / 16);
}

/* Landing hero band: at the feature format the carousel is the page's
 * opening statement — a stage-height band, never below the floor, its
 * 16/9 growth capped so it never fills a tall or wide window. */
[data-cms-e][data-sn="content-carousel"][data-fmt="feature"] > [data-cms-a][data-an="cms.slides"] {
    min-height: max(var(--carousel-stage-floor), min(100cqi * 9 / 16, var(--carousel-stage-cap-height), var(--carousel-stage-cap-width)));
}

/* ============= Landing-page rhythm =============
 * A landing page is a programme of rows; give each row section-scale
 * air instead of the component default 1rem/1.5rem bottom margins.
 * Full-bleed bands: the carousel and photo-backed highlights cancel
 * <main>'s side padding (--page-gutter, shared with the
 * `body > header, main, footer` padding rule above) so the page
 * alternates full-width stage-lights bands with contained content.
 */
[data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e] {
    margin-block: var(--section-gap);
}

[data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="content-carousel"],
[data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="text-highlight"],
[data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]):is([data-fmt="feature"], [data-fmt="full"]) {
    margin-left: calc(-1 * var(--page-gutter));
    margin-right: calc(-1 * var(--page-gutter));
    width: calc(100% + 2 * var(--page-gutter));
}

@media (min-width: 86rem) {
    [data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div:not([aria-hidden]),
    [data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]) {
        padding-inline: var(--page-gutter);
    }
}

/* A first row that opens with a cover docks against the header: cancel
 * <main>'s top padding and the row's top margin so the band starts the
 * page. The row's first-child cover sits one level down — a carousel's
 * slides slot, an event's header band. A zero-height invisible-title-marker
 * ahead of the row must not break the dock — tolerate it as an ignorable
 * first row. */
main[data-cms-e][data-sn="landing-page"]:has(> [data-cms-a] > [data-cms-e]:first-child > * > :is([data-cms-e][data-fmt="cover"], [data-cms-e][data-sn="cms-event"][data-fmt="full"] > header):first-child),
main[data-cms-e][data-sn="landing-page"]:has(> [data-cms-a] > [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e] > * > :is([data-cms-e][data-fmt="cover"], [data-cms-e][data-sn="cms-event"][data-fmt="full"] > header):first-child) {
    padding-top: 0;
}

[data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:first-child:has(> * > :is([data-cms-e][data-fmt="cover"], [data-cms-e][data-sn="cms-event"][data-fmt="full"] > header):first-child),
[data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e]:has(> * > :is([data-cms-e][data-fmt="cover"], [data-cms-e][data-sn="cms-event"][data-fmt="full"] > header):first-child) {
    margin-top: 0;
}

/* Carousel navigation dots — overlay at bottom-middle, one button per
 * slide. Injected by scripts.js into the carousel root. Active dot
 * (aria-current="true") is the solid one; inactive dots are
 * semi-transparent white. Above the slides via z-index so clicks
 * actually reach the buttons. */
[data-cms-e][data-sn="content-carousel"] > [data-cms-carousel-dots] {
    position: absolute;
    left: 50%;
    bottom: 0.75rem;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
}

/* Slide indicators as slim bars (programme-line idiom), brass when
 * active; a bar reads as "position in a sequence" where a dot reads
 * as "decoration". */
[data-cms-e][data-sn="content-carousel"] > [data-cms-carousel-dots] > button {
    appearance: none;
    margin: 0;
    padding: 0;
    width: 2.125rem;
    height: 0.1875rem;
    border-radius: 2px;
    border: none;
    background: var(--site-overlay-control-bg);
    cursor: pointer;
    transition: background-color 200ms ease;
}

[data-cms-e][data-sn="content-carousel"] > [data-cms-carousel-dots] > button:hover,
[data-cms-e][data-sn="content-carousel"] > [data-cms-carousel-dots] > button:focus-visible {
    background: var(--site-overlay-control-bg-hover);
}

/* Bars sit over a photo of unpredictable brightness — the overlay
 * border token (already used for the secondary slide CTA) stays
 * legible on any image, unlike a brand-colour outline. */
[data-cms-e][data-sn="content-carousel"] > [data-cms-carousel-dots] > button:focus-visible {
    outline: 2px solid var(--site-overlay-control-border);
    outline-offset: 2px;
}

[data-cms-e][data-sn="content-carousel"] > [data-cms-carousel-dots] > button[aria-current="true"] {
    /* Not the scheme-flipping accent token: the bar sits on a photo in
     * both modes (overlay-token reasoning). */
    background: var(--site-photo-current);
}

/* The stage owns the slide's box, whatever margin, height or radius the
 * slide's own cover gives it standalone. */
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] {
    position: relative;
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
    margin: 0;
    min-height: 0;
    border-radius: 0;
}

/* Contrast scrim — a layer between the background image (z-0) and the
 * content (z-2) that keeps the title/subtitle/buttons legible over any
 * photo, regardless of the per-slide bg-color tint and text position
 * (systemic rule: text over imagery always sits on a
 * scrim token). --scrim-full because the author may anchor the text
 * anywhere in the nine-position grid. It is NOT inside the aria-hidden
 * layer, so the author's bg-image-opacity does not fade it. Drawn only over
 * an image: a slide without one shows its own colours undarkened. */
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e]:has(> div[aria-hidden="true"])::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: var(--scrim-full);
}

[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div[aria-hidden="true"] {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* The ref's attribute wrapper sits between the layer and the media; it
 * fills too, or the image's height: 100% resolves to its intrinsic ratio. */
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div[aria-hidden="true"] > [data-cms-a],
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div[aria-hidden="true"] [data-cms-e][data-etype="media"] {
    width: 100%;
    height: 100%;
    margin: 0;
}

/* Background image object-fit (bg-style) and object-position
 * (bg-alignment) are author choices, bound per slide to its [data-eid]
 * by the head-injected PresentationCssService CSS. :where() keeps this
 * cover / center-center default below that binding. */
:where([data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"]) > [data-cms-e] > div[aria-hidden="true"] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
    display: block;
}

/* Slide text position (a nine-anchor grid: center / left-top / right-
 * bottom / ...) is an author choice, bound per slide to its [data-eid] by
 * the head-injected PresentationCssService CSS — it sets align-items,
 * justify-content, and text-align on this content column, so :where()
 * keeps this rule below it. */
:where([data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"]) > [data-cms-e] > div:not([aria-hidden]) {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Title is h2, not h1 — a carousel keeps every slide in the DOM at once, so
 * a blanket h1 per slide would multiply the page's h1 count. */
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div:not([aria-hidden]) h2 {
    margin: 0 0 0.75rem 0;
    font-size: var(--type-display);
    font-weight: 600;
    line-height: 1.08;
    max-width: 18ch;
}
/* Subtitle renders ABOVE the title as a small eyebrow/kicker (see the
 * slide template). Uppercase + letter-spacing differentiate it from the
 * h2 without relying on document heading order. The photo eyebrow, not
 * the accent token: it sits over a photo, so it stays constant across
 * colour schemes like the overlay tokens. */
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div:not([aria-hidden]) h3 {
    margin: 0 0 1rem 0;
    font-family: var(--typography-font-family), "Helvetica Neue", Arial, sans-serif;
    font-size: var(--type-eyebrow);
    line-height: 1.2;
    font-weight: var(--typography-fontWeightMedium);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--site-photo-eyebrow);
}
/* Description: the cms.description-html attribute reaches the foreground column
 * as the auto-emitted [data-cms-a][data-atype="text"] wrapper. Keyed on the
 * cover format as well as the stage, so a cover standing alone — a page's top
 * slot, the format preview — reads the way it does on a carousel. */
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div:not([aria-hidden]) > [data-cms-a][data-atype="text"],
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > [data-cms-a][data-atype="text"] {
    margin: 0 0 1rem 0;
    max-width: 60ch;
}
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div:not([aria-hidden]) > [data-cms-a][data-atype="text"] p,
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) > [data-cms-a][data-atype="text"] p {
    margin: 0 0 0.5em 0;
}
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div:not([aria-hidden]) > nav {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Text Position "artwork" */
[data-cms-e][data-sn="content-carousel-slide"] > div:not([aria-hidden]):has(> [data-cms-a][data-an="cms.slide.bg-image"] img:not([alt=""])) > :is(h2, h3, [data-cms-a][data-atype="text"]):not(:focus-within) {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

[data-cms-e][data-sn="content-carousel-slide"] > div:not([aria-hidden]) > [data-cms-a][data-an="cms.slide.bg-image"] {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

[data-cms-e][data-sn="content-carousel-slide"] > div:not([aria-hidden]) > [data-cms-a][data-an="cms.slide.bg-image"] figure {
    height: 100%;
    margin: 0;
}

[data-cms-e][data-sn="content-carousel-slide"] > div:not([aria-hidden]) > [data-cms-a][data-an="cms.slide.bg-image"] img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div:not([aria-hidden]) > [data-cms-a][data-an="cms.slide.bg-image"] {
    position: relative;
    flex-basis: 0;
}

[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div:not([aria-hidden]) > [data-cms-a][data-an="cms.slide.bg-image"] img {
    position: absolute;
    inset: 0;
}

[data-cms-e][data-sn="content-carousel-slide"] > div:not([aria-hidden]) > [data-cms-a][data-an="cms.slide.bg-image"] figcaption {
    display: none;
}

[data-cms-e][data-sn="content-carousel-slide"] > div:not([aria-hidden]):has(> [data-cms-a][data-an="cms.slide.bg-image"]) > nav {
    justify-content: center;
}

/* ============= Simple Page title overlay =============
 * When cms.title-position is set, simple-page/full.ftlh renders the lead image
 * as a backdrop with the title overlaid — the carousel-slide idiom: a
 * positioned <figure> holding an aria-hidden image layer (z-0), a contrast
 * scrim (z-1), and a foreground heading column (z-2). The nine-anchor
 * placement (align-items / justify-content / text-align) is bound per page to
 * its [data-eid] by PresentationCssService. When the attribute is blank none
 * of this applies — the page renders the title above the image as normal.
 * The image layer is always emitted; the scrim is drawn only when it holds an
 * image, and without one the band is the brand fill with its text-on-fill colour. */
[data-cms-e][data-sn="simple-page"] > figure {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    min-height: clamp(16rem, 38vw, 26rem);
    /* full-bleed to the page-content edges (cancels <main>'s side padding) */
    margin: 0 calc(-1 * var(--page-gutter)) 1.5rem;
    border-radius: 4px;
    background-color: var(--color-primary-fill);
}
[data-cms-e][data-sn="simple-page"] > figure:has(> div[aria-hidden="true"] img)::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: var(--scrim-full);
}
[data-cms-e][data-sn="simple-page"] > figure > div[aria-hidden="true"] {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
[data-cms-e][data-sn="simple-page"] > figure > div[aria-hidden="true"] > [data-cms-a],
[data-cms-e][data-sn="simple-page"] > figure > div[aria-hidden="true"] [data-cms-e][data-etype="media"] {
    width: 100%;
    height: 100%;
    margin: 0;
}
[data-cms-e][data-sn="simple-page"] > figure > div[aria-hidden="true"] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
    display: block;
}
/* The lead image's own caption is noise behind the title — hide it. */
[data-cms-e][data-sn="simple-page"] > figure > div[aria-hidden="true"] figcaption {
    display: none;
}
/* Foreground heading column. Default centring is the fallback before the
 * per-page placement rule loads; white text reads over the scrim. */
[data-cms-e][data-sn="simple-page"] > figure > div:not([aria-hidden]) {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    min-width: 0;
    box-sizing: border-box;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}
/* The overlay bleeds like a band, so on wide screens its title column holds to
 * the page width; beside a rail it does not bleed. */
@media (min-width: 86rem) {
    body > main[data-cms-e][data-sn="simple-page"] > figure > div:not([aria-hidden]) {
        padding-inline: var(--page-gutter);
    }
}
[data-cms-e][data-sn="simple-page"] > figure > div:not([aria-hidden]) h1 {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 3rem);
    line-height: 1.1;
    color: inherit;
}
[data-cms-e][data-sn="simple-page"] > figure:not(:has(> div[aria-hidden="true"] img)) > div:not([aria-hidden]) {
    color: var(--color-primary-text-on-fill);
}

/* ============= Cover =============
 * A generic cover standing alone (a page's top slot, the format preview):
 * the slide idiom at the simple-page overlay's height. The event and the
 * carousel slide style their own; on a stage the stage owns the box. */
[data-cms-e][data-fmt="cover"]:not([data-sn="cms-event"], [data-sn="content-carousel-slide"]) {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    box-sizing: border-box;
    min-height: clamp(16rem, 38vw, 26rem);
    margin: 0 0 1.5rem 0;
    border-radius: 4px;
    background-color: var(--color-primary-fill);
    color: var(--site-overlay-text);
}
[data-cms-e][data-fmt="cover"]:not([data-sn="cms-event"], [data-sn="content-carousel-slide"]):has(> div[aria-hidden="true"])::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: var(--scrim-full);
}
[data-cms-e][data-fmt="cover"]:not([data-sn="cms-event"], [data-sn="content-carousel-slide"]) > div[aria-hidden="true"] {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
/* The ref's attribute wrapper fills too (see the carousel slide rule). */
[data-cms-e][data-fmt="cover"]:not([data-sn="cms-event"], [data-sn="content-carousel-slide"]) > div[aria-hidden="true"] > [data-cms-a],
[data-cms-e][data-fmt="cover"]:not([data-sn="cms-event"], [data-sn="content-carousel-slide"]) > div[aria-hidden="true"] :is([data-cms-e][data-etype="media"], picture) {
    width: 100%;
    height: 100%;
    margin: 0;
}
[data-cms-e][data-fmt="cover"]:not([data-sn="cms-event"], [data-sn="content-carousel-slide"]) > div[aria-hidden="true"] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
    display: block;
}
[data-cms-e][data-fmt="cover"]:not([data-sn="cms-event"], [data-sn="content-carousel-slide"]) > div[aria-hidden="true"] figcaption {
    display: none;
}
[data-cms-e][data-fmt="cover"]:not([data-sn="cms-event"], [data-sn="content-carousel-slide"]) > div:not([aria-hidden]) {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    min-width: 0;
    box-sizing: border-box;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}
[data-cms-e][data-fmt="cover"]:not([data-sn="cms-event"], [data-sn="content-carousel-slide"]) > div:not([aria-hidden]) > h2 {
    margin: 0 0 0.75rem 0;
    font-size: var(--type-display);
    font-weight: 600;
    line-height: 1.08;
    max-width: 18ch;
    color: inherit;
}
[data-cms-e][data-fmt="cover"]:not([data-sn="cms-event"], [data-sn="content-carousel-slide"]) > div:not([aria-hidden]) > nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* ============= Simple CTA Group =============
 * Public-site render of <@kds.render etype="webcontent" sn="simple-cta" />
 * and its parent group (sn="simple-cta-group"). Group layout is driven
 * by the cms.cta slot wrapper's data-cn (child count) and the render
 * data-fmt — no invented marker attributes. JS for the carousel /
 * rotator lives in scripts.js; this file owns layout + spacing.
 * Class-free per the rendering-model convention.
 */
/* Individual Simple CTA. Image-as-background layout: the cms.image
 * fills the card, title + description sit centred on top of a
 * darkening overlay. A short horizontal rule separates the linked
 * title from the description. CTAs without a cms.image fall back to
 * the primary brand colour as the background. A cover takes its box and
 * scrim from the stage and the generic cover rules; :where() keeps the
 * other formats' specificity unchanged. */
[data-cms-e][data-sn="simple-cta"]:where(:not([data-fmt="cover"])) {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 0;
    padding: 2rem 1.5rem;
    min-height: 18rem;
    overflow: hidden;
    border-radius: 4px;
    color: var(--site-overlay-text);
    background-color: var(--color-primary-fill);
}

/* Image: the cms.image ref resolves to a media/<sn>/embedded.ftlh
 * which emits its own <figure data-cms-e data-etype="media">.
 * Absolutely positioned to fill the card; the <img> cover-fits so
 * varied aspect ratios still look intentional. */
[data-cms-e][data-sn="simple-cta"] > [data-cms-a] > figure[data-cms-e][data-etype="media"] {
    position: absolute;
    inset: 0;
    margin: 0;
    z-index: -2;
}

[data-cms-e][data-sn="simple-cta"] > [data-cms-a] > figure[data-cms-e][data-etype="media"] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    border-radius: 0;
}

/* The photo's own caption is noise behind the title. */
[data-cms-e][data-sn="simple-cta"] > [data-cms-a] > figure[data-cms-e][data-etype="media"] figcaption {
    display: none;
}

/* Darkening overlay so light-on-dark text stays legible across any
 * photo, drawn only over one. Sits between the image and the foreground
 * content. */
[data-cms-e][data-sn="simple-cta"]:where(:not([data-fmt="cover"])):has(> [data-cms-a] > figure)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--scrim-full);
    z-index: -1;
}
/* Title rides directly on the <h3>; "the title is the link". */
[data-cms-e][data-sn="simple-cta"] > h3 {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    line-height: 1.2;
    color: var(--site-overlay-text);
}

[data-cms-e][data-sn="simple-cta"] > h3 a {
    color: inherit;
    text-decoration: none;
}

[data-cms-e][data-sn="simple-cta"] > h3 a:hover,
[data-cms-e][data-sn="simple-cta"] > h3 a:focus-visible {
    text-decoration: underline;
}

/* Overlay-stage links take the overlay border; the no-image rules take the text-on-fill colour. */
[data-cms-e][data-sn="simple-cta"] a:focus-visible,
[data-cms-e][data-fmt="cover"] > div:not([aria-hidden]) a:focus-visible,
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e] > div:not([aria-hidden]) a:focus-visible {
    outline: 2px solid var(--site-overlay-control-border);
    outline-offset: 2px;
}

/* Short horizontal bar separating title from description. Only
 * rendered when a description follows the title so the bar doesn't
 * dangle on title-only CTAs. */
[data-cms-e][data-sn="simple-cta"] > h3:has(+ [data-cms-a][data-atype="text"])::after {
    content: '';
    display: block;
    width: 5rem;
    height: 2px;
    margin: 1rem auto 0.75rem;
    background: currentColor;
    opacity: 0.7;
}

/* Description: the cms.description-html attribute is the only TEXT-typed
 * attribute rendered as a direct child, so [data-atype="text"] selects
 * exactly the auto-emitted <div data-cms-a>. */
[data-cms-e][data-sn="simple-cta"] > [data-cms-a][data-atype="text"] {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--site-overlay-text-muted);
    max-width: 32rem;
}

[data-cms-e][data-sn="simple-cta"] > [data-cms-a][data-atype="text"] p {
    margin: 0 0 0.5em 0;
}

[data-cms-e][data-sn="simple-cta"] > [data-cms-a][data-atype="text"] p:last-child {
    margin-bottom: 0;
}

/* No image: brand fill, text-on-fill ink. */
[data-cms-e][data-sn="simple-cta"]:where(:not([data-fmt="cover"])):not(:has(> [data-cms-a] > figure)),
[data-cms-e][data-sn="simple-cta"]:where(:not([data-fmt="cover"])):not(:has(> [data-cms-a] > figure)) > :is(h3, [data-cms-a][data-atype="text"]) {
    color: var(--color-primary-text-on-fill);
}

[data-cms-e][data-sn="simple-cta"]:where(:not([data-fmt="cover"])):not(:has(> [data-cms-a] > figure)) a:focus-visible {
    outline-color: var(--color-primary-text-on-fill);
}

/* Simple CTA Group — layout is driven by the cms.cta slot wrapper's
 * data-cn (the child count) and the group's render format (data-fmt):
 *   feature / embedded, 1–4 → equal-column grid (one column per CTA)
 *   feature / embedded, 5+  → horizontal-scroll carousel (JS in scripts.js)
 *   card                 → fade rotator (JS), one CTA at a time
 * The cms.cta multi-ref dispatches every child into one [data-cms-a]
 * slot wrapper; `display:contents` on it makes the CTAs direct grid /
 * flex / rotator children of the section. No count / variant marker
 * attributes — the count is the slot's data-cn and the variant is the
 * pipeline data-fmt. */
[data-cms-e][data-sn="simple-cta-group"] {
    display: grid;
    gap: 1.5rem;
    margin: 0 0 1.5rem 0;
}

[data-cms-e][data-sn="simple-cta-group"] > [data-cms-a] {
    display: contents;
}

/* Counts 1–4: one column per CTA, read off the slot wrapper's data-cn. */
[data-cms-e][data-sn="simple-cta-group"]:has(> [data-cms-a][data-cn="1"]) {
    grid-template-columns: 1fr;
}

[data-cms-e][data-sn="simple-cta-group"]:has(> [data-cms-a][data-cn="2"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

[data-cms-e][data-sn="simple-cta-group"]:has(> [data-cms-a][data-cn="3"]) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

[data-cms-e][data-sn="simple-cta-group"]:has(> [data-cms-a][data-cn="4"]) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* On narrow viewports collapse 3 / 4 column grids to a stacked column
 * so cards don't get unreadably small. The 2-up stays side-by-side
 * down to ~480px where it also stacks. */
@media (max-width: 768px) {
    [data-cms-e][data-sn="simple-cta-group"]:has(> [data-cms-a][data-cn="3"]),
    [data-cms-e][data-sn="simple-cta-group"]:has(> [data-cms-a][data-cn="4"]) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* One card per row: the padding has to sit inside the 100% basis, or the
 * card is wider than the column and takes the page with it. */
@media (max-width: 480px) {
    [data-cms-e][data-sn="simple-cta-group"] > [data-cms-a] > [data-cms-e],
    [data-cms-e][data-sn="for-sale-cta-group"] > [data-cms-a] > [data-cms-e] {
        box-sizing: border-box;
    }

    [data-cms-e][data-sn="simple-cta-group"]:has(> [data-cms-a][data-cn="2"]),
    [data-cms-e][data-sn="simple-cta-group"]:has(> [data-cms-a][data-cn="3"]),
    [data-cms-e][data-sn="simple-cta-group"]:has(> [data-cms-a][data-cn="4"]) {
        grid-template-columns: 1fr;
    }
}

/* 5+ (feature / embedded): horizontal-scroll carousel — the 5th child in
 * the slot wrapper signals "5 or more". Switches grid → flex so the
 * cards lay out in a single row wider than the viewport; JS animates
 * scrollLeft. --cta-basis carries the responsive card width so the
 * per-card rule below is written once.
 *
 * This carousel is the default. An author can instead choose "wrap" via
 * cms.cta-group.layout; PresentationCssService then head-injects a more
 * specific rule that flips flex-wrap:wrap / overflow:visible on this one
 * group, so the cards keep their --cta-basis width but reflow onto
 * multiple rows. scripts.js skips the auto-scroller in that case. */
[data-cms-e][data-sn="simple-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)),
[data-cms-e][data-sn="simple-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    overflow: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    --cta-basis: calc((100% - 4.5rem) / 4);
}

@media (max-width: 1024px) {
    [data-cms-e][data-sn="simple-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)),
    [data-cms-e][data-sn="simple-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) {
        --cta-basis: calc((100% - 3rem) / 3);
    }
}

@media (max-width: 768px) {
    [data-cms-e][data-sn="simple-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)),
    [data-cms-e][data-sn="simple-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) {
        --cta-basis: calc((100% - 1.5rem) / 2);
    }
}

@media (max-width: 480px) {
    [data-cms-e][data-sn="simple-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)),
    [data-cms-e][data-sn="simple-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) {
        --cta-basis: 100%;
    }
}

[data-cms-e][data-sn="simple-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5))::-webkit-scrollbar,
[data-cms-e][data-sn="simple-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5))::-webkit-scrollbar {
    display: none;
}

[data-cms-e][data-sn="simple-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) > [data-cms-a] > [data-cms-e],
[data-cms-e][data-sn="simple-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) > [data-cms-a] > [data-cms-e] {
    flex: 0 0 var(--cta-basis);
    min-width: 0;
}

/* Card format: fade rotator — one CTA visible at a time, JS cross-fades
 * every 8s. Children are absolutely stacked; the first stays visible
 * until JS rotates. With <2 children the rotator no-ops and the first
 * CTA simply stays. */
[data-cms-e][data-sn="simple-cta-group"][data-fmt="card"] {
    display: block;
    position: relative;
    min-height: 12rem;
    overflow: hidden;
    gap: 0;
}

[data-cms-e][data-sn="simple-cta-group"][data-fmt="card"] > [data-cms-a] > [data-cms-e] {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 600ms ease-in-out;
}

[data-cms-e][data-sn="simple-cta-group"][data-fmt="card"] > [data-cms-a] > [data-cms-e]:first-child {
    opacity: 1;
}

/* ============= For Sale CTA + For Sale CTA Group =============
 * Public-site render of <@kds.render etype="webcontent" sn="for-sale-cta" />
 * and its parent group. Parallels the simple-cta-group block above:
 *   - count-driven grid (1..4) collapsing at breakpoints
 *   - 5+ horizontally-scrolling carousel
 *   - card-format fade rotator
 * Selectors are scoped to data-cms-e[data-sn="for-sale-cta(-group)"] so
 * the rules don't bleed into simple-cta-group, even though both can sit
 * inside a cms.cta reference on either group.
 *
 * Whether a CTA is featured (cms.is-featured) is an author choice,
 * bound per entity to its [data-eid] by the head-injected
 * PresentationCssService CSS (taller / more vibrant title band).
 *
 * Semantic-markup-only; the semantic wrappers (header, ul, footer)
 * carry the structural roles, and the price block is a plain <div>
 * selected via :has() on its inline [data-an="cms.price-string"] /
 * [data-an="cms.price-period"] atoms. Those price atoms remain on
 * <span> children that have no semantic alternative.
 */

/* Individual For Sale CTA. Renders as a pricing card: title band on
 * top, big price block, bullet list, then a CTA button. A cover takes
 * its box from the stage and the generic cover rules, and its price is
 * a plain supporting line; :where() keeps the other formats'
 * specificity unchanged. */
[data-cms-e][data-sn="for-sale-cta"]:where(:not([data-fmt="cover"])) {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    background-color: var(--site-bg);
    border: 1px solid var(--site-border);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--site-shadow);
    color: var(--site-text);
}

[data-cms-e][data-sn="for-sale-cta"] > header {
    background-color: var(--site-surface-alt);
    padding: 1rem 1.25rem;
    text-align: center;
}

[data-cms-e][data-sn="for-sale-cta"] > header h3 {
    margin: 0;
    font-size: clamp(1.125rem, 1.75vw, 1.5rem);
    line-height: 1.2;
}

[data-cms-e][data-sn="for-sale-cta"] > header h3 a {
    color: inherit;
    text-decoration: none;
}

[data-cms-e][data-sn="for-sale-cta"] > header h3 a:hover,
[data-cms-e][data-sn="for-sale-cta"] > header h3 a:focus-visible {
    text-decoration: underline;
}

/* Featured: a taller title band on --color-feature-accent-bg, the brand
 * pair (see :root). Whether a CTA is featured (cms.is-featured) is an
 * author choice, bound per entity to its [data-eid] by the head-injected
 * PresentationCssService CSS. */

/* Price block: the only <div> child of the card. :has() pins it to
 * the wrapper that contains the inline price atoms. */
[data-cms-e][data-sn="for-sale-cta"] > div:has(> [data-an="cms.price-string"]),
[data-cms-e][data-sn="for-sale-cta"] > div:has(> [data-an="cms.price-period"]) {
    padding: 1.25rem 1.25rem 0.5rem;
    text-align: center;
}

[data-cms-e][data-sn="for-sale-cta"]:where(:not([data-fmt="cover"])) [data-an="cms.price-string"] {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: var(--typography-fontWeightBold);
    line-height: 1.1;
}

[data-cms-e][data-sn="for-sale-cta"]:where(:not([data-fmt="cover"])) [data-an="cms.price-currency-symbol"] {
    font-size: 0.7em;
    vertical-align: top;
    margin: 0 0.1em;
}

[data-cms-e][data-sn="for-sale-cta"]:where(:not([data-fmt="cover"])) [data-an="cms.price-period"] {
    display: block;
    font-size: 0.875rem;
    color: var(--site-text-muted);
    margin-top: 0.25rem;
}

[data-cms-e][data-sn="for-sale-cta"] > ul {
    list-style: none;
    margin: 0;
    padding: 0.75rem 1.25rem;
    flex: 1 1 auto;
}

[data-cms-e][data-sn="for-sale-cta"] > ul li {
    padding: 0.375rem 0 0.375rem 1.25rem;
    position: relative;
    line-height: 1.4;
}

[data-cms-e][data-sn="for-sale-cta"] > ul li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 0.375rem;
    color: var(--color-success);
    font-weight: var(--typography-fontWeightBold);
}

/* The action band: a linked button is a label until hover or focus. */
[data-cms-e][data-sn="for-sale-cta"] > footer {
    padding: 0.75rem 1.25rem 1.25rem;
    text-align: center;
    background-color: var(--site-dark-band);
}

[data-cms-e][data-sn="for-sale-cta"] > footer a {
    width: 100%;
}

[data-cms-e][data-sn="for-sale-cta"] > footer a[href] {
    background-color: transparent;
    border-color: transparent;
    color: var(--site-dark-band-text);
}

[data-cms-e][data-sn="for-sale-cta"] > footer a[href]:is(:hover, :focus-visible) {
    background-color: var(--color-accent-fill);
    border-color: var(--color-accent-fill);
    color: var(--color-accent-text-on-fill);
}

[data-cms-e][data-sn="for-sale-cta"] > footer a[href]:focus-visible {
    outline: 2px solid var(--site-dark-band-text);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    [data-cms-e][data-sn="for-sale-cta"] > footer a {
        transition: none;
    }
}

/* For Sale CTA Group — same count/format-driven layout model as
 * simple-cta-group (see that block): data-cn on the cms.cta slot wrapper
 * picks the column count; data-fmt + a 5th child picks the carousel; the
 * card format is the rotator. Identical breakpoints; the two groups
 * share a visual rhythm but stay independent via their data-sn. */
[data-cms-e][data-sn="for-sale-cta-group"] {
    display: grid;
    gap: 1.5rem;
    margin: 0 0 1.5rem 0;
    align-items: stretch;
}

[data-cms-e][data-sn="for-sale-cta-group"] > [data-cms-a] {
    display: contents;
}

/* A lone card takes half the row from the content edge, not all of it. */
[data-cms-e][data-sn="for-sale-cta-group"]:has(> [data-cms-a][data-cn="1"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

[data-cms-e][data-sn="for-sale-cta-group"]:has(> [data-cms-a][data-cn="2"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

[data-cms-e][data-sn="for-sale-cta-group"]:has(> [data-cms-a][data-cn="3"]) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

[data-cms-e][data-sn="for-sale-cta-group"]:has(> [data-cms-a][data-cn="4"]) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 768px) {
    [data-cms-e][data-sn="for-sale-cta-group"]:has(> [data-cms-a][data-cn="3"]),
    [data-cms-e][data-sn="for-sale-cta-group"]:has(> [data-cms-a][data-cn="4"]) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    [data-cms-e][data-sn="for-sale-cta-group"]:has(> [data-cms-a][data-cn="1"]),
    [data-cms-e][data-sn="for-sale-cta-group"]:has(> [data-cms-a][data-cn="2"]),
    [data-cms-e][data-sn="for-sale-cta-group"]:has(> [data-cms-a][data-cn="3"]),
    [data-cms-e][data-sn="for-sale-cta-group"]:has(> [data-cms-a][data-cn="4"]) {
        grid-template-columns: 1fr;
    }
}

/* 5+ (feature / embedded): horizontal-scroll carousel. --cta-basis carries
 * the responsive card width (per-card rule written once). */
[data-cms-e][data-sn="for-sale-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)),
[data-cms-e][data-sn="for-sale-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    overflow: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    --cta-basis: calc((100% - 4.5rem) / 4);
}

@media (max-width: 1024px) {
    [data-cms-e][data-sn="for-sale-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)),
    [data-cms-e][data-sn="for-sale-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) {
        --cta-basis: calc((100% - 3rem) / 3);
    }
}

@media (max-width: 768px) {
    [data-cms-e][data-sn="for-sale-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)),
    [data-cms-e][data-sn="for-sale-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) {
        --cta-basis: calc((100% - 1.5rem) / 2);
    }
}

@media (max-width: 480px) {
    [data-cms-e][data-sn="for-sale-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)),
    [data-cms-e][data-sn="for-sale-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) {
        --cta-basis: 100%;
    }
}

[data-cms-e][data-sn="for-sale-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5))::-webkit-scrollbar,
[data-cms-e][data-sn="for-sale-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5))::-webkit-scrollbar {
    display: none;
}

[data-cms-e][data-sn="for-sale-cta-group"][data-fmt="feature"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) > [data-cms-a] > [data-cms-e],
[data-cms-e][data-sn="for-sale-cta-group"][data-fmt="embedded"]:has(> [data-cms-a] > [data-cms-e]:nth-child(5)) > [data-cms-a] > [data-cms-e] {
    flex: 0 0 var(--cta-basis);
    min-width: 0;
}

/* Card format: fade rotator — one CTA visible at a time, JS cross-fades
 * every 8s. The cms.cta slot is a single-cell grid: every CTA shares grid
 * cell 1/1, so the slot grows to the TALLEST CTA (a for-sale CTA's price +
 * bullet list + button easily exceeds a fixed height) and the CTAs stack
 * via opacity instead of absolute positioning — nothing is clipped at the
 * bottom. (simple-cta-group's card rotator still uses the older
 * fixed-min-height + absolute stack; its CTAs are short enough not to
 * clip.) */
[data-cms-e][data-sn="for-sale-cta-group"][data-fmt="card"] {
    display: block;
}

[data-cms-e][data-sn="for-sale-cta-group"][data-fmt="card"] > [data-cms-a] {
    display: grid;
}

[data-cms-e][data-sn="for-sale-cta-group"][data-fmt="card"] > [data-cms-a] > [data-cms-e] {
    grid-area: 1 / 1;
    opacity: 0;
    transition: opacity 600ms ease-in-out;
}

[data-cms-e][data-sn="for-sale-cta-group"][data-fmt="card"] > [data-cms-a] > [data-cms-e]:first-child {
    opacity: 1;
}

/* ============= Text Highlight with Background Photo =============
 * Public-site render of <@kds.render etype="webcontent" sn="text-highlight" />.
 * Headline + subtitle laid over a background photo (cms.image); colours
 * come from the block's intent (the --text-highlight-* tokens), opacity
 * and bg sizing from carousel-slide attributes.
 *
 * Selectors target the data-cms-e[data-sn="text-highlight"] wrapper emitted
 * by <@kds.entityAttrs />, with data-cta-layout driving alignment + intro/
 * sub-head ordering and data-bg-style driving image sizing (re-used semantics
 * from the content-carousel-slide rules above). Two custom regions
 * remain (data-cms-text-highlight-region="bg|content"); title is the
 * <h2>, intro-head and sub-head are <p> siblings keyed positionally.
 * Class-free per the rendering-model convention.
 */
/* A cover takes its box, layers and column from the stage and the generic
 * cover rules; :where() keeps the other formats' specificity unchanged. */
/* The block paints from three properties the presentation CSS binds to the
 * entity's intent; unset, they take emphasis. */
[data-cms-e][data-sn="text-highlight"]:where(:not([data-fmt="cover"])) {
    --text-highlight-bg: var(--text-highlight-emphasis-bg);
    --text-highlight-text: var(--text-highlight-emphasis-text);
    --text-highlight-scrim: var(--text-highlight-emphasis-scrim);
    background-color: var(--text-highlight-bg);
    color: var(--text-highlight-text);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
    min-height: 16rem;
    margin: 0 0 1.5rem 0;
}

[data-cms-e][data-sn="text-highlight"]:where(:not([data-fmt="cover"])) > div[aria-hidden="true"] {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Scrim only over an image; cover takes the generic cover rules. */
[data-cms-e][data-sn="text-highlight"]:where(:not([data-fmt="cover"])):has(> div[aria-hidden="true"])::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: var(--text-highlight-scrim);
}

[data-cms-e][data-sn="text-highlight"]:where(:not([data-fmt="cover"])) > div[aria-hidden="true"] > [data-cms-a],
[data-cms-e][data-sn="text-highlight"]:where(:not([data-fmt="cover"])) > div[aria-hidden="true"] [data-cms-e][data-etype="media"] {
    width: 100%;
    height: 100%;
    margin: 0;
}

[data-cms-e][data-sn="text-highlight"]:where(:not([data-fmt="cover"])) > div[aria-hidden="true"] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
    display: block;
}

/* Background image object-fit (bg-style) is an author choice, bound per
 * entity to its [data-eid] by the head-injected PresentationCssService
 * CSS. The base img rule above provides the cover default. */

[data-cms-e][data-sn="text-highlight"]:where(:not([data-fmt="cover"])) > div:not([aria-hidden]) {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

/* Keep highlight copy at a readable measure even when the band runs
 * full-bleed; alignment stays the author's cta-layout choice. */
[data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]) > h2,
[data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]) > p,
[data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]) > [data-an="cms.description-html"] {
    max-width: min(var(--measure), 100%);
}

/* Optional rich-text body under the title. */
[data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]) > [data-an="cms.description-html"] {
    margin-top: 1rem;
    line-height: 1.68;
}

[data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]) > [data-an="cms.description-html"] > :first-child {
    margin-top: 0;
}

[data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]) > [data-an="cms.description-html"] > :last-child {
    margin-bottom: 0;
}

[data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]) > [data-an="cms.description-html"] a {
    color: inherit;
}

/* Feature-format highlight = the support-banner band: generous stage
 * padding, side padding matching the page gutter it bleeds across. */
[data-cms-e][data-sn="text-highlight"][data-fmt="feature"] > div:not([aria-hidden]) {
    padding: clamp(3.5rem, 9vh, 6rem) var(--page-gutter);
}

[data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]) > h2 {
    margin: 0;
    font-size: var(--type-h2);
    font-weight: 600;
    line-height: 1.1;
}

/* intro-head: the <p> is rendered before the <h2> (introHead branch). */
[data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]) > p:first-child {
    margin: 0 0 0.25rem 0;
    font-size: clamp(0.875rem, 1.25vw, 1rem);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: var(--typography-fontWeightMedium);
}

/* sub-head: the <p> follows the <h2>. */
[data-cms-e][data-sn="text-highlight"] > div:not([aria-hidden]) > h2 + p {
    margin: 0.25rem 0 0 0;
    font-size: clamp(1rem, 1.75vw, 1.25rem);
    line-height: 1.3;
    font-weight: var(--typography-fontWeightRegular);
}

/* CTA-layout alignment (centered-* vs left-*) is an author choice, bound
 * per entity to its [data-eid] by the head-injected PresentationCssService
 * CSS. The intro-head / sub-head ORDERING is structural — the template
 * renders the subtitle <p> before or after the <h2>, and the p:first-child
 * vs h2 + p rules above style each accordingly. */

/* ============= Simple Page lead-image =============
 * simple-page renders cms.lead-image between the title and body. The
 * media template emits the image as a <figure data-cms-e data-etype="media"
 * data-sn="image">. There is only ever one image-subtype figure as a
 * direct child of simple-page's <main>, so :first-of-type picks out
 * the lead-image slot semantically off identifiers the pipeline
 * already emits — no fabricated marker attributes.
 *
 * Full-bleed via negative horizontal margins by --page-gutter, the same
 * value as the `main, footer` padding rule above.
 */
[data-cms-e][data-sn="simple-page"] > [data-cms-a] > figure[data-sn="image"]:first-of-type {
    margin-left: calc(-1 * var(--page-gutter));
    margin-right: calc(-1 * var(--page-gutter));
    margin-bottom: 1.5rem;
}

[data-cms-e][data-sn="simple-page"] > [data-cms-a] > figure[data-sn="image"]:first-of-type img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0;
}

/* The shared media-image template emits a <figcaption> whenever the
 * media has title / description / credit set. simple-page's lead
 * image is a hero / decorative slot, not a captioned illustration —
 * suppress so authoring metadata stays out of the public surface. */
[data-cms-e][data-sn="simple-page"] > [data-cms-a] > figure[data-sn="image"]:first-of-type figcaption {
    display: none;
}

/* ============= Page Title Marker (marker pattern) =============
 * The page-title-marker webcontent has no attributes — its render
 * template reads the `page` model global and emits an <h1> with the
 * page's cms.title. See doc/features/marker-pattern.md.
 *
 * The same h1 style is shared with simple-page's auto title rendering
 * (simple-page renders cms.title above its lead-image without a marker
 * since the subtype is opinionated). Class-free per the convention.
 */
[data-cms-e][data-sn="page-title-marker"],
[data-cms-e][data-sn="simple-page"] > h1:first-of-type {
    display: block;
    margin: 0 0 2rem;
}

[data-cms-e][data-sn="page-title-marker"] > h1,
[data-cms-e][data-sn="simple-page"] > h1:first-of-type,
[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > h1 {
    font-size: clamp(1.875rem, 1.25rem + 2.5vw, 2.75rem);
    font-weight: 600;
    line-height: 1.15;
    color: var(--site-text);
    margin: 0 0 1.5rem;
    letter-spacing: -0.01em;
}

/* The marker is a landing page's editorial masthead: centred, with a
 * brass programme-divider ornament underneath (shared idiom with the
 * mission band). Page titles read as editorial ink, not brand colour —
 * the header carries the brand. */
[data-cms-e][data-sn="page-title-marker"] {
    text-align: center;
}

[data-cms-e][data-sn="page-title-marker"] > h1 {
    margin: 0;
}

[data-cms-e][data-sn="page-title-marker"] > h1::after {
    content: "\25c6"; /* ◆ */
    display: block;
    margin-top: 0.75rem;
    color: var(--color-accent-fill);
    font-size: 0.975rem;
    line-height: 1;
    letter-spacing: 0;
}

/* Masthead rhythm, plain header style: the title group sits nearer its
 * content than the header. */
body:not(:has(> header[data-header-style="filled"])) [data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="page-title-marker"]:first-child {
    margin-block: calc(var(--section-gap) * 0.6) 0;
}

body:not(:has(> header[data-header-style="filled"])) [data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="page-title-marker"]:first-child + [data-cms-e]:not([data-sn="content-carousel"], [data-sn="text-highlight"]) {
    margin-block-start: max(2rem, calc(var(--section-gap) * 0.5));
}

/* Filled header style: a leading page title continues the band. */
body:has(> header[data-header-style="filled"]) main[data-sn="landing-page"]:has(> [data-cms-a] > [data-cms-e][data-sn="page-title-marker"]:first-child),
body:has(> header[data-header-style="filled"]) main[data-sn="simple-page"]:has(> h1:first-child) {
    padding-top: 0;
}

body:has(> header[data-header-style="filled"]) main[data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="page-title-marker"]:first-child,
body:has(> header[data-header-style="filled"]) main[data-sn="simple-page"] > h1:first-child {
    box-sizing: border-box;
    width: 100vw;
    margin: 0 0 var(--section-gap) calc(-1 * var(--page-gutter));
    padding: 2rem var(--page-gutter) 2.25rem;
    border-top: 1px solid color-mix(in srgb, var(--site-header-band-ink) 28%, transparent);
    background-color: var(--site-header-band);
    color: var(--site-header-band-ink);
    text-align: left;
}

body:has(> header[data-header-style="filled"]) main[data-sn="simple-page"] > h1:first-child {
    margin-bottom: 2rem;
}

body:has(> header[data-header-style="filled"]) main[data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="page-title-marker"]:first-child > h1 {
    margin: 0;
    color: inherit;
}

body:has(> header[data-header-style="filled"]) main[data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="page-title-marker"]:first-child > h1::after {
    content: none;
}

/* A full-bleed band next (carousel, text highlight) starts right under the
 * title band. */
body:has(> header[data-header-style="filled"]) > main[data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="page-title-marker"]:first-child:has(+ [data-cms-e]:is([data-sn="content-carousel"], [data-sn="text-highlight"])) {
    margin-bottom: 0;
}

body:has(> header[data-header-style="filled"]) > main[data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="page-title-marker"]:first-child + [data-cms-e]:is([data-sn="content-carousel"], [data-sn="text-highlight"]) {
    margin-top: 0;
}

/* With the title hidden, a leading text highlight docks under the band. */
body:has(> header[data-header-style="filled"]) main[data-sn="landing-page"]:has(> [data-cms-a] > :is([data-cms-e][data-sn="text-highlight"]:first-child, [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="text-highlight"])) {
    padding-top: 0;
}

body:has(> header[data-header-style="filled"]) main[data-sn="landing-page"] > [data-cms-a] > :is([data-cms-e][data-sn="text-highlight"]:first-child, [data-cms-e][data-sn="invisible-title-marker"]:first-child + [data-cms-e][data-sn="text-highlight"]) {
    margin-top: 0;
}

/* ============= Invisible Title Marker (marker pattern) =============
 * Same render as page-title-marker (h1 from the page's cms.title) but
 * hidden off-screen — for pages whose title is presented another way
 * (e.g. a carousel) that still need an accessible page heading.
 * Hidden in EVERY format: the theme's sidebar renders items at card
 * format on delivery, so a card carve-out would leak a visible h1
 * there. The preview stamp below is the sole authoring affordance.
 * See doc/features/marker-pattern.md.
 */
/* Row-scoped form outranks the landing-page section-gap rule (0,3,0). */
[data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="invisible-title-marker"],
[data-cms-e][data-sn="invisible-title-marker"] {
    margin-block: 0;
}

[data-cms-e][data-sn="invisible-title-marker"] > h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Edit-canvas reveal: the preview proxy stamps data-cms-preview on <html>,
 * where the marker must be findable while authoring. Chip treatment (small,
 * dashed, muted) so it reads as authoring chrome, not the page design. */
html[data-cms-preview] [data-cms-e][data-sn="invisible-title-marker"] > h1 {
    /* Out of the flow at its own static position, so revealing it never
     * moves the page; above the sticky header (z-index 100), which can
     * overlie the first row. */
    position: absolute;
    z-index: 101;
    width: auto;
    height: auto;
    margin: 0.4rem 0 0;
    padding: 0.15em 0.6em;
    overflow: visible;
    clip: auto;
    white-space: normal;
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.65;
    outline: 2px dashed currentColor;
    outline-offset: 2px;
}

/* ============= Event =============
 * Public-site render of <@kds.render etype="canonical" sn="cms-event" />.
 * cms-event is canonical content delivered at the events template page the
 * site binds to it, with a single full-format detail surface — a header
 * band, then the body beside its rail. Its
 * wrapper is <article>, not <main>: the enterprise-content-marker
 * dispatches it inside the template page's <main>.
 * Class-free per the rendering-model convention; semantic
 * wrappers carry the structural roles directly
 * (<h1>, <p>, <address>, <section>) — no custom *-region attributes.
 * Inline atoms (data-cms-event-when-*, -venue-*,
 * -organizer-*, -ticket-badge) remain on <span>/<a> children that
 * have no semantic alternative.
 *
 * Functional baseline only — the issue calls for "use design skill and
 * select an appropriate option and it will be refined after initial
 * build", so this lays out the blocks legibly without committing to a
 * heavy visual treatment.
 */
[data-cms-e][data-sn="cms-event"] {
    margin: 0 0 2rem 0;
}

[data-cms-e][data-sn="cms-event"] > [data-cms-a] > figure[data-cms-e][data-etype="media"] {
    margin: 0 0 1.25rem 0;
}

[data-cms-e][data-sn="cms-event"] > [data-cms-a] > figure[data-cms-e][data-etype="media"] img {
    width: 100%;
    height: auto;
    max-height: 28rem;
    object-fit: cover;
    border-radius: 0.5rem;
    display: block;
}

/* ---- Event detail ----
 * The full format: a header band (eyebrow, title, teaser, facts, the ticket
 * action and the photo), then the body at reading measure beside a rail of
 * sections, about 2:1; the rail goes under the body below 900px. */
article[data-cms-e][data-sn="cms-event"][data-fmt="full"] {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    column-gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > * {
    grid-column: 2;
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > [data-cms-a][data-an="cms.body-html"] {
    grid-column: 1;
    grid-row: 2 / span 20;
    max-width: var(--measure);
    font-size: 1.0625rem;
    line-height: 1.65;
}

/* With no body the rail takes the body's column. */
article[data-cms-e][data-sn="cms-event"][data-fmt="full"]:not(:has(> [data-cms-a][data-an="cms.body-html"])) > * {
    grid-column: 1;
}

/* Header band: full width, cancelling the page gutter as the landing rows'
 * bands do, its insides padded back by it. */
article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header {
    grid-column: 1 / -1;
    box-sizing: border-box;
    width: calc(100% + 2 * var(--page-gutter));
    margin: 0 calc(-1 * var(--page-gutter)) clamp(2rem, 5vw, 3.5rem);
    padding: clamp(2rem, 5vw, 3.5rem) var(--page-gutter);
    background-color: var(--site-surface-alt);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* No photo: one text column and a decorative brand edge. */
article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header:not(:has(> figure)) {
    border-top: 6px solid var(--color-primary-fill);
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header:not(:has(> figure)) > * {
    max-width: 45rem;
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > p[data-an="cms.event.type"] {
    margin: 0 0 0.75rem;
    font-family: var(--typography-font-family), "Helvetica Neue", Arial, sans-serif;
    font-size: var(--type-eyebrow);
    font-weight: var(--typography-fontWeightBold);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-primary-text);
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > h1 {
    margin: 0 0 0.75rem;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > p[data-an="cms.subtitle"] {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
    line-height: 1.4;
    color: var(--site-text-muted);
}

/* Facts: a narrow label column, rows on hairlines, each value's first line bold. */
article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > dl {
    align-self: stretch;
    margin: 0 0 1.5rem;
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > dl > div {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--site-border);
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > dl > div:last-child {
    border-bottom: 1px solid var(--site-border);
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > dl dt {
    padding-top: 0.2rem;
    font-size: var(--type-eyebrow);
    font-weight: var(--typography-fontWeightMedium);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--site-text-muted);
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > dl dd {
    margin: 0;
    overflow-wrap: anywhere;
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > dl dd > * {
    display: block;
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > dl dd > :first-child {
    font-weight: var(--typography-fontWeightBold);
}

/* The ticket action, here and on the tile: the brand pair, not the photo CTA
 * the covers wear. */
article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > nav > a,
[data-cms-e][data-sn="cms-event"][data-fmt="card"] > nav > a {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: var(--typography-fontWeightMedium);
    letter-spacing: 0.03em;
    line-height: 1.2;
    text-decoration: none;
    border-radius: var(--radius-sm);
    background-color: var(--color-primary-fill);
    color: var(--color-primary-text-on-fill);
    transition: background-color 150ms ease;
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > nav > a:hover,
article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > nav > a:focus-visible,
[data-cms-e][data-sn="cms-event"][data-fmt="card"] > nav > a:hover,
[data-cms-e][data-sn="cms-event"][data-fmt="card"] > nav > a:focus-visible {
    background-color: var(--color-primary-fill-hover);
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > nav > a:focus-visible,
[data-cms-e][data-sn="cms-event"][data-fmt="card"] > nav > a:focus-visible {
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 2px;
}

/* The past notice stands where the button would. */
article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > p:not([data-an]) {
    margin: 0;
    color: var(--site-text-muted);
}

/* Photo: 4:3, cropped a little above centre, no scrim; shown first on a phone. */
article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > figure {
    order: -1;
    align-self: stretch;
    margin: 0 0 1.5rem;
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > figure img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 50% 35%;
    border-radius: var(--radius-lg);
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > figure figcaption {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--site-text-muted);
}

/* With a photo, side by side: two equal columns, the photo spanning the
 * text rows and centred against them. The outer rows absorb the height the
 * photo adds, so the text stays together. */
@media (min-width: 48.0625rem) {
    article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header:has(> figure) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: 1fr repeat(5, auto) 1fr;
        column-gap: 3rem;
        align-items: start;
    }

    article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header:has(> figure) > p[data-an="cms.event.type"] {
        grid-area: 2 / 1;
    }

    article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header:has(> figure) > h1 {
        grid-area: 3 / 1;
    }

    article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header:has(> figure) > p[data-an="cms.subtitle"] {
        grid-area: 4 / 1;
    }

    article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header:has(> figure) > dl {
        grid-area: 5 / 1;
    }

    article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header:has(> figure) > :is(nav, p:not([data-an])) {
        grid-area: 6 / 1;
    }

    article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header:has(> figure) > figure {
        grid-area: 1 / 2 / -1 / 3;
        align-self: center;
        margin: 0;
    }
}

@media (max-width: 48rem) {
    article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > nav {
        align-self: stretch;
    }

    article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > nav > a {
        width: 100%;
    }
}

@media (max-width: 900px) {
    article[data-cms-e][data-sn="cms-event"][data-fmt="full"] {
        display: block;
    }
}

/* When: <p> sibling containing one or two <time> elements + zone /
 * note / sep atoms. Only <p> child of the event main, so direct-
 * descendant selector is sufficient. */
[data-cms-e][data-sn="cms-event"] > p {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5em;
}

/* Split date-stub atoms (dow/day/monthYear — the first three
 * <time> children of the when <p>, see teaser.ftlh) are
 * hidden by default; only the list row opts into the ticket-stub
 * treatment below. Scoped to the formats that emit them: the cover
 * eyebrow carries the long form alone. */
[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > p > time:nth-of-type(-n + 3) {
    display: none;
}

/* Synthetic inline atoms inside the date/time <p>: zone suffix,
 * "(all day)" caption, en-dash separator. All semantic-element
 * <span>s; styled the same muted+italic treatment. */
[data-cms-e][data-sn="cms-event"] > p > span {
    font-size: 0.875rem;
    color: var(--site-text-muted);
    font-style: italic;
}

/* Body: the auto-emitted [data-cms-a][data-atype="text"] wrapper
 * from <@kds.attr name="cms.body-html" />. */
[data-cms-e][data-sn="cms-event"] > [data-cms-a][data-atype="text"] {
    margin: 0 0 1.5rem 0;
}

/* Rail: Featuring, On the programme and Organizer, each a <section> with an
 * eyebrow <h2>. */
[data-cms-e][data-sn="cms-event"] > section {
    margin: 0 0 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

[data-cms-e][data-sn="cms-event"] > section > h2 {
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--site-border);
    font-family: var(--typography-font-family), "Helvetica Neue", Arial, sans-serif;
    font-size: var(--type-eyebrow);
    font-weight: var(--typography-fontWeightMedium);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--site-text-muted);
}

[data-cms-e][data-sn="cms-event"] > section > [data-cms-a][data-an="cms.event.featuring"] {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

[data-cms-e][data-sn="cms-event"] > section > ul[data-an="cms.event.programme-highlights"] {
    margin: 0;
    padding-left: 1.1rem;
}

[data-cms-e][data-sn="cms-event"] > section > ul[data-an="cms.event.programme-highlights"] > li + li {
    margin-top: 0.35rem;
}

[data-cms-e][data-sn="cms-event"] > section [data-an="cms.event.contact-name"] {
    font-weight: var(--typography-fontWeightMedium);
}

/* ============= Web Event Listing =============
 * Public-site render of <@kds.render etype="webcontent" sn="web-event-listing" />.
 * Vertical stack of event rows, each rendered by the event at its teaser
 * format (canonical/cms-event/_row.ftlh) so the row body lives with
 * the event subtype, not the listing. Per-format sizing differences:
 *   - full   = no cap; the whole list renders inline.
 *   - feature / embedded = capped at a 16/9 aspect ratio with internal
 *     vertical scroll so the embed sits inside a parent layout.
 *   - card   = compact variant, max 5 entries (cap enforced in the
 *     template, not CSS); events render at their TEASER format
 *     (no photo, keeps the ticket link) on striped rows, under a
 *     prominent <h2> listing title.
 * Class-free per the rendering-model convention.
 */
[data-cms-e][data-sn="web-event-listing"] {
    margin: 0 0 1.5rem 0;
}

/* Row-head grammar: the listing heading reads as a
 * programme-section head — display-face h2 with a hairline rule
 * running to the right edge. */
[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]) > header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin: 0 0 2rem 0;
}

[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]) > header::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--site-border);
    transform: translateY(-0.4em);
}

[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]) > header > h2,
[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]) > header > h3 {
    margin: 0;
    font-size: var(--type-h2);
    font-weight: 600;
    line-height: 1.2;
}

/* Optional "more" link — ordered after the ::after hairline
 * (generated content is last in flex document order by default) so the
 * row reads heading / rule / link, matching the mockup's row-head grammar. */
[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]) > header > a {
    order: 1;
    flex: 0 0 auto;
    font-family: var(--typography-font-family), "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: var(--typography-fontWeightMedium);
    color: var(--color-accent-link);
    text-decoration: none;
    white-space: nowrap;
}

[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]) > header > a:hover,
[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]) > header > a:focus-visible {
    text-decoration: underline;
}

[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]) > ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]) > ol > li {
    border-top: 1px solid var(--site-border);
}

[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]) > ol > li:last-child {
    border-bottom: 1px solid var(--site-border);
}

/* Feature + embedded: cap the listing at a 16/9 aspect ratio and scroll
 * vertically inside. full leaves the height unconstrained. */
[data-cms-e][data-sn="web-event-listing"][data-fmt="feature"] > ol,
[data-cms-e][data-sn="web-event-listing"][data-fmt="embedded"] > ol {
    max-height: clamp(20rem, 56.25vw, 36rem);
    overflow-y: auto;
}

/* Card variant: compact stack of (at most 5) events. */
[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] {
    padding: 0.75rem;
    background-color: var(--site-bg);
    border: 1px solid var(--site-border);
    border-radius: 0.5rem;
}

/* Card title is an <h2> (one step larger than the events' <h3> titles), so
 * the card reads as a heading over a list; it inherits the listing-header
 * size from the rule above — no card-specific shrink. Rows are striped so
 * the events scan as a list. */
[data-cms-e]:is([data-sn="web-event-listing"], [data-sn="upcoming-events-marker"], [data-sn="past-events-marker"])[data-fmt="card"] > ol > li:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.04);
}

/* ============= Upcoming and Past Events Markers =============
 * webcontent/upcoming-events-marker and past-events-marker: the listing's
 * head and list rules above by selector. As a page row (feature, full) the events are tiles, three
 * fixed columns from the left on a band, one on a phone; an empty marker
 * takes no room. */
[data-cms-e]:is([data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]):empty {
    display: none;
}

[data-cms-e]:is([data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]):is([data-fmt="feature"], [data-fmt="full"]) {
    box-sizing: border-box;
    padding: clamp(2.5rem, 6vw, 4rem) var(--page-gutter);
    background-color: var(--site-surface-alt);
}

[data-cms-e]:is([data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]):is([data-fmt="feature"], [data-fmt="full"]) > ol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

[data-cms-e]:is([data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]):is([data-fmt="feature"], [data-fmt="full"]) > ol > li,
[data-cms-e]:is([data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]):is([data-fmt="feature"], [data-fmt="full"]) > ol > li:last-child {
    display: flex;
    border: none;
}

[data-cms-e]:is([data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]):is([data-fmt="feature"], [data-fmt="full"]) > ol > li > [data-cms-e] {
    flex: 1 1 auto;
}

@media (max-width: 768px) {
    [data-cms-e]:is([data-sn="upcoming-events-marker"], [data-sn="past-events-marker"]):is([data-fmt="feature"], [data-fmt="full"]) > ol {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Event row inside a listing — canonical/cms-event/_row.ftlh.
 * Compact: date stub on the left, title + venue stacked on the right.
 * align-items:center (was baseline) now that the date cell is a
 * card-shaped stub rather than a text baseline. */
[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.1rem 0.5rem;
    margin: 0;
}

/* Embedded row: <p> is the date cell, <div> is the body wrapper
 * (title + venue), both as direct children of the article wrapper.
 * Fixed-width date column (not content-sized) so the title's left edge
 * is identical across rows regardless of day-of-month digit count.
 * Wears the ticket-stub treatment, scaled down for a list row. */
[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > p {
    flex: 0 0 4.4rem;
    padding: 0.5rem 0.5rem 0.45rem;
    background-color: var(--site-surface);
    border-top: 3px solid var(--color-accent-fill);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.1rem;
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > p > time:nth-of-type(-n + 3) {
    display: block;
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > p > time:nth-of-type(1) {
    font-family: var(--typography-font-family), "Helvetica Neue", Arial, sans-serif;
    font-size: 0.62rem;
    font-weight: var(--typography-fontWeightMedium);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--site-text-muted);
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > p > time:nth-of-type(2) {
    font-family: var(--typography-font-family-display), Georgia, serif;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > p > time:nth-of-type(3) {
    font-family: var(--typography-font-family), "Helvetica Neue", Arial, sans-serif;
    font-size: 0.72rem;
    font-weight: var(--typography-fontWeightMedium);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent-text);
}

/* The long-form fallback (4th <time> onward) + separator atoms stay in
 * the DOM for no-JS but are not part of the stub visual. */
[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > p > time:nth-of-type(n + 4),
[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > p > span {
    display: none;
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > div {
    flex: 1 1 auto;
    min-width: 0;
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > div > h3 {
    margin: 0 0 0.125rem 0;
    font-size: var(--type-h3);
    font-weight: 700;
    line-height: 1.3;
}

/* Ticket link in a list row: quiet brass text-CTA with a trailing
 * arrow, not a boxed button — the row stays a ledger line. */
[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > div > div:has(> a[href]) {
    margin-top: 0.35rem;
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > div > div:has(> a[href]) > a {
    font-family: var(--typography-font-family), "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: var(--typography-fontWeightMedium);
    color: var(--color-accent-link);
    text-decoration: none;
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > div > div:has(> a[href]) > a::after {
    content: " \2192";
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > div > div:has(> a[href]) > a:hover,
[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > div > div:has(> a[href]) > a:focus-visible {
    text-decoration: underline;
    color: var(--color-accent-link-hover);
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > div > h3 a {
    color: inherit;
    text-decoration: none;
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > div > h3 a:hover,
[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > div > h3 a:focus-visible {
    text-decoration: underline;
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="embedded"], [data-fmt="teaser"]) > div > address {
    font-size: 0.875rem;
    color: var(--site-text-muted);
}

/* ============= Event tile =============
 * canonical/cms-event/card.ftlh: the tile grid, the sidebar rail and the
 * format preview. A surface card: a 4:3 photo (a brand block without one),
 * the date, the title, whose link covers the tile, the venue and the ticket
 * display, "Get tickets" stacked above the covering link. */
[data-cms-e][data-sn="cms-event"][data-fmt="card"] {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin: 0;
    padding-bottom: 1.25rem;
    overflow: hidden;
    background-color: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--radius-lg);
    color: var(--site-text);
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > * {
    margin-inline: 1.25rem;
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > figure,
[data-cms-e][data-sn="cms-event"][data-fmt="card"]:not(:has(> figure))::before {
    align-self: stretch;
    margin: 0 0 0.65rem;
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"]:not(:has(> figure))::before {
    content: "";
    aspect-ratio: 4 / 3;
    background-color: var(--color-primary-fill);
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > figure img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0;
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > p:not([data-an]) {
    margin-block: 0;
    font-size: var(--type-eyebrow);
    font-weight: var(--typography-fontWeightBold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary-text);
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > h3 {
    margin-block: 0;
    font-size: var(--type-h3);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > h3 a {
    color: inherit;
    text-decoration: none;
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > h3 a:hover {
    text-decoration: underline;
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > h3 a:focus-visible {
    outline: none;
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"]:has(> h3 a:focus-visible) {
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 2px;
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > p[data-an="cms.event.venue-name"],
[data-cms-e][data-sn="cms-event"][data-fmt="card"] > span {
    margin-block: 0;
    font-size: 0.875rem;
    color: var(--site-text-muted);
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > nav {
    position: relative;
    z-index: 2;
    margin-top: 0.5rem;
}

[data-cms-e][data-sn="cms-event"][data-fmt="card"] > nav > a {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

@media (prefers-reduced-motion: no-preference) {
    [data-cms-e][data-sn="cms-event"][data-fmt="card"] {
        transition: transform 150ms ease, box-shadow 150ms ease;
    }

    [data-cms-e][data-sn="cms-event"][data-fmt="card"]:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lift);
    }
}

/* ============= Event cover + feature =============
 * canonical/cms-event/cover.ftlh, which feature includes: an aria-hidden
 * lead-image layer (z-0), a contrast scrim (z-1), and a foreground column
 * (z-2). Values are the content-carousel-slide / simple-page overlay idiom's.
 * With no lead image there is no scrim and the stage is the brand colour, as
 * simple-cta is. The landing-page and simple-page covers are the same stage
 * and join these rules by selector. */
[data-cms-e][data-sn="landing-page"][data-fmt="cover"],
[data-cms-e][data-sn="simple-page"][data-fmt="cover"],
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    box-sizing: border-box;
    min-height: clamp(16rem, 38vw, 26rem);
    margin: 0 0 1.5rem 0;
    border-radius: 4px;
    background-color: var(--color-primary-fill);
    color: var(--site-overlay-text);
}

/* Contrast scrim between image and content, drawn only when the image layer is
 * there — sits outside the aria-hidden layer so it is never faded with the image. */
[data-cms-e][data-sn="landing-page"][data-fmt="cover"]:has(> div[aria-hidden="true"])::after,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"]:has(> div[aria-hidden="true"])::after,
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]):has(> div[aria-hidden="true"])::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: var(--scrim-full);
}

[data-cms-e][data-sn="landing-page"][data-fmt="cover"] > div[aria-hidden="true"],
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] > div[aria-hidden="true"],
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div[aria-hidden="true"] {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div[aria-hidden="true"] > [data-cms-a],
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] > div[aria-hidden="true"] [data-cms-e][data-etype="media"],
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div[aria-hidden="true"] [data-cms-e][data-etype="media"] {
    width: 100%;
    height: 100%;
    margin: 0;
}

[data-cms-e][data-sn="landing-page"][data-fmt="cover"] > div[aria-hidden="true"] img,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] > div[aria-hidden="true"] img,
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div[aria-hidden="true"] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
    display: block;
}

/* The lead image's own caption is noise behind the title. */
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] > div[aria-hidden="true"] figcaption,
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div[aria-hidden="true"] figcaption {
    display: none;
}

/* Foreground column. */
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] > div:not([aria-hidden]),
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] > div:not([aria-hidden]),
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div:not([aria-hidden]) {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    min-width: 0;
    box-sizing: border-box;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

/* Eyebrow: the WHEN line, above the title. The photo eyebrow, not the
 * accent token — it sits over a photo, so it stays constant across colour
 * schemes like the overlay tokens do. */
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div:not([aria-hidden]) > h3 {
    margin: 0 0 1rem 0;
    font-family: var(--typography-font-family), "Helvetica Neue", Arial, sans-serif;
    font-size: var(--type-eyebrow);
    line-height: 1.2;
    font-weight: var(--typography-fontWeightMedium);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--site-photo-eyebrow);
}

/* Title is h2, not h1: feature and cover both render inside another page. */
[data-cms-e][data-sn="landing-page"][data-fmt="cover"] > div:not([aria-hidden]) > h2,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] > div:not([aria-hidden]) > h2,
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div:not([aria-hidden]) > h2 {
    margin: 0 0 0.75rem 0;
    font-size: var(--type-display);
    font-weight: 600;
    line-height: 1.08;
    max-width: 18ch;
    color: inherit;
}

/* Venue, over the scrim: the muted body token would disappear on a photo. */
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div:not([aria-hidden]) > address {
    margin: 0 0 1rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5em;
    font-style: normal;
    font-size: 0.9375rem;
    color: inherit;
    opacity: 0.9;
}

[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div:not([aria-hidden]) > address a {
    color: inherit;
}

/* Free-ticket badge — a sibling of the <nav>, never inside it: the CTA
 * rules pick primary/secondary by position among the nav's children. */
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div:not([aria-hidden]) > span {
    margin: 0 0 0.75rem 0;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: var(--typography-fontWeightMedium);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background-color: rgba(255, 255, 255, 0.18);
    color: var(--site-overlay-text);
}

[data-cms-e][data-sn="landing-page"][data-fmt="cover"] > div:not([aria-hidden]) > nav,
[data-cms-e][data-sn="simple-page"][data-fmt="cover"] > div:not([aria-hidden]) > nav,
[data-cms-e][data-sn="cms-event"]:is([data-fmt="feature"], [data-fmt="cover"]) > div:not([aria-hidden]) > nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* No image: brand fill, text-on-fill ink; the carousel eyebrow is out-specified by name. */
[data-cms-e]:is([data-fmt="cover"]:not([data-sn="content-carousel-slide"]), [data-sn="cms-event"][data-fmt="feature"]):not(:has(> div[aria-hidden="true"])) {
    color: var(--color-primary-text-on-fill);
}

[data-cms-e]:is([data-fmt="cover"]:not([data-sn="content-carousel-slide"]), [data-sn="cms-event"][data-fmt="feature"]):not(:has(> div[aria-hidden="true"])) > div:not([aria-hidden]) > :is(h3, span),
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e][data-sn="cms-event"]:not(:has(> div[aria-hidden="true"])) > div:not([aria-hidden]) > h3 {
    color: inherit;
}

[data-cms-e]:is([data-fmt="cover"]:not([data-sn="content-carousel-slide"]), [data-sn="cms-event"][data-fmt="feature"]):not(:has(> div[aria-hidden="true"])) > div:not([aria-hidden]) > nav a:nth-child(2) {
    color: inherit;
    border-color: currentColor;
}

[data-cms-e]:is([data-fmt="cover"]:not([data-sn="content-carousel-slide"]), [data-sn="cms-event"][data-fmt="feature"]):not(:has(> div[aria-hidden="true"])) a:focus-visible,
[data-cms-e][data-sn="content-carousel"] > [data-cms-a][data-an="cms.slides"] > [data-cms-e][data-sn="cms-event"]:not(:has(> div[aria-hidden="true"])) > div:not([aria-hidden]) a:focus-visible {
    outline-color: var(--color-primary-text-on-fill);
}

/* ─── X-up adapters: equal-column layouts ─────────────────────────────
 *
 * adapter-1-1 / 1-1-1 / 1-1-1-1 each render their N slot refs in N
 * equal columns via CSS grid. Each slot is a single REFERENCE
 * attribute (cms.adapter.slot1..N) emitted as an embedded child by
 * the subtype's template; the grid places each child in one column.
 *
 * Responsive collapse mirrors simple-cta-group: 3- and 4-up drop to
 * 2 columns at the 768px tablet threshold; everything stacks to one
 * column below 480px so children stay readable.
 */
[data-cms-e][data-sn="adapter-1-1"],
[data-cms-e][data-sn="adapter-1-1-1"],
[data-cms-e][data-sn="adapter-1-1-1-1"] {
    display: grid;
    gap: 1.5rem;
    margin: 0 0 1.5rem 0;
}

[data-cms-e][data-sn="adapter-1-1"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Embedded articles inside adapter slots render as portrait cards
 * (the About-page directors row): white card, lead image as a
 * portrait column, title/subtitle/read-more beside it. */
:is([data-cms-e][data-sn="adapter-1-1"], [data-cms-e][data-sn="adapter-1-1-1"], [data-cms-e][data-sn="adapter-1-1-1-1"]) [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="embedded"] {
    display: grid;
    grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
    gap: 0 1.4rem;
    align-content: center;
    background-color: var(--site-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    padding-right: 1.4rem;
}

:is([data-cms-e][data-sn="adapter-1-1"], [data-cms-e][data-sn="adapter-1-1-1"], [data-cms-e][data-sn="adapter-1-1-1-1"]) [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="embedded"] > [data-cms-a][data-an="cms.lead-image"] {
    grid-row: 1 / 6;
    grid-column: 1;
    align-self: stretch;
    min-height: 14rem;
    position: relative;
}

:is([data-cms-e][data-sn="adapter-1-1"], [data-cms-e][data-sn="adapter-1-1-1"], [data-cms-e][data-sn="adapter-1-1-1-1"]) [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="embedded"] > [data-cms-a][data-an="cms.lead-image"] figure {
    position: absolute;
    inset: 0;
    margin: 0;
}

:is([data-cms-e][data-sn="adapter-1-1"], [data-cms-e][data-sn="adapter-1-1-1"], [data-cms-e][data-sn="adapter-1-1-1-1"]) [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="embedded"] > [data-cms-a][data-an="cms.lead-image"] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

:is([data-cms-e][data-sn="adapter-1-1"], [data-cms-e][data-sn="adapter-1-1-1"], [data-cms-e][data-sn="adapter-1-1-1-1"]) [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="embedded"] figcaption {
    display: none;
}

/* Text cells: title in the display face, subtitle as a brass role
 * line (the pack uses it for "Musical Director" etc.). */
:is([data-cms-e][data-sn="adapter-1-1"], [data-cms-e][data-sn="adapter-1-1-1"], [data-cms-e][data-sn="adapter-1-1-1-1"]) [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="embedded"] > [data-cms-a][data-an="cms.title"] {
    grid-column: 2;
    margin-top: 1.2rem;
    font-family: var(--typography-font-family-display), Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.15;
}

:is([data-cms-e][data-sn="adapter-1-1"], [data-cms-e][data-sn="adapter-1-1-1"], [data-cms-e][data-sn="adapter-1-1-1-1"]) [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="embedded"] > [data-cms-a][data-an="cms.subtitle"] {
    grid-column: 2;
    margin: 0.25rem 0 0.6rem;
    font-size: 0.78rem;
    font-weight: var(--typography-fontWeightMedium);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-accent-text);
}

/* A bio's description: body text under the role, its length the author's. */
:is([data-cms-e][data-sn="adapter-1-1"], [data-cms-e][data-sn="adapter-1-1-1"], [data-cms-e][data-sn="adapter-1-1-1-1"]) [data-cms-e][data-sn="bio"][data-fmt="embedded"] > [data-cms-a][data-an="cms.description-html"] {
    grid-column: 2;
    margin: 0 0 0.75rem;
}

:is([data-cms-e][data-sn="adapter-1-1"], [data-cms-e][data-sn="adapter-1-1-1"], [data-cms-e][data-sn="adapter-1-1-1-1"]) [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="embedded"] > :is([data-cms-a][data-an="cms.author"], [data-cms-a][data-an="cms.date"]) {
    display: none;
}

:is([data-cms-e][data-sn="adapter-1-1"], [data-cms-e][data-sn="adapter-1-1-1"], [data-cms-e][data-sn="adapter-1-1-1-1"]) [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="embedded"] > a {
    grid-column: 2;
    margin: 0 0 1.2rem;
}

[data-cms-e][data-sn="adapter-1-1-1"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

[data-cms-e][data-sn="adapter-1-1-1-1"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 768px) {
    [data-cms-e][data-sn="adapter-1-1-1"],
    [data-cms-e][data-sn="adapter-1-1-1-1"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    [data-cms-e][data-sn="adapter-1-1"],
    [data-cms-e][data-sn="adapter-1-1-1"],
    [data-cms-e][data-sn="adapter-1-1-1-1"] {
        grid-template-columns: 1fr;
    }
}

/* ============= Nav Marker — table of contents =============
 * Public render of <@kds.render etype="webcontent" sn="nav-marker" />: the
 * shared nav.ftlh emits a class-free, recursively-nested <ul>/<li>/<a> tree
 * under the [data-sn="nav-marker"] wrapper. Styled here as a calm, modern
 * table of contents (NOT a nav bar) — a bordered card; top-level rows are
 * section headings with a small diamond marker and a hover-in arrow; nested
 * children indent under a vertical guide line. Levels are distinguished
 * structurally ( > ul > li = top level, ul ul = children) since the theme
 * adds no classes. Built for one or two levels of nesting; a third just
 * deepens the indent. Used by the members area but applies to any nav-marker.
 */
[data-cms-e][data-sn="nav-marker"] {
    margin: 0 0 1rem 0;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--site-border);
    border-radius: 12px;
    background: var(--site-surface);
    box-shadow: 0 1px 3px var(--site-shadow);
}

[data-cms-e][data-sn="nav-marker"] ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Top-level rows divided by hairlines — each reads as a section. */
[data-cms-e][data-sn="nav-marker"] > ul > li + li {
    border-top: 1px solid var(--site-border);
}

/* The clickable row (an <a>, or a <span> / disclosure <button> when there is no public URL). */
[data-cms-e][data-sn="nav-marker"] a,
[data-cms-e][data-sn="nav-marker"] span,
[data-cms-e][data-sn="nav-marker"] li > button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--site-text);
    transition: color 150ms ease, background-color 150ms ease;
}

/* Top-level link = section heading, with a small diamond marker. */
[data-cms-e][data-sn="nav-marker"] > ul > li > a,
[data-cms-e][data-sn="nav-marker"] > ul > li > span,
[data-cms-e][data-sn="nav-marker"] > ul > li > button {
    padding: 0.8rem 0.25rem;
    font-size: 1.05rem;
    font-weight: var(--typography-fontWeightMedium);
}

/* The current page (rendered by nav.ftlh as a non-link aria-current span or button) is
 * bolded so it reads as "you are here"; it carries no hover affordance. */
[data-cms-e][data-sn="nav-marker"] [aria-current="page"] {
    font-weight: var(--typography-fontWeightBold);
    color: var(--site-text);
    cursor: default;
}

/* Trailing arrow on top-level links — slides in on hover/focus. */
[data-cms-e][data-sn="nav-marker"] > ul > li > a::after {
    content: "\2192"; /* → */
    margin-left: auto;
    color: var(--color-primary-link);
    opacity: 0;
    transform: translateX(-0.35rem);
    transition: opacity 150ms ease, transform 150ms ease;
}
[data-cms-e][data-sn="nav-marker"] > ul > li > a:hover,
[data-cms-e][data-sn="nav-marker"] > ul > li > a:focus-visible {
    color: var(--color-primary-link);
}
[data-cms-e][data-sn="nav-marker"] > ul > li > a:focus-visible {
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 2px;
}
[data-cms-e][data-sn="nav-marker"] > ul > li > a:hover::after,
[data-cms-e][data-sn="nav-marker"] > ul > li > a:focus-visible::after {
    opacity: 1;
    transform: translateX(0);
}

/* Nested children — lightly indented under a vertical guide line. */
[data-cms-e][data-sn="nav-marker"] ul ul {
    margin: 0 0 0.6rem 0.35rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--site-border);
}
[data-cms-e][data-sn="nav-marker"] ul ul a,
[data-cms-e][data-sn="nav-marker"] ul ul span,
[data-cms-e][data-sn="nav-marker"] ul ul button {
    padding: 0.4rem 0.55rem;
    margin: 0.1rem 0;
    font-size: 0.95rem;
    border-radius: 7px;
    color: var(--site-text-muted);
}
[data-cms-e][data-sn="nav-marker"] ul ul a:hover,
[data-cms-e][data-sn="nav-marker"] ul ul a:focus-visible {
    color: var(--color-primary-link);
    background: var(--site-surface-alt);
}
[data-cms-e][data-sn="nav-marker"] ul ul a:focus-visible {
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 2px;
}

/* A third level (rare) — just tighten the bottom gap. */
[data-cms-e][data-sn="nav-marker"] ul ul ul {
    margin-bottom: 0.35rem;
}


/* ============= Per-format editorial pass =============
 * Prose measure, pull-quotes, roster ledgers, and card compaction.
 * Composes on the riverside-design-plan §3 tokens; selectors stay on
 * the pipeline-emitted identifiers per the class-free convention.
 */

/* Long-form prose reads at the measure. rich-text-block centres inside
 * full-bleed landing rows; simple-page body keeps its left edge. */
[data-cms-e][data-sn="rich-text-block"]:is([data-fmt="full"], [data-fmt="feature"]) > [data-cms-a][data-an="cms.body-html"] {
    max-width: var(--measure);
    margin-inline: auto;
    line-height: 1.68;
}

[data-cms-e][data-sn="simple-page"] > [data-cms-a][data-atype="text"] {
    max-width: var(--measure);
    line-height: 1.68;
}

/* Author-typed pull-quote: a plain rich-text <blockquote> becomes the
 * editorial pull — display face against a brass rule. A trailing
 * <cite> (optional) drops to an attribution line. */
[data-cms-a][data-an="cms.body-html"] blockquote {
    margin: 2.2rem 0;
    padding-left: 1.4rem;
    border-left: 3px solid var(--color-accent-fill);
    font-family: var(--typography-font-family-display), Georgia, serif;
    font-size: 1.5rem;
    line-height: 1.35;
    color: var(--site-text-muted);
}

[data-cms-a][data-an="cms.body-html"] blockquote cite {
    display: block;
    margin-top: 0.6rem;
    font-family: var(--typography-font-family), "Helvetica Neue", Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: var(--typography-fontWeightMedium);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent-text);
    font-style: normal;
}

/* Roster ledger: a long (5+) list in rich text reads as a two-column
 * ledger with hairline rows — the About-page board list. Short lists
 * keep normal bullets. */
[data-cms-e][data-sn="rich-text-block"] > [data-cms-a][data-an="cms.body-html"] ul:has(> li:nth-child(5)) {
    list-style: none;
    margin: 1.2rem 0 0;
    padding: 0;
    columns: 2;
    column-gap: 3rem;
}

[data-cms-e][data-sn="rich-text-block"] > [data-cms-a][data-an="cms.body-html"] ul:has(> li:nth-child(5)) > li {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--site-border);
    break-inside: avoid;
}

@media (max-width: 640px) {
    [data-cms-e][data-sn="rich-text-block"] > [data-cms-a][data-an="cms.body-html"] ul:has(> li:nth-child(5)) {
        columns: 1;
    }
}

/* Card compaction (#608): compact formats drop the short metadata
 * fields and media captions; the card is a teaser, not a record. */
[data-cms-e][data-etype="media"][data-fmt="card"] figcaption {
    display: none;
}

[data-cms-e]:is([data-sn="article"], [data-sn="bio"]):is([data-fmt="card"], [data-fmt="feature"]) > :is([data-cms-a][data-an="cms.author"], [data-cms-a][data-an="cms.date"], [data-cms-a][data-an="cms.subtitle"]) {
    display: none;
}

/* Article teaser typography (embedded / card): the title div reads as
 * a display-face heading; author/date read as one muted byline. */
[data-cms-e]:is([data-sn="article"], [data-sn="bio"]):not([data-fmt="full"]) > [data-cms-a][data-an="cms.title"] {
    font-family: var(--typography-font-family-display), Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0.4rem 0 0.15rem;
}

[data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="embedded"] > :is([data-cms-a][data-an="cms.author"], [data-cms-a][data-an="cms.date"]) {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--site-text-muted);
}

/* ============= Sponsor wordmark tiles =============
 * An SVG image in a simple-cta is a wordmark/graphic, not photography —
 * the photo-card treatment (dark scrim + white overlay text) would bury
 * it. Render as a quiet logo tile instead: contained image on the logo
 * tile, no scrim, title/description hidden (the wordmark carries the
 * name). Grayscale until hover, the classic sponsor-strip idiom.
 */
[data-cms-e][data-sn="simple-cta"]:has(> [data-cms-a] > figure img[src$=".svg"]) {
    background-color: var(--site-logo-tile);
    border: 1px solid var(--site-border);
    min-height: 11rem;
    padding: 1.5rem;
}

/* The image box takes the tile's width, not its own: an SVG with only a
 * viewBox has no natural width, and Firefox shrink-wraps it to zero. */
[data-cms-e][data-sn="simple-cta"]:has(> [data-cms-a] > figure img[src$=".svg"]) > [data-cms-a]:has(> figure) {
    align-self: stretch;
}

[data-cms-e][data-sn="simple-cta"]:has(> [data-cms-a] > figure img[src$=".svg"])::before {
    display: none;
}

[data-cms-e][data-sn="simple-cta"]:has(> [data-cms-a] > figure img[src$=".svg"]) > [data-cms-a] > figure[data-cms-e][data-etype="media"] {
    position: static;
    inset: auto;
    z-index: auto;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center stretch;
}

[data-cms-e][data-sn="simple-cta"]:has(> [data-cms-a] > figure img[src$=".svg"]) > [data-cms-a] > figure[data-cms-e][data-etype="media"] img {
    width: min(100%, 17rem);
    height: auto;
    max-height: 7.5rem;
    margin-inline: auto;
    object-fit: contain;
    filter: grayscale(1);
    opacity: 0.68;
    transition: filter 180ms ease, opacity 180ms ease;
}

[data-cms-e][data-sn="simple-cta"]:has(> [data-cms-a] > figure img[src$=".svg"]):hover > [data-cms-a] > figure[data-cms-e][data-etype="media"] img,
[data-cms-e][data-sn="simple-cta"]:has(> [data-cms-a] > figure img[src$=".svg"]):focus-within > [data-cms-a] > figure[data-cms-e][data-etype="media"] img {
    filter: none;
    opacity: 1;
}

[data-cms-e][data-sn="simple-cta"]:has(> [data-cms-a] > figure img[src$=".svg"]) > h3,
[data-cms-e][data-sn="simple-cta"]:has(> [data-cms-a] > figure img[src$=".svg"]) > [data-cms-a][data-atype="text"] {
    display: none;
}

/* Wordmark figcaptions never show (the media title would repeat the
 * name under the mark). */
[data-cms-e][data-sn="simple-cta"]:has(> [data-cms-a] > figure img[src$=".svg"]) figcaption {
    display: none;
}

/* ============= News index teasers =============
 * Articles referenced as landing rows render at feature: a horizontal
 * teaser card — image column, display-face title, read-more — instead
 * of a full-width photo dump. Scoped to landing rows so adapter slots
 * and other contexts keep their own treatments. A teaser row anywhere
 * wears the same card; the event row keeps its own ledger line.
 */
:is([data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="feature"], [data-cms-e][data-fmt="teaser"]:not([data-sn="cms-event"], [data-sn="bio"])) {
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
    gap: 0 1.75rem;
    align-content: center;
    max-width: 56rem;
    /* teasers read as a list — tighter than the landing section gap
     * (sibling margins collapse, so article-to-article gaps stay 1.5rem
     * while the gap after the intro keeps the section rhythm) */
    margin-block: 1.5rem;
    margin-inline: auto;
    background-color: var(--site-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    padding-right: 1.75rem;
}

:is([data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="feature"], [data-cms-e][data-fmt="teaser"]:not([data-sn="cms-event"], [data-sn="bio"])) > [data-cms-a][data-an="cms.lead-image"] {
    grid-row: 1 / 6;
    grid-column: 1;
    align-self: stretch;
    min-height: 12rem;
    position: relative;
}

:is([data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="feature"], [data-cms-e][data-fmt="teaser"]:not([data-sn="cms-event"], [data-sn="bio"])) > [data-cms-a][data-an="cms.lead-image"] figure {
    position: absolute;
    inset: 0;
    margin: 0;
}

:is([data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="feature"], [data-cms-e][data-fmt="teaser"]:not([data-sn="cms-event"], [data-sn="bio"])) > [data-cms-a][data-an="cms.lead-image"] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

:is([data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="feature"], [data-cms-e][data-fmt="teaser"]:not([data-sn="cms-event"], [data-sn="bio"])) figcaption {
    display: none;
}

:is([data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="feature"], [data-cms-e][data-fmt="teaser"]:not([data-sn="cms-event"], [data-sn="bio"])) > [data-cms-a][data-an="cms.title"] {
    grid-column: 2;
    margin-top: 1.5rem;
    font-family: var(--typography-font-family-display), Georgia, serif;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.15;
}

/* The news teaser keeps its subtitle (deck line) — override the
 * generic feature-format compaction for this context. */
:is([data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="feature"], [data-cms-e][data-fmt="teaser"]:not([data-sn="cms-event"], [data-sn="bio"])) > [data-cms-a][data-an="cms.subtitle"] {
    display: block;
    grid-column: 2;
    margin: 0.35rem 0 0;
    color: var(--site-text-muted);
}

[data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="bio"][data-fmt="feature"] > [data-cms-a][data-an="cms.description-html"] {
    grid-column: 2;
    margin: 0.75rem 0 0;
}

:is([data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="feature"], [data-cms-e][data-fmt="teaser"]:not([data-sn="cms-event"], [data-sn="bio"])) > a {
    grid-column: 2;
    margin: 0.75rem 0 1.5rem;
}

@media (max-width: 640px) {
    :is([data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="feature"], [data-cms-e][data-fmt="teaser"]:not([data-sn="cms-event"], [data-sn="bio"])) {
        display: block;
        padding: 0 0 1.25rem;
    }

    :is([data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="feature"], [data-cms-e][data-fmt="teaser"]:not([data-sn="cms-event"], [data-sn="bio"])) > [data-cms-a][data-an="cms.lead-image"] {
        position: relative;
        min-height: 11rem;
        display: block;
    }

    :is([data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e]:is([data-sn="article"], [data-sn="bio"])[data-fmt="feature"], [data-cms-e][data-fmt="teaser"]:not([data-sn="cms-event"], [data-sn="bio"])) > :is([data-cms-a][data-an="cms.title"], [data-cms-a][data-an="cms.subtitle"], a) {
        margin-left: 1.25rem;
        margin-right: 1.25rem;
    }

    [data-cms-e][data-sn="landing-page"] > [data-cms-a] > [data-cms-e][data-sn="bio"][data-fmt="feature"] > [data-cms-a][data-an="cms.description-html"] {
        margin-left: 1.25rem;
        margin-right: 1.25rem;
    }
}

/* ============= Bio =============
 * A bio's lead image is a portrait: wherever a card crops it, the crop
 * keeps the top, so heads stay in frame. */
[data-cms-e][data-sn="bio"]:not([data-fmt="full"]) > [data-cms-a][data-an="cms.lead-image"] img {
    object-position: center top;
}

/* At teaser a bio is a person in a list: a round portrait beside the name and
 * role, or an initials disc on the brand fill. */
[data-cms-e][data-sn="bio"][data-fmt="teaser"] {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr);
    column-gap: 1rem;
    align-items: center;
}

[data-cms-e][data-sn="bio"][data-fmt="teaser"] > :is(figure, span[aria-hidden="true"]) {
    grid-row: 1 / span 2;
    width: 4rem;
    aspect-ratio: 1;
    margin: 0;
    border-radius: 50%;
    overflow: hidden;
}

[data-cms-e][data-sn="bio"][data-fmt="teaser"] > figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

[data-cms-e][data-sn="bio"][data-fmt="teaser"] > span[aria-hidden="true"] {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--typography-fontWeightBold);
    background-color: var(--color-primary-fill);
    color: var(--color-primary-text-on-fill);
}

[data-cms-e][data-sn="bio"][data-fmt="teaser"] > h3 {
    grid-column: 2;
    align-self: end;
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.25;
}

[data-cms-e][data-sn="bio"][data-fmt="teaser"]:not(:has(> p)) > h3 {
    grid-row: 1 / span 2;
    align-self: center;
}

[data-cms-e][data-sn="bio"][data-fmt="teaser"] > h3 a {
    color: inherit;
}

[data-cms-e][data-sn="bio"][data-fmt="teaser"] > p {
    grid-column: 2;
    align-self: start;
    margin: 0;
    font-size: 0.875rem;
    color: var(--site-text-muted);
}

/* At full a bio is a profile page: the portrait in a left column, the name
 * (the page's h1), role and body beside it at the measure; one column on a
 * phone, portrait first. A bio with no portrait keeps the plain flow, so no
 * empty column opens. */
[data-cms-e][data-sn="bio"][data-fmt="full"]:has(> [data-cms-a][data-an="cms.lead-image"] img) {
    display: grid;
    grid-template-columns: minmax(12rem, 20rem) minmax(0, var(--measure));
    grid-auto-rows: min-content;
    column-gap: clamp(2rem, 4vw, 3.5rem);
    justify-content: center;
}

[data-cms-e][data-sn="bio"][data-fmt="full"]:has(> [data-cms-a][data-an="cms.lead-image"] img) > * {
    grid-column: 2;
}

[data-cms-e][data-sn="bio"][data-fmt="full"]:has(> [data-cms-a][data-an="cms.lead-image"] img) > [data-cms-a][data-an="cms.lead-image"] {
    grid-column: 1;
    grid-row: 1 / span 20;
    align-self: start;
}

[data-cms-e][data-sn="bio"][data-fmt="full"] > [data-cms-a][data-an="cms.lead-image"] figure {
    margin: 0;
}

[data-cms-e][data-sn="bio"][data-fmt="full"] > [data-cms-a][data-an="cms.lead-image"] img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

[data-cms-e][data-sn="bio"][data-fmt="full"] > [data-cms-a][data-an="cms.title"] > h1 {
    margin: 0;
    font-size: var(--type-h2);
    font-weight: 600;
    line-height: 1.1;
}

[data-cms-e][data-sn="bio"][data-fmt="full"] > [data-cms-a][data-an="cms.subtitle"] {
    margin: 0.6rem 0 0;
    font-size: var(--type-eyebrow);
    font-weight: var(--typography-fontWeightMedium);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-accent-text);
}

[data-cms-e][data-sn="bio"][data-fmt="full"] > [data-cms-a][data-an="cms.body-html"] {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--site-border);
    line-height: 1.68;
}

[data-cms-e][data-sn="bio"][data-fmt="full"] > [data-cms-a][data-an="cms.body-html"] > p:first-child {
    margin-top: 0;
}

@media (max-width: 768px) {
    [data-cms-e][data-sn="bio"][data-fmt="full"]:has(> [data-cms-a][data-an="cms.lead-image"] img) {
        grid-template-columns: minmax(0, 1fr);
    }

    [data-cms-e][data-sn="bio"][data-fmt="full"]:has(> [data-cms-a][data-an="cms.lead-image"] img) > * {
        grid-column: 1;
    }

    [data-cms-e][data-sn="bio"][data-fmt="full"]:has(> [data-cms-a][data-an="cms.lead-image"] img) > [data-cms-a][data-an="cms.lead-image"] {
        grid-row: auto;
        max-width: 16rem;
        margin-bottom: 1.5rem;
    }
}

/* ============= External Video =============
 * canonical/video-ext: a responsive player (YouTube/Vimeo iframe) or,
 * for unknown providers, an external link card. Class-free — keyed on
 * the pipeline wrapper + the elements the templates emit (iframe,
 * fallback <a>, figcaption). The card format never loads a player; it
 * is a linked teaser tile with a play glyph.
 */
[data-cms-e][data-sn="video-ext"] {
    margin: 0 0 1.5rem 0;
    padding: 0;
}

[data-cms-e][data-sn="video-ext"] iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--radius-sm);
    background-color: #000;
}

[data-cms-e][data-sn="video-ext"] > figcaption {
    font-size: 0.875rem;
    color: var(--site-text-muted);
    margin-top: 0.5rem;
}

/* Fallback / teaser link: a quiet card with a play glyph — used for
 * non-embeddable providers at every format and for ALL providers at
 * card (players stay out of grids). */
[data-cms-e][data-sn="video-ext"] > a {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.1rem 1.25rem;
    background-color: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--radius-lg);
    font-weight: var(--typography-fontWeightMedium);
    color: var(--site-text);
    text-decoration: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

[data-cms-e][data-sn="video-ext"] > a::before {
    content: "\25b6"; /* ▶ */
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background-color: var(--color-accent-fill);
    color: var(--color-accent-text-on-fill);
    font-size: 0.8rem;
    padding-left: 0.15rem; /* optical centring of the glyph */
}

[data-cms-e][data-sn="video-ext"] > a:hover,
[data-cms-e][data-sn="video-ext"] > a:focus-visible {
    border-color: var(--color-accent-fill);
    box-shadow: var(--shadow-card);
    color: var(--site-text);
    text-decoration: none;
}

[data-cms-e][data-sn="video-ext"] > a:focus-visible {
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 2px;
}

/* Feature: the player runs edge-to-edge of its row with a touch more
 * presence; caption centres under it. */
[data-cms-e][data-sn="video-ext"][data-fmt="feature"] > figcaption {
    text-align: center;
}

/* Card teaser: fills its grid cell so video tiles align with
 * neighbouring cards. */
[data-cms-e][data-sn="video-ext"][data-fmt="card"] {
    display: flex;
    margin: 0;
}

[data-cms-e][data-sn="video-ext"][data-fmt="card"] > a {
    flex: 1 1 auto;
    min-height: 6.5rem;
}

/* ============= Map ============= */
[data-cms-e][data-sn="map"] {
    margin: 0 0 1.5rem 0;
}

[data-cms-e][data-sn="map"] > h2 {
    margin: 0 0 0.25rem;
}

[data-cms-e][data-sn="map"] > p {
    margin: 0 0 0.75rem;
    color: var(--site-text-muted);
}

[data-cms-e][data-sn="map"] > iframe,
article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > dl dd > iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--site-border);
    border-radius: var(--radius-sm);
    background-color: var(--site-surface);
}

[data-cms-e][data-sn="map"]:is([data-fmt="card"], [data-fmt="embedded"]) > iframe {
    aspect-ratio: 4 / 3;
}

article[data-cms-e][data-sn="cms-event"][data-fmt="full"] > header > dl dd > iframe {
    margin-top: 0.75rem;
    aspect-ratio: 4 / 3;
}

[data-cms-e][data-sn="map"] > a {
    font-weight: var(--typography-fontWeightMedium);
}

/* ============= Inquiry thread — magic-link conversation =============
 * embedded.ftlh is class-free (styled by marker context, per the theme's
 * no-invented-data-* convention); un-styled it inherits browser default
 * label/textarea/button chrome, which puts the reply label beside a half-
 * width textarea and a ~20px-tall submit button — both fail on a phone.
 * Scoped to this marker only; the theme's other form markers are a
 * separate concern. */
[data-cms-e][data-sn="inquiry-thread"] ol {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

[data-cms-e][data-sn="inquiry-thread"] li > article {
    border: 1px solid var(--site-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

[data-cms-e][data-sn="inquiry-thread"] li > article header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: var(--site-text-muted);
}

[data-cms-e][data-sn="inquiry-thread"] form p {
    margin: 0 0 0.75rem;
}

[data-cms-e][data-sn="inquiry-thread"] form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: var(--typography-fontWeightMedium);
}

[data-cms-e][data-sn="inquiry-thread"] form textarea {
    box-sizing: border-box;
    width: 100%;
    font: inherit;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--site-border);
    border-radius: var(--radius-sm);
}

/* Reply/register CTAs — min-height meets the 44px touch target (WCAG
 * 2.5.5) that the raw <button>/<a> chrome falls well short of.
 * 44 px = the app's --target-size-touch; the theme carries no tokens. */
[data-cms-e][data-sn="inquiry-thread"] form button,
[data-cms-e][data-sn="inquiry-thread"] > p > a,
form[data-public-form-errors] button[type="submit"] {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.625rem 1.25rem;
    font: inherit;
    font-weight: var(--typography-fontWeightMedium);
    text-decoration: none;
    background-color: var(--color-accent-fill);
    color: var(--color-accent-text-on-fill);
    border: 1px solid var(--color-accent-fill);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

[data-cms-e][data-sn="inquiry-thread"] form button:hover,
[data-cms-e][data-sn="inquiry-thread"] form button:focus-visible,
[data-cms-e][data-sn="inquiry-thread"] > p > a:hover,
[data-cms-e][data-sn="inquiry-thread"] > p > a:focus-visible,
form[data-public-form-errors] button[type="submit"]:hover,
form[data-public-form-errors] button[type="submit"]:focus-visible {
    background-color: var(--color-accent-fill-hover);
    border-color: var(--color-accent-fill-hover);
}

/* The hover darkening above is the same under the pointer, so the ring is the
 * indicator. Brand navy rather than the accent the field ring uses: this
 * control is already filled with the accent. */
[data-cms-e][data-sn="inquiry-thread"] form button:focus-visible,
[data-cms-e][data-sn="inquiry-thread"] > p > a:focus-visible,
form[data-public-form-errors] button[type="submit"]:focus-visible {
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 2px;
}

/* ============= Public inquiry forms and thread states =============
 * The feedback / membership markers are class-free, so the form is styled
 * structurally. The internals hang off `form[data-public-form-errors]` rather
 * than the marker: both forms swap `outerHTML` on `closest section`, so after a
 * submit the [data-cms-e] wrapper is gone and a marker-scoped rule would drop
 * the validation-retry fragment back to stock chrome — the one render where the
 * visitor is already having a bad time. That attribute is on the themed form and
 * the retry fragment alike.
 *
 * The thread's own reply form is styled above; this submit button reuses those
 * declarations rather than restating them, so the two surfaces cannot
 * drift apart. Colour comes from tokens only, so dark mode needs nothing here. */

[data-cms-e][data-sn="feedback-form"],
[data-cms-e][data-sn="membership-inquiry"] {
    display: block;
    margin-block: 1.5rem;
}

/* Same treatment the editorial pass gives rich-text: in the full-bleed row
 * formats the content sits at the prose measure and centres, so a form placed
 * beside a rich-text block on the same page shares its left edge instead of
 * running the full width of the row. */
[data-cms-e][data-sn="feedback-form"]:is([data-fmt="full"], [data-fmt="feature"]),
[data-cms-e][data-sn="membership-inquiry"]:is([data-fmt="full"], [data-fmt="feature"]),
[data-cms-e][data-sn="inquiry-thread"]:is([data-fmt="full"], [data-fmt="feature"]) {
    max-width: var(--measure);
    margin-inline: auto;
}

/* Field rows. The templates wrap each control in a bare <p>, which otherwise
 * carries the body paragraph rhythm and reads as prose rather than a form. */
form[data-public-form-errors] p {
    margin: 0 0 1rem;
}

form[data-public-form-errors] label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: var(--typography-fontWeightMedium);
}

form[data-public-form-errors] input[type="text"],
form[data-public-form-errors] input[type="email"],
form[data-public-form-errors] input[type="tel"],
form[data-public-form-errors] select,
form[data-public-form-errors] textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: 32rem;
    font: inherit;
    color: inherit;
    background-color: var(--site-bg);
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--site-border);
    border-radius: var(--radius-sm);
}

form[data-public-form-errors] textarea {
    max-width: none;
}

form[data-public-form-errors] input:focus-visible,
form[data-public-form-errors] select:focus-visible,
form[data-public-form-errors] textarea:focus-visible,
[data-cms-e][data-sn="inquiry-thread"] form textarea:focus-visible {
    outline: 2px solid var(--color-accent-fill);
    outline-offset: 1px;
    border-color: var(--color-accent-fill);
}

/* The honeypot must stay out of layout. It ships with the HTML `hidden`
 * attribute, which `display: block` on a sibling selector could otherwise
 * defeat — this restates the intent where the form is styled. */
form[data-public-form-errors] input[hidden] {
    display: none;
}

/* Error copy: the server-rendered retry alert and the one warhol-common.js
 * appends on a transport error. Bordered rather than coloured text alone, so it
 * does not rely on colour perception to read as a problem. */
form[data-public-form-errors] > p[role="alert"],
[data-cms-e][data-sn="feedback-form"] p[role="alert"],
[data-cms-e][data-sn="membership-inquiry"] p[role="alert"],
section:has(> p[role="alert"] + form[data-public-form-errors]) > p[role="alert"] {
    margin: 0 0 1rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--site-border-strong);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    background-color: var(--site-surface-alt);
}

/* Post-submit confirmation. It replaces the marker section wholesale, so it has no
 * [data-cms-e] to hang off; its status role is what identifies it wherever the form
 * was placed. */
section[role="status"] {
    display: block;
    margin-block: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--site-border);
    border-left: 4px solid var(--color-accent-fill);
    border-radius: var(--radius-sm);
    background-color: var(--site-surface-alt);
}

section[role="status"] > :first-child {
    margin-top: 0;
}

section[role="status"] > :last-child {
    margin-bottom: 0;
}

/* Thread states the thread's own styling does not cover. The closed notice and the author-preview
 * placeholder are both bare <p> children of the marker; the Register CTA is the
 * only other direct <p> child and it is already a button, so exclude it. */
[data-cms-e][data-sn="inquiry-thread"] > p:not(:has(> a)) {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--site-border);
    border-radius: var(--radius-sm);
    background-color: var(--site-surface-alt);
    color: var(--site-text-muted);
}

/* A suppressed body and an empty thread both render as <em> standing alone;
 * muting them keeps them from reading as a visitor's actual words. */
[data-cms-e][data-sn="inquiry-thread"] li > article > div > em:only-child,
[data-cms-e][data-sn="inquiry-thread"] li > em:only-child {
    color: var(--site-text-muted);
}

/* ============= Website search (search-form + search-results) ============= */
[data-cms-e][data-sn="search-form"] form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    max-width: var(--measure);
    margin: 0 auto;
}

[data-cms-e][data-sn="search-form"] input[type="search"] {
    box-sizing: border-box;
    flex: 1 1 14rem;
    min-height: 2.75rem;
    padding: 0.625rem 1rem;
    font: inherit;
    color: var(--site-text);
    background-color: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--radius-sm);
}

[data-cms-e][data-sn="search-form"] input[type="search"]::placeholder {
    color: var(--site-text-muted);
}

[data-cms-e][data-sn="search-form"] input[type="search"]:focus-visible {
    border-color: var(--color-primary-fill);
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 2px;
}

/* Submit button. */
[data-cms-e][data-sn="search-form"] button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.625rem 1.5rem;
    font: inherit;
    font-weight: var(--typography-fontWeightMedium);
    background-color: var(--color-accent-fill);
    color: var(--color-accent-text-on-fill);
    border: 1px solid var(--color-accent-fill);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

[data-cms-e][data-sn="search-form"] button:hover,
[data-cms-e][data-sn="search-form"] button:focus-visible {
    background-color: var(--color-accent-fill-hover);
    border-color: var(--color-accent-fill-hover);
}

[data-cms-e][data-sn="search-form"] button:focus-visible {
    outline: 2px solid var(--color-primary-fill);
    outline-offset: 2px;
}

[data-cms-e][data-sn="search-results"] {
    max-width: var(--measure);
    margin: 0 auto;
}

/* Count line: the <p> a hit list follows. */
[data-cms-e][data-sn="search-results"]:has(> ul) > p:first-child {
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--site-border);
    color: var(--site-text-muted);
    font-size: 0.9rem;
}

[data-cms-e][data-sn="search-results"] > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1.5rem;
}

[data-cms-e][data-sn="search-results"] > ul > li {
    display: grid;
    gap: 0.35rem 1.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--site-border);
}

[data-cms-e][data-sn="search-results"] > ul > li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* A hit with a thumbnail. */
[data-cms-e][data-sn="search-results"] > ul > li:has(> img) {
    grid-template-columns: 5.5rem 1fr;
}

[data-cms-e][data-sn="search-results"] > ul > li > img {
    grid-row: 1 / span 2;
    width: 5.5rem;
    height: 5.5rem;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

[data-cms-e][data-sn="search-results"] > ul > li > h3 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.3;
}

[data-cms-e][data-sn="search-results"] > ul > li > h3 a {
    color: var(--color-primary-link);
    text-decoration: none;
}

[data-cms-e][data-sn="search-results"] > ul > li > h3 a:hover,
[data-cms-e][data-sn="search-results"] > ul > li > h3 a:focus-visible {
    color: var(--color-primary-link-hover);
    text-decoration: underline;
}

/* Snippet. */
[data-cms-e][data-sn="search-results"] > ul > li > p {
    margin: 0;
    color: var(--site-text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

[data-cms-e][data-sn="search-results"] > nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

[data-cms-e][data-sn="search-results"] > nav a {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.5rem 1.25rem;
    color: var(--site-text);
    text-decoration: none;
    border: 1px solid var(--site-border);
    border-radius: var(--radius-sm);
}

[data-cms-e][data-sn="search-results"] > nav a:hover,
[data-cms-e][data-sn="search-results"] > nav a:focus-visible {
    color: var(--color-primary-link);
    border-color: var(--color-primary-fill);
}

[data-cms-e][data-sn="search-results"] > nav span {
    color: var(--site-text-muted);
    font-size: 0.9rem;
}

/* The two message-only states — nothing found, and nothing asked yet. */
[data-cms-e][data-sn="search-results"]:not(:has(> ul)) > p {
    margin: 0;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--site-text-muted);
    background-color: var(--site-surface-alt);
    border: 1px solid var(--site-border);
    border-radius: var(--radius-lg);
}
