/*
 * ANKF public site — reset, base elements, layout primitives, site shell and
 * reusable components. Page-specific rules live in pages.css, which is linked
 * after this file.
 */

/* =========================================================================
   1. Reset and base elements
   ========================================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-page);
}

/*
 * `body` carries no overflow declaration on purpose: a non-visible value on
 * one axis makes the other compute to `auto`, turning body into its own
 * scroll container. Fix horizontal overflow at the component that causes it.
 */
/*
 * Fluid sizing applies to replaced *media* only.
 *
 * `svg` is deliberately excluded from `max-width: 100%; height: auto`. Every
 * icon in this project is an inline SVG sized by its own component rule, and
 * `height: auto` on those collapses the glyph the moment a component forgets
 * an explicit height -- the failure the responsive brief calls out. SVGs keep
 * `display: block` for layout consistency and nothing else; their dimensions
 * stay the component's business.
 */
img,
picture,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

svg {
    display: block;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 var(--space-3);
    line-height: var(--leading-tight);
    text-wrap: balance;
}

p {
    margin: 0 0 var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

ul,
ol {
    margin: 0 0 var(--space-4);
    padding-left: 1.25rem;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

table {
    border-collapse: collapse;
    width: 100%;
}

:focus-visible {
    outline: var(--focus-width) solid var(--focus-ring);
    outline-offset: var(--focus-offset);
    border-radius: var(--radius-sm);
}

::selection {
    background: var(--accent-highlight);
    color: var(--navy-950);
}

/* =========================================================================
   2. Utilities
   ========================================================================= */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: var(--space-3);
    left: var(--space-3);
    z-index: 100;
    padding: var(--space-3) var(--space-4);
    background: var(--accent-primary);
    color: #fff;
    font-weight: 700;
    border-radius: var(--radius-md);
    text-decoration: none;
    transform: translateY(-250%);
    transition: transform var(--duration-base) var(--easing);
}

.skip-link:focus-visible,
.skip-link:focus {
    transform: translateY(0);
}

.container {
    width: 100%;
    max-width: var(--container-content);
    margin-inline: auto;
    padding-inline: var(--page-padding);
}

.container--wide {
    max-width: var(--container-wide);
}

.container--reading {
    max-width: var(--container-reading);
}

.section {
    padding-block: var(--section-spacing);
}

/*
 * The header is sticky, so an element jumped to by fragment would otherwise
 * come to rest underneath it with its heading hidden. This affects every
 * in-page link on the site: the hero's scroll cue, the nav submenus'
 * #partners-sponsors entry, and the
 * matching footer links.
 *
 * Applied to anything that can be a fragment target rather than to a list of
 * ids, so a new anchor cannot be added and forgotten. The value clears the
 * tallest single-row header with room to spare.
 */
[id] {
    scroll-margin-top: 6.5rem;
}

.section--subtle {
    background: var(--bg-subtle);
}

/* Bands are conditional -- an empty one is not rendered at all -- so which
 * sections end up adjacent is decided by the content, not by the source
 * order. Two subtle bands in a row merge into one long grey block with no
 * boundary between them, so the second falls back to the page surface and
 * the alternation survives whatever the data does. */
.section--subtle + .section--subtle {
    background: var(--bg-page);
}

.section--inverse {
    background: var(--bg-inverse);
    color: var(--text-inverse);
}

.section--brand {
    background: var(--bg-brand);
    color: var(--text-inverse);
}

/* Dark surfaces need their own border/focus colours so nested components
 * inherit corrected values rather than restating them.
 *
 * `.featured-event` is in this list because the card carries its own dark
 * navy fill wherever it is placed. It used to sit inside the dark hero and
 * inherit these values; it now lives on the light competitions section, so it
 * has to remap them itself. */
.section--inverse,
.section--brand,
.home-hero,
.page-hero,
.featured-event,
.site-footer {
    --border-default: var(--border-inverse);
    --text-primary: var(--text-inverse);
    --text-secondary: var(--text-inverse-muted);
    --text-muted: var(--white-50);
    --focus-ring: var(--gold-400);
    --surface-card: var(--surface-card-inverse);
    /* The dark gold that keeps eyebrows and section links legible on light
     * surfaces drops to 3.26:1 on navy, so these bands hand the bright brand
     * gold back. Same token, opposite surface. */
    --accent-highlight-text: var(--gold-400);
}

/*
 * Dark bands that are not part of the block above still need the light focus
 * ring: the default blue measures 1.24:1 against the ticker's navy, an
 * indicator a keyboard user cannot see. These sections are painted dark by
 * their own rules rather than by `.section--inverse`, so they opt in here.
 * The ticker carries no control of its own any more, but the credibility and
 * membership bands do, and it costs nothing to keep the strip covered.
 */
.ticker,
.credibility,
.membership-spotlight {
    --focus-ring: var(--gold-400);
}

.grid {
    display: grid;
    gap: var(--space-5);
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
}

/* auto-fill, not auto-fit: auto-fit collapses the empty tracks, so a single
   athlete card stretched across the whole row and its portrait grew to
   several times its normal size. auto-fill keeps the tracks, so a card is the
   same width whether the row holds one athlete or four. Both users of this
   grid (athlete directory, home medalists) are portrait cards. */
.grid--4 {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.scroll-x {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.plain-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bullet-list {
    padding-left: 1.1rem;
    list-style: disc;
}

.text-muted {
    color: var(--text-muted);
}

/* Pending values are never conveyed by colour alone: they always carry a word
 * such as "pending" or an explicit em dash. */
.text-pending {
    color: var(--text-muted);
    font-style: italic;
}

.eyebrow {
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-highlight-text);
}

.lead {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 62ch;
}

.section-title {
    font-size: var(--text-3xl);
    letter-spacing: -0.01em;
}

.rule-heading {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-block: var(--space-6) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-highlight-text);
}

.rule-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

/* Armenian headings are long: never force uppercase on body-language text. */
:lang(hy) .section-title,
:lang(hy) h1,
:lang(hy) h2,
:lang(hy) h3 {
    text-transform: none;
    word-break: normal;
    /*
     * `anywhere`, which this used to be, breaks a word at any character even
     * when the line had room to wrap normally -- at 320px it rendered the
     * featured event as "Championshi / p 2027". `break-word` only breaks a
     * word that genuinely cannot fit on a line of its own, which is the case
     * this rule exists for, and hyphenation handles the rest properly.
     */
    overflow-wrap: break-word;
    hyphens: auto;
}

/*
 * The heading and its trailing link sit on one baseline.
 *
 * `flex-end` was aligning boxes, and the left item is a wrapper whose bottom
 * edge is the heading's bottom PLUS the heading's own 12px margin -- so the
 * link came to rest 12px below the words it belongs to, on all four section
 * heads. `last baseline` aligns the heading's final line with the link's
 * text instead, which is the alignment the eye is actually looking for.
 * `flex-end` stays first as the fallback for engines without it; wrapping is
 * untouched, so the mobile stack is unaffected.
 */
.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    align-items: last baseline;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

/* The eyebrow defaults to gold; these name the accent explicitly where a
 * section's palette calls for a different one. */
.eyebrow--red {
    color: var(--accent-primary);
}

.eyebrow--gold {
    color: var(--gold-400);
}

.section-head--centred {
    justify-content: center;
    text-align: center;
}

/* Flex items default to min-width: auto, so a heading would refuse to shrink
   below its longest word. Armenian runs long ("իրադարձություններ" at heading
   size is wider than a 320px phone), so the title column may shrink and its
   overflow-wrap breaks the word instead of pushing the page sideways. */
.section-head > * {
    min-width: 0;
}

.section-head__link {
    font-weight: 600;
    color: var(--accent-highlight-text);
}

.section-action {
    margin-top: var(--space-6);
}

.flag-rule {
    display: block;
    height: 4px;
    background: linear-gradient(
        to right,
        var(--red-600) 0 33.33%,
        var(--blue-600) 33.33% 66.66%,
        var(--gold-500) 66.66% 100%
    );
}

/* Aspect-ratio boxes keep card imagery consistent across the whole site. */
.ratio-4x3,
.ratio-16x9,
.ratio-3x4 {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    background: var(--navy-800);
    border-radius: var(--radius-md);
}

.ratio-4x3 { aspect-ratio: 4 / 3; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-3x4 { aspect-ratio: 3 / 4; }

.ratio-4x3 > img,
.ratio-16x9 > img,
.ratio-3x4 > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================================================
   3. Site header and navigation
   ========================================================================= */

/* The header is a light surface: a clean white bar under the flag rule, with
 * dark navigation text and the ANKF red reserved for hover and active states. */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface-0);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
}

