/* Site stylesheet. Neutral placeholder palette: swap the tokens below for the
   brand colours and fonts once they are known; components use only tokens. */

/* Barlow Condensed (SIL Open Font License), self-hosted: no requests to Google.
   Headings and race numbers only; latin-ext covers Czech. */
@font-face {
    font-family: "Barlow Condensed";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/barlow-condensed-latin-ext-600.5d71c3ee5d22.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Barlow Condensed";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/barlow-condensed-latin-600.16cc9e59e14c.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Barlow Condensed";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/barlow-condensed-latin-ext-800.ab3ed9a6a3de.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Barlow Condensed";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/barlow-condensed-latin-800.7afb40486142.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens ---------------------------------------------------------------- */
:root {
    --color-bg: #ffffff;
    --color-surface: #f4f4f5;
    --color-text: #18181b;
    --color-text-muted: #52525b;
    --color-border: #e4e4e7;
    /* Primary and secondary are overridden per page from the Wagtail admin
       (templates/includes/theme_colors.html); keep these defaults in sync with
       apps/core/models.py. */
    --color-primary: #27272a;
    --color-primary-hover: color-mix(in srgb, var(--color-primary) 85%, white);
    --color-on-primary: #ffffff;
    --color-secondary: #71717a;
    --color-focus: #2563eb;
    /* Dark ground of the race hero when the event has no photo. */
    --color-ink: color-mix(in srgb, var(--color-primary) 35%, #0b0c0e);

    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-heading: "Barlow Condensed", "Arial Narrow", var(--font-body);

    --container-width: 75rem;
    --gutter: 1rem;
    --header-height: 4rem;
    --radius: 0.375rem;
    --shadow-dropdown: 0 0.5rem 1.5rem rgb(0 0 0 / 0.12);

    /* Gradient bands of the elevation profile and its map (apps/events/elevation.py),
       the same uphill and downhill: steeper is redder. */
    --grade-flat: #8bbf5a;
    --grade-1: #f2c230;
    --grade-2: #f08a24;
    --grade-3: #d9381e;
    --grade-4: #8c1c13;
}

@media (min-width: 48em) {
    :root {
        --gutter: 1.5rem;
    }
}

/* --- Base ------------------------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.5;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.5rem 1.125rem;
    border: 0;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.button--primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.button--primary:hover {
    background: var(--color-primary-hover);
}

/* The one action of a race page (register, results): the event's accent colour. */
.button--accent {
    background: var(--color-secondary);
    color: #ffffff;
}

.button--accent:hover {
    background: color-mix(in srgb, var(--color-secondary) 85%, black);
}

/* On the dark hero, next to an accent button. */
.button--light {
    background: rgb(255 255 255 / 0.12);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.5);
}

.button--light:hover {
    background: rgb(255 255 255 / 0.22);
}

.button--outline {
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: inset 0 0 0 1px var(--color-border);
}

.button--outline:hover {
    box-shadow: inset 0 0 0 1px var(--color-primary);
}

.button--large {
    min-height: 3rem;
    padding-inline: 1.5rem;
    font-size: 1.0625rem;
}

.button--block {
    width: 100%;
    min-height: 3rem;
}

/* --- Header and main navigation ----------------------------------------------
   Mobile first: logo + hamburger, menu as a panel under the header.
   From 64em: one row, Events opens as a dropdown. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.site-header__logo,
.site-header__event {
    display: flex;
    align-items: center;
    min-height: var(--header-height);
    font-family: var(--font-heading);
    font-weight: 800;
    text-decoration: none;
}

.site-header__logo {
    flex-shrink: 0;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Logos are rendered at 96 px for sharp high-DPI screens, shown at half. */
.site-header__logo img,
.site-header__event img {
    display: block;
    width: auto;
    height: 3rem;
}

.site-header__event img {
    height: 2.5rem;
}

/* The event this page belongs to: "SKÁJ TEAM | Otrokovická stovka" */
.site-header__event {
    min-width: 0;
    padding-left: 0.75rem;
    border-left: 1px solid var(--color-border);
    color: var(--color-primary);
    font-size: 1rem;
    line-height: 1.2;
}

.site-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.75rem 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.nav-link:hover,
.nav-sub__link:hover {
    color: var(--color-text-muted);
}

.nav-link[aria-current="page"] {
    text-decoration: underline;
    text-underline-offset: 0.4em;
    text-decoration-thickness: 2px;
}

.nav-sub-toggle__chevron {
    width: 0.5rem;
    height: 0.5rem;
    margin-top: -0.25rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.nav-sub-toggle[aria-expanded="true"] .nav-sub-toggle__chevron {
    margin-top: 0.25rem;
    transform: rotate(-135deg);
}

.nav-sub__link {
    display: block;
    padding: 0.5rem 0;
    text-decoration: none;
}

.nav-sub__all .nav-sub__link {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.site-nav__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switcher ul {
    display: flex;
    gap: 0.25rem;
}

.lang-switcher a,
.lang-switcher span {
    display: block;
    padding: 0.25rem 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.lang-switcher span[aria-current] {
    border-bottom: 2px solid currentColor;
}

/* Hamburger: three bars drawn from one element, turning into a cross when open. */
.nav-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: -0.5rem;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
    display: block;
    width: 1.5rem;
    height: 2px;
    margin-inline: auto;
    background: currentColor;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.nav-toggle__icon {
    position: relative;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
    content: "";
    position: absolute;
    left: 0;
}

.nav-toggle__icon::before {
    top: -0.45rem;
}

.nav-toggle__icon::after {
    top: 0.45rem;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before {
    transform: translateY(0.45rem) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after {
    transform: translateY(-0.45rem) rotate(-45deg);
}

/* Small screens */
@media (max-width: 63.999em) {
    .site-nav {
        flex-basis: 100%;
        padding-bottom: 1.25rem;
    }

    .nav-item + .nav-item {
        border-top: 1px solid var(--color-border);
    }

    .nav-link {
        padding-block: 0.875rem;
        font-size: 1.125rem;
    }

    .site-nav .nav-sub {
        padding: 0 0 0.75rem 1rem;
    }

    .site-nav__actions {
        flex-direction: column;
        align-items: stretch;
        padding-top: 1rem;
        border-top: 1px solid var(--color-border);
    }

    .lang-switcher ul {
        justify-content: center;
    }

    /* With JS: hamburger shows/hides the panel, Events works as an accordion. */
    .js .nav-toggle {
        display: block;
    }

    .js .site-nav {
        display: none;
        max-height: calc(100vh - var(--header-height));
        max-height: calc(100dvh - var(--header-height));
        overflow-y: auto;
    }

    .js .nav-toggle[aria-expanded="true"] ~ .site-nav {
        display: block;
    }

    .js .nav-sub {
        display: none;
    }

    .js .nav-sub-toggle[aria-expanded="true"] + .nav-sub {
        display: block;
    }
}

/* Large screens */
@media (min-width: 64em) {
    .site-header__inner {
        flex-wrap: nowrap;
        gap: 2rem;
    }

    .site-nav {
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: space-between;
        gap: 1.5rem;
    }

    .nav-list {
        display: flex;
        gap: 1.75rem;
    }

    .nav-link {
        width: auto;
        min-height: var(--header-height);
        padding-block: 0;
    }

    .nav-item--has-sub {
        position: relative;
    }

    .site-nav .nav-sub {
        position: absolute;
        top: 100%;
        left: -1rem;
        min-width: 15rem;
        padding: 0.5rem 1rem;
        background: var(--color-bg);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-dropdown);
        display: none;
    }

    .nav-sub__all {
        margin-top: 0.25rem;
        padding-top: 0.25rem;
        border-top: 1px solid var(--color-border);
    }

    /* Without JS the dropdown opens on hover/focus; with JS it opens on click only. */
    html:not(.js) .nav-item--has-sub:hover .nav-sub,
    html:not(.js) .nav-item--has-sub:focus-within .nav-sub,
    .js .nav-sub-toggle[aria-expanded="true"] + .nav-sub {
        display: block;
    }
}

/* --- Page header ------------------------------------------------------------- */
.page-header {
    position: relative;
    padding-block: 2.5rem 2rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 1.2rem + 2.5vw, 3rem);
    line-height: 1.15;
}

.page-header__lead {
    max-width: 45rem;
    margin: 0.75rem 0 0;
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

.page-header__lead p {
    margin: 0;
}

.page-header__meta {
    margin: 0.5rem 0 0;
    font-weight: 600;
}

.page-header__back {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
}

.page-header__back a {
    text-decoration: none;
}

/* With a hero image the text sits on a darkened photo. */
.page-header--image {
    display: flex;
    align-items: flex-end;
    min-height: clamp(16rem, 40vw, 28rem);
    color: #ffffff;
    background: var(--color-primary);
}

.page-header--image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgb(0 0 0 / 0.65), rgb(0 0 0 / 0.1));
}

.page-header__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-header--image .container {
    position: relative;
    z-index: 2;
}

.page-header--image .page-header__lead {
    color: inherit;
}

/* --- Sections and lists ------------------------------------------------------ */
.page-section {
    padding-block: 2rem;
    scroll-margin-top: calc(var(--header-height) + 3.5rem);
}

.page-section + .page-section {
    border-top: 1px solid var(--color-border);
}

/* Section headings: condensed capitals with a short accent bar above. */
.page-section h2 {
    margin: 0 0 1.25rem;
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
}

.page-section h2::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 4px;
    margin-bottom: 0.625rem;
    border-radius: 2px;
    background: var(--color-secondary);
}

/* Running text stays at a readable line length; tables and cards use the full width. */
.prose,
.block-paragraph,
.page-section > p {
    max-width: 45rem;
}

.link-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.link-list li + li {
    margin-top: 0.5rem;
}

.empty-state {
    padding-block: 2rem;
    color: var(--color-text-muted);
}

.block-image {
    margin: 1.5rem 0;
}

.block-image img {
    max-width: 100%;
    height: auto;
}

.block-image figcaption {
    margin-top: 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* --- Cards ------------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: 1.25rem;
    padding-block: 2rem;
}

.page-section .card-grid {
    padding-block: 0;
}

.card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.card__media {
    aspect-ratio: 16 / 9;
    background: var(--color-surface);
}

.card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.125rem;
}

.card__title {
    margin: 0;
    font-size: 1.25rem;
}

.card__title a {
    text-decoration: none;
}

/* Whole card is clickable via the title link. */
.card--link {
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.card--link .card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.card--link:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-dropdown);
    transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
    .card--link:hover {
        transform: none;
    }
}

