/* --------------------------------------------------
    Hero Section  —  Westonbirt-style: full-bleed image,
    bottom-left heading in a solid marker block, calm
    spacing, rectangular bordered buttons. Accent stays
    the traditional swim red.
-------------------------------------------------- */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 62vh;
    padding-bottom: clamp(2rem, 6vw, 5rem);
    overflow: hidden;
    z-index: 1;
    /* Fallback image behind the video — the 2024 hero photos are not deployed
       to every server, so always keep a committed photo here. The <video>
       (z-index 0) covers it on desktop; on mobile the video is hidden and
       this shows through. */
    background: var(--hero-random-bg, url("/assets/img/2019/2019-7.jpg")) center / cover no-repeat;
    background-color: #1e2220;
}

/* Subtle gradient — the heading has its own solid block, so this stays light,
   just deepening the bottom where the text sits. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.06) 35%, rgba(0, 0, 0, 0.24) 72%, rgba(0, 0, 0, 0.42) 100%);
    z-index: 1;
}

/* Background Video */
.hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Anchor to the bottom: the 2025 footage has lots of sky, and the swimmers
       are in the lower part of the frame. */
    object-position: center bottom;
    z-index: 0;
    transform: scale(1.01);
    transform-origin: center bottom;
}

/* Wrapper / Body */
.hero__wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    z-index: 2;
    /* Override the shared .wrapper class (max-width:1200 + margin:0 auto),
       which as a shrink-wrapped flex item was centring the hero content. */
    width: 100%;
    max-width: none;
    margin: 0;
}

.hero__body {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    flex-grow: 1;
    gap: 2rem;
    max-width: 90rem;
    padding: clamp(2rem, 5vw, 5rem);
}

/* Kicker — small sharp tag (only rendered when a phase sets one) */
.hero__kicker {
    margin: 0;
    padding: 0.5rem 1rem;
    border-radius: 0;
    background: var(--color-accent);
    color: #fff;
    font-family: var(--display-font);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    font-size: 1.4rem;
}

/* Title — regular-weight Ubuntu, all caps, sitting in a solid block
   that hugs each wrapped line. */
.hero__title {
    width: auto;
    max-width: 20ch;
    margin: 0;
    font-family: var(--display-font);
    font-size: clamp(3rem, 4.6vw, 4.6rem);
    font-weight: 500;
    line-height: 1.34;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    text-align: left;
    text-shadow: none;
    color: #fff;
}

.hero__title>span,
.hero__title .bubble-heading__inner {
    display: inline;
    padding: 0.05em 0.3em;
    background-color: var(--color-accent);
    border-radius: 0;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Ticker-tape: each word is its own red block at a slightly wonky angle. */
.hero__title .hero__title-word {
    display: inline-block;
    margin: 0.12em 0;
    transform: rotate(var(--wonk, 0deg));
    transform-origin: left center;
}

.hero__title .hero__title-word:nth-child(4n+1) {
    --wonk: -2deg;
}

.hero__title .hero__title-word:nth-child(4n+2) {
    --wonk: 1.4deg;
}

.hero__title .hero__title-word:nth-child(4n+3) {
    --wonk: -0.8deg;
}

.hero__title .hero__title-word:nth-child(4n+4) {
    --wonk: 2.2deg;
}

/* Strapline — plain, calm, no box */
.hero__strapline {
    width: auto;
    max-width: 44ch;
    margin: 0;
    font-family: var(--body-font);
    font-size: clamp(1.7rem, 2.2vw, 2.1rem);
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
    text-align: left;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.hero__strapline .bubble-heading__inner {
    display: inline;
    background-color: #1e2220;
    font-family: inherit;
    padding: 0.12em 0.45em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.hero__strapline .bubble-heading__inner span {
    background: transparent;
    padding: 0;
}

/* Logo (hidden — heading carries the hero) */
.hero__logo {
    display: none;
}

/* Buttons — rectangular, white border, solid primary / outline secondary */
.hero__button-group {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 1.4rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}

.hero__button-group a>button,
.hero__button-group>button {
    font-family: var(--body-font);
    font-size: 1.6rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #fff;
    background: var(--color-accent);
    border: 2px solid #fff;
    border-radius: 0;
    padding: 1.2rem 2.4rem;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.hero__button-group a>button:hover,
.hero__button-group>button:hover,
.hero__button-group a>button:focus-visible,
.hero__button-group>button:focus-visible {
    background: #fff;
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.25);
}

.hero__button-group a>button:active,
.hero__button-group>button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Second button in the group = outline style */
.hero__button-group a:nth-of-type(2)>button {
    background: transparent;
}

/* Page header (other pages) — same display font, calmer than before */
.page-header {
    background: var(--gradient-2);
}

.page-header__title {
    font-family: var(--display-font);
    font-size: clamp(3.2rem, 6vw, 5.6rem);
    font-weight: 500;
    text-transform: none;
    color: #fff;
    text-align: center;
    padding: 3rem 1.5rem;
}

/* --------------------------------------------------
    Media Queries
-------------------------------------------------- */

@media (max-width: 60rem) {
    .hero {
        background: var(--hero-random-bg, url("/assets/img/2019/2019-7.jpg")) center / cover no-repeat;
        background-color: #1e2220;
        padding-inline: 1.5rem;
        min-height: 72vh;
        overflow: hidden;
    }

    .hero__video {
        display: none;
    }

    .hero__logo {
        display: none;
    }

    .hero__body {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-end;
        padding: 2rem;
        gap: 1.6rem;
    }

    .hero__title {
        position: static;
        width: auto;
        margin: 0;
        background: none;
        text-align: left;
        font-size: clamp(2.8rem, 8vw, 4rem);
    }

    .hero__strapline {
        display: block;
        font-size: 1.7rem;
    }

    .hero__button-group {
        flex-direction: column;
        align-items: stretch;
        gap: 1.2rem;
        width: 100%;
    }

    .hero__button-group a {
        display: block;
    }

    .hero__button-group a>button {
        width: 100%;
    }
}

@media (min-width: 119.9rem) {
    .hero__body {
        max-width: 72rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .hero__video {
        animation: hero-video-settle 1400ms var(--ease-smooth) both;
    }

    .hero__body>* {
        animation: hero-rise var(--duration-slow) var(--ease-smooth) both;
    }

    .hero__body>*:nth-child(2) {
        animation-delay: 100ms;
    }

    .hero__body>*:nth-child(3) {
        animation-delay: 180ms;
    }
}

@keyframes hero-video-settle {
    from {
        transform: scale(1.05);
    }

    to {
        transform: scale(1.01);
    }
}

@keyframes hero-rise {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