.site-header__inner {
    display: flex;
    align-items: center;
    /* Wraps rather than overflows: long translated labels must be able to
     * push the row taller, never past the viewport edge. */
    flex-wrap: wrap;
    gap: clamp(var(--space-3), 1.4vw, var(--space-5));
    width: 100%;
    max-width: var(--container-wide);
    margin-inline: auto;
    padding: var(--space-3) var(--page-padding);
}

/* The brand keeps its intrinsic width: the navigation gives way first. */
.site-header__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    flex: 0 0 auto;
    margin-right: auto;
    text-decoration: none;
}

.site-header__logo {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(242, 169, 0, 0.55);
    box-shadow: 0 0 22px rgba(242, 169, 0, 0.22);
}

.site-header__brand-text {
    display: flex;
    flex-direction: column;
}

.site-header__brand-name {
    font-size: var(--text-lg);
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--navy-900);
}

.site-header__brand-description {
    font-size: 0.6875rem;
    line-height: 1.3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    max-width: 24ch;
}

/* --- Menu button ---------------------------------------------------------- */

.nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--touch-target);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.nav-toggle:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.nav-toggle__icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 14px;
}

.nav-toggle__icon > span {
    display: block;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition:
        transform var(--duration-fast) var(--easing),
        opacity var(--duration-fast) var(--easing);
}

/* Open state morphs the three bars into a close icon. `aria-expanded` is the
 * single source of truth, so the visual and the exposed state cannot drift. */