.route-profile {
    margin: 0 0 1rem;
}

.route-profile img {
    display: block;
    max-width: 100%;
    height: auto;
}

.route-profile figcaption {
    margin-top: 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* --- Elevation profile drawn from the GPX ------------------------------------
   templates/events/includes/route_profile.html + static/js/route-profile.js.
   The SVG stretches to the box; labels are HTML placed in % of it. */
.route-profile__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    margin: 0;
}

.route-profile__stats div {
    display: flex;
    flex-direction: column;
}

.route-profile__stats dt {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.route-profile__stats dd {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.route-chart {
    display: grid;
    grid-template-columns: 2.75rem 1fr;
    margin: 1rem 0 0;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.route-chart__y,
.route-chart__x {
    position: relative;
}

.route-chart__y span {
    position: absolute;
    right: 0.5rem;
    transform: translateY(-50%);
}

.route-chart__plot {
    position: relative;
    height: clamp(10rem, 28vw, 18rem);
    border-bottom: 1px solid var(--color-text-muted);
    cursor: crosshair;
    touch-action: pan-y;
}

.route-chart__plot svg {
    display: block;
    width: 100%;
    height: 100%;
}

.route-chart__grid {
    stroke: var(--color-border);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

/* The area takes the event's colour, greyed so the gradient-coloured line stands out. */
.route-chart__area {
    fill: color-mix(in srgb, var(--color-primary) 30%, #d4d4d8);
    opacity: 0.55;
}

.route-chart__line {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.route-chart__x {
    grid-column: 2;
    height: 1.5rem;
}

.route-chart__x span {
    position: absolute;
    top: 0.25rem;
    transform: translateX(-50%);
}

.route-chart__x span:first-child {
    transform: none;
}

.route-chart__x .route-chart__unit {
    right: 0;
    transform: none;
}

.route-chart__cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px dashed var(--color-ink);
    pointer-events: none;
}

.route-chart__dot {
    position: absolute;
    left: 0;
    width: 0.875rem;
    height: 0.875rem;
    margin: -0.4375rem 0 0 -0.4375rem;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.35);
}

.route-chart__tip {
    position: absolute;
    top: 0.25rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    background: var(--color-ink);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.route-chart__cursor--flip .route-chart__tip {
    right: 0.5rem;
    left: auto;
}

.route-profile .route-profile__legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
}

.route-profile__legend ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.route-profile__legend li {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* A short piece of the line. */
.route-profile__swatch {
    width: 1.25rem;
    height: 0.25rem;
    border-radius: 0.125rem;
}

.route-map {
    /* Leaflet's own z-indexes stay inside, under the sticky header. */
    isolation: isolate;
    height: clamp(16rem, 50vw, 26rem);
    margin-top: 1rem;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.card__text {
    margin: 0;
    color: var(--color-text-muted);
}

.card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: auto 0 0;
    padding-top: 0.5rem;
    font-weight: 600;
}

.route-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

/* --- Race card: one route of an edition --------------------------------------
   The distance is the headline (as on most race sites); the other facts follow
   in a fixed order so the routes compare at a glance. */
.race-card {
    border-top: 4px solid var(--color-primary);
}

.race-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.125rem 0;
}

.race-card__distance {
    margin: 0;
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-size: 3.25rem;
    font-weight: 800;
    line-height: 0.9;
    font-variant-numeric: tabular-nums;
}

.race-card__distance small,
.hero-stats small {
    margin-left: 0.15em;
    font-size: 0.45em;
    font-weight: 600;
    text-transform: uppercase;
}

.race-card .card__title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    line-height: 1.1;
}

.race-card__facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem 1rem;
    margin: 0.25rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.race-card__facts:not(:has(div)) {
    display: none;
}

.race-card__facts dt {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.race-card__facts dd {
    margin: 0;
    font-weight: 700;
}

/* Elevation profiles are wide charts: shown whole, never cropped. */
.race-card__profile {
    padding: 0 1.125rem;
}

.race-card__profile img {
    display: block;
    width: 100%;
    height: auto;
}

.race-card__more {
    margin: 0;
    padding: 0.75rem 1.125rem;
    color: var(--color-primary);
    font-weight: 700;
}

.race-card__more span {
    display: inline-block;
    transition: transform 0.15s ease;
}

.race-card:hover .race-card__more span {
    transform: translateX(0.25rem);
}

/* --- Badge ------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge--open {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-on-primary);
}

/* --- Race hero: event, edition and route pages --------------------------------
   Full-bleed, dark (the event photo, or its primary colour darkened), with the
   headline numbers in big condensed type and one action. */
.hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: clamp(22rem, 55vh, 36rem);
    padding-block: 3rem 2.5rem;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 85% 0%, color-mix(in srgb, var(--color-primary) 55%, transparent), transparent 60%),
        var(--color-ink);
    color: #ffffff;
}

.hero--compact {
    min-height: clamp(18rem, 42vh, 28rem);
}

.hero--image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgb(0 0 0 / 0.8) 0%, rgb(0 0 0 / 0.35) 55%, rgb(0 0 0 / 0.15) 100%);
}

.hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__inner {
    position: relative;
    z-index: 2;
}

.hero__back {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.hero__back a {
    text-decoration: none;
    opacity: 0.85;
}

.hero__back a:hover {
    opacity: 1;
}

/* "1.–2. 5. 2027 / Otrokovice" */
.hero__eyebrow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0 0 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero__eyebrow span + span::before {
    content: "";
    display: inline-block;
    width: 0.375rem;
    height: 0.375rem;
    margin-right: 1rem;
    border-radius: 50%;
    background: var(--color-secondary);
    vertical-align: middle;
}

.hero__title {
    max-width: 18ch;
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(2.75rem, 1.5rem + 6vw, 6rem);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    text-wrap: balance;
}

.hero__year {
    color: var(--color-secondary);
}

.hero__lead {
    max-width: 40rem;
    margin: 1rem 0 0;
    font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
    opacity: 0.9;
}

/* "100 km  3 200 m+  24 h" */
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2.5rem;
    margin: 1.75rem 0 0;
}

.hero-stats dt {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
}

.hero-stats dd {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem);
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.hero__actions:not(:has(*)) {
    display: none;
}

.hero .badge {
    padding: 0.375rem 0.875rem;
    border-color: rgb(255 255 255 / 0.5);
    background: rgb(0 0 0 / 0.25);
    color: #ffffff;
    font-size: 0.9375rem;
}