.nav-toggle[aria-expanded="true"] .nav-toggle__icon > span:first-child {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon > span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon > span:last-child {
    transform: translateY(-6px) rotate(-45deg);
}

.nav-toggle__label {
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* --- Navigation links ----------------------------------------------------- */

.primary-navigation__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-navigation__list a {
    display: flex;
    align-items: center;
    min-height: var(--touch-target);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.primary-navigation__list a:hover {
    color: var(--accent-primary);
    background: var(--surface-50);
}

/* Active page is marked by colour AND a persistent underline bar, so the state
 * is never conveyed by colour alone. */
.primary-navigation__list a[aria-current="page"] {
    color: var(--accent-primary);
    font-weight: 700;
    box-shadow: inset 0 -3px 0 var(--accent-primary);
}

/* --- Navigation submenus -------------------------------------------------- */
/* The parent item stays a link to a real page; a sibling button owns the
 * disclosure. `aria-expanded` on that button drives every visual state here,
 * so the exposed state and what is on screen cannot disagree. */

.primary-navigation__item.has-submenu {
    position: relative;
}

.primary-navigation__submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    padding: 0;
    background: transparent;
    color: inherit;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.primary-navigation__chevron {
    width: 16px;
    height: 16px;
    transition: transform var(--duration-base) var(--easing);
}

.primary-navigation__submenu-toggle[aria-expanded="true"] .primary-navigation__chevron {
    transform: rotate(180deg);
}

.primary-navigation__submenu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-navigation__membership {
    width: 100%;
}

/* --- Language switcher ---------------------------------------------------- */

.language-switcher {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.language-switcher__label {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.language-switcher__options {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    background: var(--surface-50);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

.language-switcher__button {
    min-width: 2.75rem;
    /* 44px everywhere, not just in the drawer: the switcher is one of the
     * controls the accessibility brief names explicitly. */
    min-height: var(--touch-target);
    padding-inline: var(--space-2);
    background: transparent;
    color: var(--text-secondary);
    border: 0;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.language-switcher__button:hover {
    background: var(--surface-100);
    color: var(--accent-primary);
}

.language-switcher__button[aria-current="true"] {
    background: var(--accent-primary);
    color: #fff;
}

/* --- Mobile and tablet panel (below 1280px) ------------------------------- */
/* 1280px is where eleven navigation items, the brand block and the language
 * switcher stop fitting on one readable row; below it the bar would wrap into
 * the cramped two-row header the FIX brief calls out. */

/* 1279.98 rather than 1279: a viewport width can be fractional (browser
 * zoom, a non-integer device pixel ratio), and `max-width: 1279px` paired
 * with `min-width: 1280px` leaves anything in between matching neither.
 * In that gap the drawer CSS is off and the desktop CSS is off, and the
 * navigation panel renders full-height over the page. The 1280 contract
 * is unchanged; this only closes the crack between the two queries. */
@media (max-width: 1279.98px) {
    /* Positioned against the sticky header, so the panel drops underneath the
     * main row without changing its height. */
    .primary-navigation {
        position: absolute;
        top: 100%;
        inset-inline: 0;
        z-index: 60;
        max-height: min(82vh, 44rem);
        padding: var(--space-4) var(--page-padding) var(--space-5);
        overflow-y: auto;
        background: var(--surface-0);
        border-bottom: 1px solid var(--border-default);
        box-shadow: var(--shadow-md);
        /* `visibility` keeps the closed panel out of the tab order while still
         * allowing the open/close transition to run. */
        visibility: hidden;
        opacity: 0;
        transform: translateY(-0.5rem);
        transition:
            opacity var(--duration-base) var(--easing),
            transform var(--duration-base) var(--easing),
            visibility var(--duration-base);
    }

    .primary-navigation.is-open {
        visibility: visible;
        opacity: 1;
        transform: none;
    }

    .primary-navigation__list {
        border-bottom: 1px solid var(--border-default);
        padding-bottom: var(--space-3);
    }

    /* A full-width underline reads as a divider in a vertical list, so the
     * active row is marked with a leading accent bar instead. */
    .primary-navigation__list a[aria-current="page"] {
        background: var(--surface-50);
        box-shadow: inset 3px 0 0 var(--accent-primary);
    }

    /* The drawer's submenu is an accordion: the row holds the link and its
     * toggle side by side, and the panel pushes the list down rather than
     * floating over it. Nothing here depends on hover. */
    .primary-navigation__item.has-submenu {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .primary-navigation__submenu {
        grid-column: 1 / -1;
        display: none;
        margin-left: var(--space-4);
        padding-left: var(--space-3);
        border-left: 2px solid var(--border-default);
    }

    .primary-navigation__item.has-submenu.is-open .primary-navigation__submenu {
        display: block;
    }

    .primary-navigation__submenu a {
        font-weight: 500;
        font-size: var(--text-sm);
    }

    /* First thing in the open drawer, so the primary action never needs a
     * scroll to reach. */
    .primary-navigation__membership {
        margin-bottom: var(--space-4);
    }

    /* The desktop bar carries its own copy; two would be redundant.
     * Scoped through the header so this outranks `.btn`, which sets
     * display:inline-flex later in the file at the same specificity. */
    .site-header .site-header__membership {
        display: none;
    }

    .language-switcher {
        margin-top: var(--space-4);
    }

    .language-switcher__button {
        min-width: var(--touch-target);
        min-height: var(--touch-target);
        padding-inline: var(--space-3);
        font-size: var(--text-sm);
    }
}

/* Narrow phones: keep the logo compact without touching its aspect ratio.
 * The full name stays under the short one (federation request, October
 * 2026), set smaller so it never crowds the menu button. */
@media (max-width: 599px) {
    .site-header__logo {
        width: 40px;
        height: 40px;
    }

    .site-header__brand-description {
        font-size: 0.5625rem;
        letter-spacing: 0.04em;
        max-width: 20ch;
    }
}

/* --- Desktop bar (1280px and up) ------------------------------------------ */

@media (min-width: 1280px) {
    .nav-toggle {
        display: none;
    }

    .site-header__logo {
        width: 54px;
        height: 54px;
    }

    /* The desktop bar is the tightest row on the site -- Armenian labels leave
     * it around a hundred pixels less slack than English. These trims are
     * scoped to the header, so the page gutter and the section rhythm below
     * keep the full `--page-padding`. */
    .site-header__inner {
        gap: clamp(0.75rem, 1vw, 1rem);
        padding-inline: clamp(1.5rem, 1.9vw, 1.75rem);
    }

    /* The bar is sized to hold one row in every language: eight top-level
     * items, two of them disclosures. Wrapping stays enabled as a last-resort
     * guard -- a header that grows a row is survivable, one that puts a
     * horizontal scrollbar on the page is not. */
    .primary-navigation {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: clamp(0.5rem, 0.7vw, 0.75rem);
        min-width: 0;
    }

    .primary-navigation__list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: clamp(0.05rem, 0.2vw, 0.3rem);
        min-width: 0;
    }

    /* 14px flat, and 14px is also the floor: below it the bar stops being
     * comfortably readable, and the row must be won by grouping items rather
     * than by shrinking type. It does not grow with the viewport either --
     * the bar stops widening at `--container-wide`, so past that point every
     * fluid pixel is spent from a budget that is no longer growing, and the
     * membership CTA was the part that fell off the row. */
    .primary-navigation__list a {
        min-height: 2.5rem;
        padding-inline: clamp(0.3rem, 0.45vw, 0.5rem);
        font-size: 0.875rem;
        white-space: nowrap;
    }

    .primary-navigation__list a[aria-current="page"] {
        box-shadow: inset 0 -2px 0 var(--accent-primary);
    }

    /* The drawer-only membership CTA; the bar has its own above the nav.
     * Scoped through the nav so this outranks `.btn`, which sets
     * display:inline-flex later in the file at the same specificity. */
    .primary-navigation .primary-navigation__membership {
        display: none;
    }

    /* Sits after the navigation, immediately before the language switcher,
     * so it is the last and most prominent thing in the bar. Keeps the full
     * 44px target despite the compact type -- it is a required CTA. Scoped
     * through .site-header to outrank `.btn--compact`, which sets a 40px
     * min-height later in the file at the same specificity. */
    .site-header .site-header__membership {
        order: 3;
        flex: 0 0 auto;
        min-height: var(--touch-target);
        padding-inline: var(--space-3);
        white-space: nowrap;
    }

    /* --- Navigation submenus: floating panel ------------------------------ */

    .primary-navigation__item.has-submenu {
        display: flex;
        align-items: center;
    }

    /* Full 44x44 even on the desktop bar: touch-capable laptops exist, and
     * this is the only control that opens a nav submenu. The negative
     * margin pulls the visual gap back in so the extra hit area does not
     * push the neighbouring items apart. */
    .primary-navigation__submenu-toggle {
        min-width: var(--touch-target);
        min-height: var(--touch-target);
        margin-inline: -0.6rem;
    }

    .primary-navigation__submenu {
        position: absolute;
        top: calc(100% + var(--space-2));
        left: 0;
        z-index: 70;
        min-width: 15rem;
        padding: var(--space-2);
        background: var(--surface-0);
        border: 1px solid var(--border-default);
        border-top: 3px solid var(--accent-primary);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
        /* `visibility` keeps the closed panel out of the tab order while the
         * transition still runs. */
        visibility: hidden;
        opacity: 0;
        transform: translateY(-0.35rem);
        transition:
            opacity var(--duration-base) var(--easing),
            transform var(--duration-base) var(--easing),
            visibility var(--duration-base);
    }

    /* Hover is an enhancement layered on top of the button state, never the
     * only way in: `.is-open` comes from the keyboard-driven toggle. */
    .primary-navigation__item.has-submenu.is-open .primary-navigation__submenu,
    .primary-navigation__item.has-submenu:hover .primary-navigation__submenu,
    .primary-navigation__item.has-submenu:focus-within .primary-navigation__submenu {
        visibility: visible;
        opacity: 1;
        transform: none;
    }

    .primary-navigation__submenu a {
        min-height: var(--touch-target);
        padding-inline: var(--space-3);
        font-size: var(--text-sm);
        white-space: normal;
    }

    .primary-navigation__submenu a[aria-current="page"] {
        box-shadow: inset 3px 0 0 var(--accent-primary);
    }

    /* The row is tight here, so the full name narrows rather than going: it
     * stays under the short name in every width (October 2026). */
    .site-header__brand-description {
        max-width: 16ch;
        font-size: 0.5625rem;
        letter-spacing: 0.04em;
    }

    .language-switcher__label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

@media (min-width: 1440px) {
    .site-header__brand-description {
        max-width: 24ch;
        font-size: 0.6875rem;
        letter-spacing: 0.08em;
    }
}

/* --- Home header variant --------------------------------------------------- */
/* Only the home page runs a dark header, so it reads as one surface with the
 * hero below it. Every inner page keeps the light bar untouched, which is why
 * this is scoped to `.page-home` rather than applied to `.site-header`. */

.page-home .site-header {
    background: rgba(6, 20, 40, 0.92);
    color: var(--text-inverse);
    border-bottom-color: var(--white-12);
    box-shadow: none;
    backdrop-filter: blur(10px);
}

@supports not (backdrop-filter: blur(10px)) {
    .page-home .site-header {
        background: var(--navy-900);
    }
}

.page-home .site-header__brand-name {
    color: #fff;
}

.page-home .site-header__brand-description {
    color: var(--white-70);
}

.page-home .primary-navigation__list > li > a,
.page-home .primary-navigation__submenu-toggle {
    color: var(--white-70);
}

.page-home .primary-navigation__list > li > a:hover {
    color: var(--gold-400);
    background: var(--white-06);
}

.page-home .primary-navigation__list > li > a[aria-current="page"] {
    color: #fff;
    box-shadow: inset 0 -3px 0 var(--accent-primary);
}

.page-home .nav-toggle {
    color: #fff;
    border-color: var(--white-12);
}

.page-home .language-switcher__label {
    color: var(--white-50);
}

.page-home .language-switcher__options {
    background: var(--white-06);
    border-color: var(--white-12);
}

.page-home .language-switcher__button {
    color: var(--white-70);
}

.page-home .language-switcher__button:hover {
    background: var(--white-12);
    color: var(--gold-400);
}

.page-home .language-switcher__button[aria-current="true"] {
    background: var(--accent-primary);
    color: #fff;
}

/*
 * Focus rings need the light-on-dark colour here, the same swap the dark
 * sections make in section 1. Scoped to the header rather than to the home
 * page: the bar is dark on every page, and the default blue ring measures
 * only 1.53:1 against it.
 */
.site-header :focus-visible {
    outline-color: var(--gold-400);
}

/* Below 1280px the drawer is a panel in its own right, so it gets a solid
 * dark surface rather than the translucent bar treatment. */
/* 1279.98 rather than 1279: a viewport width can be fractional (browser
 * zoom, a non-integer device pixel ratio), and `max-width: 1279px` paired
 * with `min-width: 1280px` leaves anything in between matching neither.
 * In that gap the drawer CSS is off and the desktop CSS is off, and the
 * navigation panel renders full-height over the page. The 1280 contract
 * is unchanged; this only closes the crack between the two queries. */
@media (max-width: 1279.98px) {
    .page-home .primary-navigation {
        background: var(--navy-900);
        border-bottom-color: var(--white-12);
    }

    .page-home .primary-navigation__list {
        border-bottom-color: var(--white-12);
    }

    .page-home .primary-navigation__list a[aria-current="page"] {
        background: var(--white-06);
        box-shadow: inset 3px 0 0 var(--accent-primary);
    }

    .page-home .primary-navigation__submenu {
        border-left-color: var(--white-12);
    }

    .page-home .primary-navigation__submenu a {
        color: var(--white-70);
    }
}

/* The desktop submenu panel stays a light card even on the dark bar: it sits
 * over page content, not over the header. */
@media (min-width: 1280px) {
    .page-home .primary-navigation__submenu a {
        color: var(--text-secondary);
    }
}

/* Body scroll lock while a dialog is open. The navigation panel does not lock
 * scrolling: it is a plain drop-down, not a modal surface. */
body[data-scroll-locked="true"] {
    overflow: hidden;
}

/* =========================================================================
   4. Breadcrumbs
   ========================================================================= */

.breadcrumbs {
    background: var(--navy-900);
    color: var(--text-inverse-muted);
    font-size: var(--text-sm);
}

.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-3) 0;
    list-style: none;
}

.breadcrumbs__list li + li::before {
    content: "/";
    margin-right: var(--space-2);
    color: var(--white-50);
}

.breadcrumbs__list [aria-current="page"] {
    color: var(--gold-400);
}

/* =========================================================================
   5. Buttons and links
   ========================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--touch-target);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--duration-fast) var(--easing),
        color var(--duration-fast) var(--easing);
}

.btn--primary {
    background: var(--accent-primary);
    color: #fff;
}

.btn--primary:hover {
    background: var(--accent-primary-hover);
}

.btn--secondary {
    background: var(--accent-secondary);
    color: #fff;
}

.btn--secondary:hover {
    background: var(--navy-600);
}

.btn--ghost {
    background: transparent;
    color: inherit;
    border-color: var(--border-default);
}

.btn--ghost:hover {
    border-color: var(--accent-highlight);
    color: var(--accent-highlight);
}

.btn--small {
    min-height: 40px;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn--large {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
}

/* --- Membership button ---------------------------------------------------- */
/* Membership is the site's primary conversion action, so it gets one shared
 * treatment used at every CTA location: red fill, gold edge, restrained glow.
 * Deliberately the ONLY glowing button in the system -- the effect is what
 * makes it read as primary, and it stops working the moment it is reused. */

.btn--membership {
    background: linear-gradient(180deg, var(--red-600), var(--red-700));
    color: #fff;
    border-color: var(--gold-500);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 0 0 1px rgba(242, 169, 0, 0.22),
        0 10px 26px rgba(214, 16, 50, 0.3);
    transition:
        background-color var(--duration-fast) var(--easing),
        box-shadow var(--duration-base) var(--easing),
        transform var(--duration-fast) var(--easing);
}

.btn--membership:hover {
    background: linear-gradient(180deg, #e6153b, var(--red-600));
    border-color: var(--gold-400);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 0 0 1px rgba(255, 194, 71, 0.45),
        0 16px 34px rgba(214, 16, 50, 0.42);
    transform: translateY(-1px);
}

/*
 * Two-tone focus ring, because this one button is not always the same colour.
 *
 * The membership CTA is red in the header, hero and clubs band but gold on
 * the membership spotlight, where a gold outline measured 1.25:1 against the
 * button it was supposed to be outlining. A white ring with a dark halo
 * clears 3:1 against red, gold, navy and crimson alike, so the indicator no
 * longer depends on which surface the CTA happens to be sitting on.
 */
.btn--membership:focus-visible {
    outline: var(--focus-width) solid #fff;
    outline-offset: var(--focus-offset);
    box-shadow: 0 0 0 calc(var(--focus-width) + var(--focus-offset) + 2px)
        rgba(3, 11, 24, 0.92);
}

/* Header/secondary placements: same identity, much less glow, so the hero and
 * spotlight buttons stay the loudest ones on the page. */
.btn--compact {
    min-height: 40px;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn--membership.btn--compact {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0 0 1px rgba(242, 169, 0, 0.28);
}

.btn--membership.btn--compact:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 1px rgba(255, 194, 71, 0.5),
        0 8px 18px rgba(214, 16, 50, 0.3);
}

/* --- Ghost variants for dark surfaces ------------------------------------- */
/* `.btn--ghost` reads its border from --border-default, which dark sections
 * already override. These two are for surfaces where the contrast has to be
 * stated outright: over hero photography, and on the credibility panel. */

.btn--hero-ghost {
    background: rgba(6, 20, 40, 0.42);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
}

/* No backdrop-filter: the translucent fill alone would let the photograph
 * show through the label, so the fill goes solid instead. */
@supports not (backdrop-filter: blur(6px)) {
    .btn--hero-ghost {
        background: rgba(6, 20, 40, 0.82);
    }
}

.btn--hero-ghost:hover {
    background: rgba(6, 20, 40, 0.68);
    border-color: var(--gold-400);
    color: var(--gold-400);
}

.btn--ghost-inverse {
    background: transparent;
    color: var(--text-inverse);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn--ghost-inverse:hover {
    border-color: var(--gold-400);
    color: var(--gold-400);
}

/* Unavailable controls render as inert spans, never as links or buttons that
 * pretend to work. The dashed border marks the state without relying on
 * colour alone. */
.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border-default);
    border-style: dashed;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    color: var(--accent-secondary);
}

.section--inverse .link-arrow,
.home-hero .link-arrow,
.modal__panel .link-arrow {
    color: var(--gold-400);
}

.link-arrow::after {
    content: "\2192";
}

/* =========================================================================
   6. Pills, tags and flags
   ========================================================================= */

.status-pill,
.medal-pill,
.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.25rem 0.6rem;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    border: 1px solid currentColor;
}

.status-pill--upcoming { color: var(--gold-700); }
.status-pill--live { color: #c2103a; }
.status-pill--completed { color: var(--ink-500); }
.status-pill--postponed { color: #96591a; }
.status-pill--cancelled { color: #b3261e; }
.status-pill--featured { color: var(--accent-secondary); }
.status-pill--pending { color: var(--text-muted); }
/* An event the federation has not confirmed at all: deliberately the
 * quietest pill on the page, never the gold of a confirmed fixture. */
.status-pill--unconfirmed { color: var(--text-muted); }
.status-pill--superseded { color: var(--text-muted); }

.section--inverse .status-pill--upcoming,
.home-hero .status-pill--upcoming { color: var(--gold-400); }

.medal-pill--gold { color: #8a6508; }
.medal-pill--silver { color: #5b6472; }
.medal-pill--bronze { color: #8a4a22; }

.tag {
    color: var(--accent-secondary);
}

.section--inverse .tag,
.home-hero .tag {
    color: var(--gold-400);
}

/* Development-data flags stay visually distinct from real content. */
.data-flag {
    margin: var(--space-2) 0;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #96591a;
}

.section--inverse .data-flag,
.home-hero .data-flag,
.modal__panel .data-flag {
    color: var(--gold-400);
}

/* =========================================================================
   7. Notes, empty states, missing media
   ========================================================================= */

.pending-note {
    display: flex;
    gap: var(--space-4);
    margin-block: var(--space-5);
    padding: var(--space-4) var(--space-5);
    background: rgba(242, 169, 0, 0.10);
    border: 1px solid rgba(242, 169, 0, 0.45);
    border-left-width: 4px;
    border-radius: var(--radius-md);
}

.pending-note__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    font-weight: 800;
    color: var(--navy-950);
    background: var(--gold-500);
    border-radius: 50%;
}

.pending-note__heading {
    margin: 0 0 var(--space-1);
    font-weight: 700;
}

.pending-note__text {
    margin: 0;
    color: var(--text-secondary);
}

.empty-state {
    grid-column: 1 / -1;
    padding: var(--space-6);
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-md);
}

.section--inverse .empty-state {
    background: var(--white-06);
}

/*
 * `.empty-state` is the "your filters matched nothing" notice and lives inside
 * a results grid, which is why it spans every column. This is the other empty
 * state: the whole section has nothing in it, because nothing is published
 * yet. It stands alone rather than inside a grid, stays narrow enough to read
 * as a deliberate card instead of a failed page, and carries one way onward.
 */
.empty-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-5);
    max-width: 34rem;
    margin-inline: auto;
    padding: var(--space-7) var(--space-6);
    text-align: center;
    background: var(--bg-subtle);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
}

.empty-panel__text {
    margin: 0;
    font-size: var(--text-lg);
    color: var(--text-secondary);
}

.media-missing {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4);
    text-align: center;
    background:
        repeating-linear-gradient(
            135deg,
            var(--navy-800) 0 10px,
            var(--navy-850) 10px 20px
        );
    color: var(--white-70);
    border-radius: var(--radius-md);
}

/* When used standalone (not inside a ratio box) it supplies its own ratio. */
.media-missing.ratio-4x3,
.media-missing.ratio-16x9,
.media-missing.ratio-3x4 {
    position: relative;
    inset: auto;
}

.media-missing__mark {
    font-size: var(--text-lg);
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--white-50);
}

.media-missing__text {
    font-size: var(--text-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.privacy-note {
    margin-top: var(--space-6);
    padding: var(--space-5);
    background: var(--bg-subtle);
    border-left: 4px solid var(--accent-secondary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.section--inverse .privacy-note {
    background: var(--white-06);
}

.privacy-note__title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
}

/* =========================================================================
   8. Fact grids and tables
   ========================================================================= */

.fact-grid {
    display: grid;
    gap: var(--space-3);
    margin: 0 0 var(--space-5);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.fact-grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.fact-grid--4 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.fact-grid__item {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
}

.section--inverse .fact-grid__item,
.home-hero .fact-grid__item,
.modal__panel .fact-grid__item {
    background: var(--white-06);
}

.fact-grid dt {
    /* Armenian compounds are single long words -- «Անդամ կազմակերպություններ»
     * is 195px in a 182px column -- and with nothing to break on the label
     * spilled past its cell into the grid gap. */
    overflow-wrap: break-word;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fact-grid dd {
    margin: var(--space-1) 0 0;
    font-weight: 600;
}

.results-table {
    min-width: 44rem;
    font-size: var(--text-sm);
}

.results-table th,
.results-table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-default);
    vertical-align: top;
}

.results-table thead th {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom-width: 2px;
}

.results-table tbody tr:hover {
    background: var(--bg-subtle);
}

/* =========================================================================
   9. Filters and forms
   ========================================================================= */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding: var(--space-5);
    background: var(--bg-subtle);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
}

.filter-bar--stacked {
    flex-direction: column;
    align-items: stretch;
}

.filter-bar__row {
    display: grid;
    gap: var(--space-4);
    /*
     * 15rem, not 12rem. Armenian and Russian option labels run roughly half
     * again as long as the English ones -- "All age categories" becomes
     * "Բոլոր տարիքային կարգերը" -- and at 12rem the select clipped its own
     * selected option on those locales while the row still had space to give.
     */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    width: 100%;
}

.filter-bar__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
    flex: 1 1 12rem;
}

.filter-bar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.filter-group {
    margin: 0;
    padding: 0;
    border: 0;
}

.filter-group legend {
    padding: 0;
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: var(--touch-target);
    padding: var(--space-2) var(--space-4);
    background: var(--surface-0);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
}

.chip input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

/* Selected chips change background AND gain a heavier border, so selection is
 * not conveyed by colour alone. */
.chip:has(input:checked) {
    background: var(--accent-primary);
    border-color: var(--navy-950);
    border-width: 2px;
    color: #fff;
}

.chip:has(input:focus-visible) {
    outline: var(--focus-width) solid var(--focus-ring);
    outline-offset: var(--focus-offset);
}

label,
.field__label-static {
    font-size: var(--text-sm);
    font-weight: 600;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    min-height: var(--touch-target);
    padding: var(--space-2) var(--space-3);
    background: var(--surface-0);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--surface-100);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
}

.field--wide {
    grid-column: 1 / -1;
}

.field__required {
    color: var(--accent-primary);
}

.field__help {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Errors carry a warning glyph plus colour, never colour alone. */
.field__error {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: #b3261e;
}

.field__error::before {
    content: "\26A0  ";
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-weight: 400;
}

.checkbox input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
    flex: 0 0 auto;
}

.error-summary {
    margin-bottom: var(--space-6);
    padding: var(--space-4) var(--space-5);
    background: rgba(179, 38, 30, 0.06);
    border: 1px solid rgba(179, 38, 30, 0.35);
    border-left-width: 4px;
    border-radius: var(--radius-md);
}

.error-summary__title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-base);
}

.error-summary__intro {
    margin: 0 0 var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.error-summary__list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: var(--text-sm);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-default);
}

.form-actions__note {
    flex: 1 1 18rem;
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* =========================================================================
   10. Cards
   ========================================================================= */

.event-card,
.club-card,
.athlete-card,
.news-card,
.medalist-card,
.office-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.section--inverse .event-card,
.section--inverse .club-card,
.section--inverse .athlete-card,
.section--inverse .news-card,
.section--inverse .medalist-card {
    box-shadow: none;
}

.event-card__body,
.club-card__body,
.athlete-card__body,
.news-card__body,
.medalist-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    flex: 1;
}

/* Cards in a row stretch to the tallest one, so a card with shorter copy used
 * to leave its call to action floating in the middle while its neighbour's sat
 * at the foot. Pushing the trailing block down puts every action on one line
 * across the row, whatever the text above it does. */
.event-card__actions,
.news-card__body > .btn:last-child,
.medalist-card__body > .link-arrow:last-child,
.club-card__actions {
    margin-top: auto;
}

/* A button is a flex item here; without this it would stretch to the full
 * card width instead of keeping its own size. */
.news-card__body > .btn:last-child {
    align-self: flex-start;
}

.event-card--featured {
    border-color: var(--accent-highlight);
    border-width: 2px;
}

.event-card__date {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5) 0;
}

.event-card__day {
    font-size: var(--text-3xl);
    font-weight: 800;
    line-height: 1;
    color: #a06f00;
}

.section--inverse .event-card__day {
    color: var(--gold-400);
}

.event-card__month {
    font-size: var(--text-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.event-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.event-card__type {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.event-card__title,
.club-card__title,
.athlete-card__name,
.news-card__title,
.medalist-card__name {
    margin: 0;
    font-size: var(--text-xl);
}

.event-card__title a,
.club-card__title a,
.athlete-card__name a,
.news-card__title a {
    text-decoration: none;
}

.event-card__title a:hover,
.club-card__title a:hover,
.athlete-card__name a:hover,
.news-card__title a:hover {
    text-decoration: underline;
}

.event-card__summary,
.news-card__summary {
    margin: 0;
    color: var(--text-secondary);
}

.event-card__facts,
.club-card__facts {
    display: grid;
    gap: var(--space-2);
    margin: 0;
}

.event-card__facts dt,
.club-card__facts dt {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.event-card__facts dd,
.club-card__facts dd {
    margin: 0;
}

.event-card__actions,
.club-card__actions,
.athlete-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: auto;
    padding-top: var(--space-2);
}

/*
 * The note sits inside the actions block, which is pushed to the bottom of the
 * card. That aligned the block's bottom edge but not the button above it: a
 * two-line note lifted its Details button 23px higher than a one-line note
 * did, so a row of cards had four different button positions.
 *
 * Reserving two lines makes the block a fixed height, which puts every button
 * on one baseline. The reserve is on the note rather than the block so a card
 * with a Register button instead of a note is unaffected.
 *
 * `flex-basis: 100%` is the other half of that, and without it the reserve did
 * nothing for half the cards. The block wraps, so a short note -- "Invitation
 * only", "Event cancelled" -- fitted on the same line as the Details button
 * while a long one dropped below it. Measured across a row that put the
 * buttons at two different heights, 25px and 83px from the card's foot. Now
 * the note always takes its own line and the offset is the same everywhere.
 */
.event-card__registration-note {
    flex-basis: 100%;
    margin: 0;
    min-height: calc(var(--text-sm) * var(--leading-normal) * 2);
    font-size: var(--text-sm);
    font-style: italic;
    line-height: var(--leading-normal);
    color: var(--text-muted);
}

.club-card__media,
.athlete-card__media,
.news-card__media,
.medalist-card__media {
    border-radius: 0;
}

.club-card__category {
    position: absolute;
    left: var(--space-3);
    bottom: var(--space-3);
    padding: 0.2rem 0.55rem;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(3, 11, 24, 0.78);
    color: #fff;
    border-radius: var(--radius-sm);
}

/* A club's logo stands in for its photograph, whole rather than cropped:
 * contained on white with a margin, so a round emblem keeps its edges. */
.ratio-4x3 > img.club-logo-cover,
.ratio-16x9 > img.club-logo-cover {
    object-fit: contain;
    padding: 6%;
    background: #fff;
}

/* A medal beside the athlete's name rather than a label over the photograph.
 * The word "Medalist" is its accessible name and tooltip. */
.medal-badge {
    display: inline-flex;
    margin-left: var(--space-1);
    vertical-align: -0.2em;
}

.medal-badge svg {
    display: block;
}

.athlete-card__categories {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.news-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.leader-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-card-inverse);
    color: var(--text-inverse);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border-left: 4px solid var(--border-inverse);
}

.leader-card--red { border-left-color: var(--red-600); }
.leader-card--blue { border-left-color: var(--blue-600); }
.leader-card--gold { border-left-color: var(--gold-500); }

.leader-card__media {
    border-radius: 0;
}

.leader-card__body {
    padding: var(--space-5);
}

.leader-card__role {
    margin: 0 0 var(--space-1);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-400);
}

.leader-card__name {
    margin: 0;
    font-size: var(--text-xl);
}

.leader-card__since {
    margin: var(--space-2) 0 0;
    font-size: var(--text-sm);
    color: var(--white-70);
}

.office-card {
    padding: var(--space-5);
    gap: var(--space-2);
}

.office-card__title {
    margin: 0;
    font-size: var(--text-lg);
}

.office-card__address {
    margin: 0;
    color: var(--text-secondary);
}

.office-card__district {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* =========================================================================
   11. Carousel
   ========================================================================= */

.carousel {
    position: relative;
}

/*
 * The native scrollbar is hidden, the scrolling is not.
 *
 * A styled OS scrollbar rendered directly above the carousel's own arrow
 * buttons, so the strip carried two competing affordances for one action.
 * Only the bar is suppressed: the element keeps `overflow-x: auto`, keeps its
 * `tabindex="0"` and `role="group"` in the markup, and therefore keeps arrow
 * keys, Home/End, touch swipe, trackpad and screen-reader scrolling. The
 * arrow buttons remain the visible affordance, and the track still takes a
 * focus ring when tabbed to.
 */
.carousel__viewport {
    display: flex;
    gap: var(--space-5);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: var(--space-4);
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel__viewport::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.carousel__slide {
    flex: 0 0 min(100%, 22rem);
    scroll-snap-align: start;
    display: flex;
}

.carousel__slide > * {
    width: 100%;
}

.carousel__slide--club {
    flex-basis: min(100%, 20rem);
}

.carousel__controls {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.carousel__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-target);
    height: var(--touch-target);
    background: transparent;
    color: inherit;
    border: 1px solid var(--border-default);
    border-radius: 50%;
    cursor: pointer;
}

.carousel__button:hover {
    border-color: var(--accent-highlight);
    color: var(--accent-highlight-text);
}

.carousel__button[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =========================================================================
   12. Ticker
   ========================================================================= */

.ticker {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--page-padding);
    background: var(--navy-800);
    color: var(--white-70);
    border-block: 1px solid var(--border-inverse);
    overflow: hidden;
}

/*
 * Edge fade, so the strip runs out softly instead of against a hard edge.
 *
 * Without it the strip is cut dead at both ends and the eye reads the fragment
 * as a typo rather than as motion -- "...MEMBER ORGANIZATIONS" arrived as
 * "1BER ORGANIZATIONS". The right-hand fade is the deeper of the two because
 * that end runs up against the Pause control.
 */
.ticker__viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 6%,
        #000 88%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0,
        #000 6%,
        #000 88%,
        transparent 100%
    );
}

.ticker__track {
    display: flex;
    gap: var(--space-6);
    width: max-content;
    animation: ticker-scroll 36s linear infinite;
}

.ticker__track > span {
    display: flex;
    gap: var(--space-6);
}

/*
 * The strip carried a Pause button that set `data-paused` on the container.
 * The button is gone, so stopping it is CSS alone -- and it has to be, because
 * this is now the only way to stop it at all.
 */
.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track {
    animation-play-state: paused;
}

.ticker__item {
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.22em;
    white-space: nowrap;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* =========================================================================
   13. Modal (athlete quick view) and lightbox
   ========================================================================= */

.modal,
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal[hidden],
.lightbox[hidden] {
    display: none;
}

.modal__backdrop,
.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 11, 24, 0.82);
    border: 0;
    cursor: pointer;
}