/* The routes of the edition as pills: "100 km · 50 km · 25 km". */
.route-chips ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.route-chips a {
    display: block;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.12);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.4);
    font-weight: 700;
    text-decoration: none;
}

.route-chips a span {
    font-weight: 400;
    opacity: 0.8;
}

.route-chips a:hover {
    background: rgb(255 255 255 / 0.22);
}

.route-chips a[aria-current="page"] {
    background: #ffffff;
    color: var(--color-ink);
}

/* --- Race layout: content + fact sheet ------------------------------------------
   Phones: the fact sheet (registration first) comes right after the hero.
   From 64em: content on the left, fact sheet in a sticky column on the right. */
.race-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0 3rem;
    padding-top: 1.5rem;
}

.race-layout__main {
    min-width: 0;
}

@media (min-width: 64em) {
    .race-layout {
        grid-template-columns: minmax(0, 1fr) 20rem;
    }

    .race-layout__aside {
        grid-column: 2;
        grid-row: 1;
        position: sticky;
        top: calc(var(--header-height) + 1.5rem);
        align-self: start;
    }

    .race-layout__main {
        grid-column: 1;
        grid-row: 1;
    }

    .race-layout .page-tabs {
        margin-top: 0;
    }
}

.facts-card,
.aside-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
}

.aside-card {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
}