.modal__panel,
.lightbox__panel {
    --text-primary: var(--text-inverse);
    --text-secondary: var(--text-inverse-muted);
    --text-muted: var(--white-50);
    --focus-ring: var(--gold-400);
    --border-default: var(--border-inverse);
}

.modal__panel {
    position: relative;
    width: min(100%, 40rem);
    max-height: 85vh;
    overflow-y: auto;
    padding: var(--space-6);
    background: var(--navy-900);
    color: var(--text-inverse);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal__close,
.lightbox__close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    width: var(--touch-target);
    height: var(--touch-target);
    font-size: 1.5rem;
    line-height: 1;
    background: var(--white-06);
    color: inherit;
    border: 1px solid var(--border-inverse);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.modal__title {
    margin-right: 3rem;
    font-size: var(--text-2xl);
}

.modal__footer-link {
    margin: var(--space-5) 0 0;
}

.lightbox__panel {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: min(100%, 68rem);
}

.lightbox__close {
    top: calc(-1 * var(--space-6));
}

.lightbox__figure {
    flex: 1;
    min-width: 0;
    margin: 0;
    text-align: center;
    color: var(--text-inverse);
}

.lightbox__figure img {
    max-height: 70vh;
    margin-inline: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.lightbox__figure figcaption {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-top: var(--space-3);
    font-size: var(--text-sm);
}

.lightbox__credit {
    color: var(--white-50);
    font-size: var(--text-xs);
}

.lightbox__nav {
    flex: 0 0 auto;
    width: var(--touch-target);
    height: var(--touch-target);
    background: var(--white-06);
    color: var(--white-95);
    border: 1px solid var(--border-inverse);
    border-radius: 50%;
    cursor: pointer;
}

.lightbox__nav:hover {
    background: var(--white-12);
}

@media (max-width: 47.9375em) {
    .lightbox__panel {
        flex-wrap: wrap;
        justify-content: center;
    }

    .lightbox__figure {
        order: -1;
        flex-basis: 100%;
    }

    .lightbox__close {
        top: calc(-1 * var(--space-7));
    }
}

/* =========================================================================
   14. Map shell (no map provider is loaded)
   ========================================================================= */

.map-shell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    width: 100%;
    background: var(--navy-850);
    border: 1px solid var(--border-inverse);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.map-shell__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--white-06) 1px, transparent 1px),
        linear-gradient(90deg, var(--white-06) 1px, transparent 1px);
    background-size: 28px 28px;
}

.map-shell__pin {
    position: absolute;
    top: 42%;
    left: 50%;
    width: 14px;
    height: 14px;
    background: var(--accent-primary);
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.map-shell__label {
    position: relative;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white-70);
    background: rgba(3, 11, 24, 0.7);
    border-radius: var(--radius-sm);
    text-align: center;
}

/* =========================================================================
   15. Pagination
   ========================================================================= */

.pagination {
    margin-top: var(--space-6);
}

.pagination__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination__list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    padding-inline: var(--space-3);
    text-decoration: none;
    font-weight: 700;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

.pagination__list a[aria-current="page"] {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* =========================================================================
   16. Site footer
   ========================================================================= */

.site-footer {
    background: var(--navy-950);
    color: var(--text-inverse);
    border-top: 1px solid var(--border-inverse);
}

.site-footer__inner {
    display: grid;
    gap: var(--space-6);
    width: 100%;
    max-width: var(--container-content);
    margin-inline: auto;
    padding: var(--space-7) var(--page-padding);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.site-footer__brand {
    display: flex;
    gap: var(--space-4);
    grid-column: 1 / -1;
}

.site-footer__logo {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--gold-500);
}

.site-footer__name {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 800;
    letter-spacing: 0.16em;
}

.site-footer__tagline,
.site-footer__fact {
    margin: var(--space-1) 0 0;
    font-size: var(--text-sm);
    color: var(--text-inverse-muted);
}

.site-footer__heading {
    margin: 0 0 var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-400);
}