.facts-card {
    overflow: hidden;
    border-top: 4px solid var(--color-primary);
}

.facts-card__registration {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--color-surface);
}

.facts-card__status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    font-weight: 700;
}

.facts-card__note {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.facts-card__notice {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

.facts-card__list {
    margin: 0;
    padding: 0.5rem 1.25rem;
}

.facts-card__list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.625rem;
}

.facts-card__list div + div {
    border-top: 1px solid var(--color-border);
}

.facts-card__list dt {
    color: var(--color-text-muted);
}

.facts-card__list dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.facts-card__files {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0 1.25rem 1.25rem;
}

.facts-card__files .button {
    flex: 1;
}

.aside-card__title {
    margin: 0 0 0.5rem;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.aside-card__links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.aside-card__links a {
    display: block;
    padding-block: 0.375rem;
    font-weight: 600;
    text-decoration: none;
}

.aside-card__links a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* --- Past edition: results and photos first ------------------------------------ */
.past-edition {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--color-secondary);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.past-edition__text {
    margin: 0;
    font-weight: 600;
}

.past-edition__text a {
    display: inline-block;
    margin-left: 0.25rem;
    color: var(--color-primary);
}

.past-edition__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.past-edition__links a {
    display: block;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: 600;
    text-decoration: none;
}

.page-tabs {
    position: sticky;
    top: var(--header-height);
    z-index: 50;
    margin-top: 1.5rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

/* No sections yet: no empty bar. */
.page-tabs:not(:has(li)) {
    display: none;
}

.page-tabs ul {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: none;
}

.page-tabs a {
    display: block;
    padding-block: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.page-tabs a:hover {
    color: var(--color-text-muted);
}

/* --- Breadcrumbs ------------------------------------------------------------- */
.breadcrumbs {
    background: var(--color-surface);
    font-size: 0.875rem;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    margin-block: 0;
    padding-block: 0.875rem 0;
    list-style: none;
}

.breadcrumbs li + li::before {
    content: "›";
    margin-right: 0.5rem;
    color: var(--color-text-muted);
}

.breadcrumbs a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--color-text);
    text-decoration: underline;
}

.breadcrumbs + .page-header {
    padding-top: 1.5rem;
}

/* --- Edition (year) switcher ------------------------------------------------- */
.edition-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 1.5rem;
}

.edition-switcher__label {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.edition-switcher ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.edition-switcher a {
    display: block;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.edition-switcher a:hover {
    background: var(--color-surface);
}

.edition-switcher a[aria-current="page"] {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-on-primary);
}

/* --- Race information blocks (apps/events/blocks.py) --------------------------- */
/* Course strip: aid stations as dots along the route, names slanted above the
   line so close stations still read; on phones only the km. */
.course-strip {
    margin: 0 0 1.5rem;
    padding: 0 1.5rem 0 1rem;
    overflow: hidden;
}

.course-strip__line {
    position: relative;
    height: 8.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.course-strip__line::before {
    content: "";
    position: absolute;
    right: 0;
    bottom: 1.75rem;
    left: 0;
    height: 4px;
    border-radius: 2px;
    background: var(--color-primary);
}

.course-strip__stop {
    position: absolute;
    bottom: 1.75rem;
    left: var(--at);
}

/* The dot sits on the line; a cut-off station gets a ring in the accent colour. */
.course-strip__stop::before {
    content: "";
    position: absolute;
    bottom: -0.3125rem;
    left: -0.4375rem;
    width: 0.875rem;
    height: 0.875rem;
    border: 3px solid var(--color-primary);
    border-radius: 50%;
    background: var(--color-bg);
}

.course-strip__stop--cutoff::before {
    border-color: var(--color-secondary);
}

.course-strip__name {
    position: absolute;
    bottom: 0.875rem;
    left: -0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    transform: rotate(-35deg);
    transform-origin: left bottom;
}

.course-strip__km {
    position: absolute;
    top: 0.75rem;
    left: 0;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    transform: translateX(-50%);
}

@media (max-width: 47.999em) {
    .course-strip__line {
        height: 3rem;
    }

    .course-strip__name {
        display: none;
    }
}

/* Equipment: checklists side by side, mandatory first. */
.equipment__intro {
    max-width: 45rem;
}

.equipment__lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1rem 2rem;
}

.equipment__group h3,
.place__name {
    margin: 0.5rem 0;
    font-family: var(--font-heading);
    font-size: 1.125rem;
}

.equipment__group--mandatory h3 {
    color: var(--color-primary);
}

.checklist {
    margin: 0;
    padding: 0;
    list-style: none;
}

.checklist li {
    position: relative;
    padding: 0.375rem 0 0.375rem 1.75rem;
    border-bottom: 1px solid var(--color-border);
}

/* A tick for mandatory items, a hollow box for the others. */
.checklist li::before {
    content: "";
    position: absolute;
    top: 0.6rem;
    left: 0.125rem;
    width: 0.875rem;
    height: 0.875rem;
    border: 2px solid var(--color-text-muted);
    border-radius: 0.1875rem;
}

.equipment__group--mandatory .checklist li::before {
    border-color: var(--color-primary);
    background: var(--color-primary)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='white' stroke-width='2.5'/%3E%3C/svg%3E")
        center / 100% no-repeat;
}

.checklist__note {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Tables: aid stations, schedule. */
.table-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-table th,
.data-table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.data-table thead th {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.data-table tbody th {
    font-weight: 600;
}

.data-table__num {
    font-variant-numeric: tabular-nums;
    text-align: right !important;
    white-space: nowrap;
}

.data-table__strong {
    font-weight: 700;
    white-space: nowrap;
}

.schedule__day th {
    padding-top: 1.25rem;
    background: var(--color-bg);
    color: var(--color-primary);
    font-size: 1rem;
}

.schedule__time {
    width: 8rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    white-space: nowrap;
}

.block-note {
    margin-top: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* Q&A: questions whose answers open on click. */
.collapsible {
    border-top: 1px solid var(--color-border);
}

.collapsible__item {
    border-bottom: 1px solid var(--color-border);
}

.collapsible__item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 0;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.collapsible__item summary::-webkit-details-marker {
    display: none;
}

.collapsible__item summary::after {
    content: "";
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.25rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.collapsible__item[open] summary::after {
    transform: rotate(-135deg);
}

.collapsible__item summary:hover {
    color: var(--color-primary);
}

.collapsible__body {
    max-width: 45rem;
    padding-bottom: 1rem;
}

.collapsible__body > :first-child {
    margin-top: 0;
}

/* Collapsible part of a section (e.g. rules): any content under a title that opens on click. */
.collapsible-section {
    margin: 1.25rem 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.collapsible-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.collapsible-section > summary::-webkit-details-marker {
    display: none;
}

.collapsible-section > summary::after {
    content: "";
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.25rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.collapsible-section[open] > summary::after {
    transform: rotate(-135deg);
}

.collapsible-section > summary:hover {
    color: var(--color-primary);
}

.collapsible-section[open] > summary {
    border-bottom: 1px solid var(--color-border);
}

.collapsible-section__body {
    padding: 0 1.25rem 0.25rem;
}

/* Highlight box. */
.callout {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--color-secondary);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.callout--warning {
    border-left-color: #d97706;
    background: #fffbeb;
}

.callout > :last-child {
    margin-bottom: 0;
}

.callout__title {
    margin: 0 0 0.375rem;
    font-weight: 700;
}

/* Place: parking, start, finish. */
.place {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.place .place__name {
    margin-top: 0;
}

.place p {
    margin: 0.25rem 0;
}

.place__gps {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.place__map {
    font-weight: 600;
}

/* --- O nás: team photo and team carousel -----------------------------------
   Without JS: all members as a card grid with full text. With
   static/js/carousel.js (.is-ready): a spotlight carousel, the centre card
   popped up and data-offset -3…3 placing the others; the full text opens in a
   pop-up dialog. */
.team-photo {
    margin: 2rem 0 0;
}

.team-photo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.section-lead {
    max-width: 45rem;
    margin: 0 0 1.5rem;
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

.carousel__track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.team-member {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.team-member__photo {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 5;
    background: var(--color-surface);
}

.team-member__photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-member__initial {
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
}

.team-member__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.125rem;
}

.team-member__name {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.25rem;
}

.team-member__bio {
    margin: 0;
    color: var(--color-text-muted);
}

.team-member__link {
    margin: auto 0 0;
    padding-top: 0.5rem;
    font-weight: 600;
}

/* Spotlight carousel */
.carousel {
    --card-width: min(70vw, 17rem);
    --card-step: calc(var(--card-width) * 0.62);
}

@media (min-width: 48em) {
    .carousel {
        --card-width: 18rem;
        --card-step: calc(var(--card-width) * 0.78);
    }
}

.carousel.is-ready .carousel__viewport {
    overflow: hidden;
    /* Room for the popped-up card's shadow. */
    padding-block: 1.5rem 2rem;
}

.carousel.is-ready .carousel__track {
    position: relative;
    display: block;
    height: calc(var(--card-width) * 1.25);
}

.carousel.is-ready .carousel__slide {
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--card-width);
    height: 100%;
    border: 0;
    border-radius: calc(var(--radius) * 3);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.15);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(-50% + var(--x, 0) * var(--card-step))) scale(var(--scale, 0.5));
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.55s ease, box-shadow 0.55s ease;
}

.carousel.is-ready .carousel__slide[data-offset="-3"] { --x: -3.2; --scale: 0.5; }
.carousel.is-ready .carousel__slide[data-offset="-2"] { --x: -2.1; --scale: 0.66; z-index: 1; opacity: 0.45; }
.carousel.is-ready .carousel__slide[data-offset="-1"] { --x: -1.2; --scale: 0.82; z-index: 2; opacity: 0.8; }
.carousel.is-ready .carousel__slide[data-offset="0"] { --x: 0; --scale: 1; z-index: 3; opacity: 1; }
.carousel.is-ready .carousel__slide[data-offset="1"] { --x: 1.2; --scale: 0.82; z-index: 2; opacity: 0.8; }
.carousel.is-ready .carousel__slide[data-offset="2"] { --x: 2.1; --scale: 0.66; z-index: 1; opacity: 0.45; }
.carousel.is-ready .carousel__slide[data-offset="3"] { --x: 3.2; --scale: 0.5; }

.carousel.is-ready .carousel__slide[data-offset="-2"],
.carousel.is-ready .carousel__slide[data-offset="-1"],
.carousel.is-ready .carousel__slide[data-offset="0"],
.carousel.is-ready .carousel__slide[data-offset="1"],
.carousel.is-ready .carousel__slide[data-offset="2"] {
    pointer-events: auto;
}

/* The popped-up card: a ring in the secondary (accent) colour. */
.carousel.is-ready .carousel__slide[data-offset="0"] {
    box-shadow: 0 0 0 4px var(--color-secondary), 0 1.25rem 2.5rem rgb(0 0 0 / 0.3);
}

/* On phones only the direct neighbours peek in. */
@media (max-width: 47.999em) {
    .carousel.is-ready .carousel__slide[data-offset="-2"],
    .carousel.is-ready .carousel__slide[data-offset="2"] {
        opacity: 0;
        pointer-events: none;
    }
}

.carousel.is-ready .carousel__slide .team-member__photo {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
}

/* Name on a dark gradient over the photo; the full text is in the dialog. */
.carousel.is-ready .carousel__slide .team-member__body {
    position: absolute;
    inset: auto 0 0;
    padding: 3rem 1.125rem 1rem;
    background: linear-gradient(to top, rgb(0 0 0 / 0.75), transparent);
    color: #ffffff;
}

.carousel.is-ready .carousel__slide .team-member__bio,
.carousel.is-ready .carousel__slide .team-member__link {
    display: none;
}

.team-member__open {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0.75rem;
    border: 0;
    background: none;
    border-radius: inherit;
    cursor: pointer;
}

.team-member__open[hidden] {
    display: none;
}

.team-member__more {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-0.25rem);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.carousel__slide[data-offset="0"] .team-member__more {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .carousel.is-ready .carousel__slide,
    .team-member__more {
        transition: none;
    }
}

.carousel__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.carousel__controls[hidden] {
    display: none;
}

.carousel__button {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
}

.carousel__button:hover {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.carousel__arrow {
    width: 0.625rem;
    height: 0.625rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

.carousel__arrow--prev {
    margin-left: 0.25rem;
    transform: rotate(135deg);
}

.carousel__arrow--next {
    margin-right: 0.25rem;
    transform: rotate(-45deg);
}

/* Pause icon (two bars); a play triangle once stopped. */
.carousel__play-icon {
    width: 0.625rem;
    height: 0.75rem;
    border-inline: 3px solid currentColor;
}

.carousel.is-stopped .carousel__play-icon {
    width: 0;
    height: 0;
    margin-left: 0.25rem;
    border-block: 0.4375rem solid transparent;
    border-inline: 0.6875rem solid currentColor;
    border-right: 0;
}

.carousel__status {
    min-width: 4.5rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

/* --- Pop-up dialog with one member's full text --------------------------------- */
.team-dialog {
    width: min(100% - 2 * var(--gutter), 56rem);
    max-height: calc(100dvh - 2 * var(--gutter));
    padding: 0;
    overflow: auto;
    border: 0;
    border-top: 6px solid var(--color-secondary);
    border-radius: calc(var(--radius) * 3);
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: 0 2rem 4rem rgb(0 0 0 / 0.35);
}

.team-dialog[open] {
    animation: team-dialog-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.team-dialog::backdrop {
    background: rgb(0 0 0 / 0.6);
    backdrop-filter: blur(4px);
}

.team-dialog[open]::backdrop {
    animation: team-dialog-fade 0.35s ease;
}

@keyframes team-dialog-pop {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(1.5rem);
    }
}

@keyframes team-dialog-fade {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .team-dialog[open],
    .team-dialog[open]::backdrop {
        animation: none;
    }
}

.team-dialog__content {
    border: 0;
    border-radius: 0;
}

.team-dialog__content .team-member__photo {
    aspect-ratio: 1;
}

.team-dialog__content .team-member__body {
    padding: 1.5rem 1.5rem 0;
}

.team-dialog__content .team-member__name {
    font-size: 1.75rem;
}

.team-dialog__content .team-member__bio {
    color: var(--color-text);
    font-size: 1.0625rem;
}

@media (min-width: 48em) {
    .team-dialog__content {
        flex-direction: row;
    }

    .team-dialog__content .team-member__photo {
        flex: 0 0 45%;
        aspect-ratio: 4 / 5;
    }

    .team-dialog__content .team-member__body {
        justify-content: center;
        padding: 2.5rem 2.5rem 5rem;
    }
}

.team-dialog__nav {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem 1.5rem;
}

@media (min-width: 48em) {
    .team-dialog__nav {
        position: absolute;
        right: 0;
        bottom: 0;
    }
}

.team-dialog__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 999px;
    background: rgb(0 0 0 / 0.55);
    color: #ffffff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.team-dialog__close:hover {
    background: rgb(0 0 0 / 0.8);
}