.site-footer__nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: var(--space-2);
}

.site-footer__nav a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    color: var(--text-inverse-muted);
    text-decoration: none;
}

.site-footer__nav a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer__legal {
    padding: var(--space-4) var(--page-padding);
    border-top: 1px solid var(--border-inverse);
    font-size: var(--text-sm);
    color: var(--white-50);
    text-align: center;
}

.site-footer__legal p {
    margin: 0;
}

/* Membership is the footer's most important link, so it is the one item here
 * that is not muted grey. It is also one of the six required membership CTAs,
 * so it takes the full 44px touch target rather than the footer's 36px.
 * Scoped through .site-footer__nav to outrank that rule's `a` selector. */
.site-footer__nav a.site-footer__membership {
    min-height: var(--touch-target);
    color: var(--gold-400);
    font-weight: 700;
}

.site-footer__nav a.site-footer__membership:hover {
    color: #fff;
}


/* Contact values come from the confirmed dev_content channels; a value still
 * awaiting confirmation is filtered out before it reaches the template, so
 * plain spans here are always real details. */
.site-footer__contact span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    color: var(--text-inverse-muted);
}

/* Scoped through the contact column so this outranks `.site-footer__nav ul`,
 * which sets display:grid and would otherwise stack the icons in a column. */
.site-footer__contact .site-footer__social {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-4) 0 0;
    padding: 0;
    list-style: none;
}

/*
 * Scoped through `.site-footer__nav` so it outranks `.site-footer__nav a`,
 * which is (0,1,1) against this rule's old (0,1,0) and was quietly winning.
 * That rule sets `display: inline-flex` with `align-items: center` and no
 * `justify-content`, so every glyph sat hard against the left edge of its
 * circle -- measured 12px off centre on all four, vertically fine, which is
 * exactly the "not quite centred" the eye picks up without being able to name
 * it. `place-items` never applied at all: it does nothing in a flex box.
 *
 * Stated as flex centring rather than by winning the `display` fight, so the
 * centring holds whichever of the two declarations applies.
 */
.site-footer__nav .site-footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-target);
    height: var(--touch-target);
    /* Overrides the 36px the footer's text links carry: these are round
     * controls and keep the full touch target. */
    min-height: var(--touch-target);
    padding: 0;
    color: var(--text-inverse-muted);
    background: var(--white-06);
    border: 1px solid var(--border-inverse);
    border-radius: 50%;
}

.site-footer__nav .site-footer__social-link:hover {
    color: var(--navy-950);
    background: var(--gold-400);
    border-color: var(--gold-400);
}

.site-footer__nav .site-footer__social-link .social-link__icon {
    width: 1.15rem;
    height: 1.15rem;
    fill: currentColor;
}

@media (min-width: 900px) {
    .site-footer__brand {
        grid-column: span 2;
    }
}

/* Five columns do not fit the auto-fit track at the content width, so the
 * layout is stated outright: brand across the top, then the four link
 * columns in one row. */
@media (min-width: 60em) {
    .site-footer__inner {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }
}

/* =========================================================================
   17. Reduced motion
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .ticker__track {
        animation: none;
        transform: none;
    }

    .carousel__viewport,
    html {
        scroll-behavior: auto;
    }
}
