/*
 * 276.70: Carsten's Atlantic page, mock-up v10 (doc, 17 Nov evening).
 * Loaded after atlantic-v8.css and only changes what v10 changes:
 * - header: the whole facts row fits on the first screen of a laptop
 * - chapters: photo on the left (La Gomera, Antigua), a full-screen Atlantic
 *   photo with the big line over it, one colour grade, bigger body text
 * - Row it your way: five 4:3 image cards, no buttons
 * - The big questions: tap to open, all closed on load
 * - motion (with assets/js/atlantic-motion.js)
 */

/* ---------- Header: fit the first screen ---------- */
@media (min-width: 768px) {
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-header {
        align-items: center;
        min-height: clamp(560px, calc(100svh - 97px), 900px);
    }
    .wtr-a8-header-copy { padding: 44px 64px 48px; }
    body.wtr-race8 main .wtr-a8-header h1 { font-size: clamp(88px, min(10vw, 16vh), 150px) !important; }
    .wtr-a8 .wtr-a8-facts { margin-top: 34px; }
}
/* Short laptop screens (768px and lower): tighter, so the facts row is never cut in half */
@media (min-width: 768px) and (max-height: 800px) {
    .wtr-a8-header-copy { padding: 28px 64px 32px; }
    body.wtr-race8 main .wtr-a8-header h1 { margin-bottom: 14px; font-size: clamp(80px, min(10vw, 14vh), 130px) !important; }
    body.wtr-race8 main .wtr-a8 .wtr-a8-header-text { margin-bottom: 20px; font-size: 18px; }
    body.wtr-race8 main .wtr-a8 .wtr-a8-status { margin-top: 16px; }
    .wtr-a8 .wtr-a8-facts { margin-top: 22px; }
    .wtr-a8 .wtr-a8-facts strong { font-size: 34px; }
}

/* ---------- Chapters: WTR Crisp (276.83, Carsten 18 Nov: replaces the paler grade and its blue layer) ---------- */
.wtr-a8-chapter-media img { filter: var(--wtr-crisp); }

/* Body text a step bigger (Carsten: about 20-21px on laptops) */
@media (min-width: 768px) {
    body.wtr-race8 main .wtr-a8-chapter p:not(.wtr-a8-closing) { font-size: 20px; line-height: 1.6; }
}

/* ---------- Side chapters (La Gomera, Antigua): photo left, short fade, text never over the photo ---------- */
@media (min-width: 768px) {
    .wtr-a8-chapter:is(.is-photo-left, .is-photo-right) .wtr-a8-chapter-media { width: 60%; }
    .wtr-a8-chapter.is-photo-left .wtr-a8-chapter-media {
        -webkit-mask-image: linear-gradient(270deg, transparent 0%, rgba(0, 0, 0, .5) 8%, #000 18%) !important;
        mask-image: linear-gradient(270deg, transparent 0%, rgba(0, 0, 0, .5) 8%, #000 18%) !important;
    }
    .wtr-a8-chapter.is-photo-right .wtr-a8-chapter-media {
        -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .5) 8%, #000 18%) !important;
        mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .5) 8%, #000 18%) !important;
    }
    /* The text column starts after the photo ends (60% of the width) on every laptop width. */
    .wtr-a8-chapter:is(.is-photo-left, .is-photo-right) .wtr-a8-chapter-copy,
    .wtr-a8-chapter.is-fade-short .wtr-a8-chapter-copy { max-width: min(600px, calc(40vw - 96px)); }
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-chapter:is(.is-photo-left, .is-photo-right) { min-height: 720px; }
}

/* ---------- Full-screen chapter (The Atlantic) ---------- */
body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-chapter.is-photo-full {
    display: block;
    min-height: 0;
    padding: 0 !important;
}
.wtr-a8-full-stage {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: clamp(620px, 100svh, 1040px);
    padding: 0 64px 70px;
}
.wtr-a8-chapter.is-photo-full .wtr-a8-chapter-media {
    position: absolute;
    inset: 0;
    width: auto;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}
.wtr-a8-full-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, .35) 30%, rgba(0, 0, 0, 0) 55%);
    pointer-events: none;
}
.wtr-a8-full-head { position: relative; z-index: 1; }
body.wtr-race8 main .wtr-a8-chapter.is-photo-full h2 {
    max-width: 9em;
    font-size: clamp(64px, 8vw, 150px) !important;
    line-height: .98 !important; /* 276.73: was .92; the same spacing as ROW THE ATLANTIC and the Home headline */
}
/* 276.73: the light blue part keeps the headline's line spacing (it was picking up 1.0 from a general rule, so the gap above it was bigger) */
body.wtr-race8 main .wtr-a8 h2 .wtr-a8-accent { display: block; color: var(--wtr-c-accent) !important; line-height: inherit !important; }
.wtr-a8-full-body {
    display: grid;
    grid-template-columns: minmax(0, 640px) minmax(0, 1fr);
    gap: 40px 80px;
    align-items: start;
    padding: 56px 64px 110px;
}
.wtr-a8-full-body .wtr-a8-chapter-copy { max-width: none; }
body.wtr-race8 main .wtr-a8-full-body .wtr-a8-chapter-copy > p:first-child { margin-top: 0; }
.wtr-a8-full-body .wtr-a8-stats {
    justify-self: end;
    width: min(100%, 760px);
    margin-top: 0;
    gap: 34px 60px;
}
.wtr-a8-full-body .wtr-a8-stats strong { font-size: 48px; }

/* ---------- Row it your way: five image cards ---------- */
.wtr-a8-road .wtr-a8-way { display: block; }
body.wtr-race8 main .wtr-a8 .wtr-a8-way p { max-width: 680px; font-size: 20px; }
.wtr-a8 .wtr-a8-classcards {
    display: grid;
    grid-template-columns: repeat(var(--a8-cards, 5), minmax(0, 1fr)); /* 276.74: as many columns as cards (the Pacific has four) */
    gap: 16px;
    margin: 40px 0 0;
    padding: 0;
    list-style: none;
}
.wtr-a8 .wtr-a8-classcard { margin: 0; padding: 0; }
.wtr-a8-classcard-photo {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: #161616; /* 276.84: no navy */
}
.wtr-a8-classcard-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wtr-a8 .wtr-a8-classcard-label {
    display: block;
    margin-top: 14px;
    color: var(--wtr-c-accent);
    font: 800 13px/1.3 var(--wtr-font-body);
    letter-spacing: .16em;
    text-transform: uppercase;
}

/* ---------- The big questions: tap to open ---------- */
.wtr-a8-qa details.wtr-a8-qa-item { padding: 0; }
.wtr-a8-qa details.wtr-a8-qa-item:last-child { border-bottom: 1px solid rgba(255, 255, 255, .12); }
.wtr-a8-qa summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 0;
    cursor: pointer;
    list-style: none;
}
.wtr-a8-qa summary::-webkit-details-marker { display: none; }
.wtr-a8-qa summary::marker { content: ""; }
.wtr-a8-qa summary:focus-visible { outline: 2px solid var(--wtr-c-accent); outline-offset: 4px; }
body.wtr-race8 main .wtr-a8-qa summary h3 { margin: 0; font-size: 34px !important; }
.wtr-a8-qa-toggle {
    position: relative;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 50%;
    transition: background-color .25s ease, border-color .25s ease;
}
.wtr-a8-qa-toggle::before,
.wtr-a8-qa-toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    margin: -1px 0 0 -7px;
    background: #fff;
    transition: transform .25s ease, background-color .25s ease;
}
.wtr-a8-qa-toggle::after { transform: rotate(90deg); }
.wtr-a8-qa details[open] .wtr-a8-qa-toggle::after { transform: rotate(0deg); }
.wtr-a8-qa summary:hover .wtr-a8-qa-toggle { border-color: var(--wtr-c-accent); background: var(--wtr-c-accent); }
.wtr-a8-qa summary:hover .wtr-a8-qa-toggle::before,
.wtr-a8-qa summary:hover .wtr-a8-qa-toggle::after { background: #000; }
.wtr-a8-qa-answer { padding: 0 60px 26px 0; }
body.wtr-race8 main .wtr-a8 .wtr-a8-qa-answer p:first-child { margin-top: 0; }
body.wtr-race8 main .wtr-a8 .wtr-a8-qa p { font-size: 17px; }

/* ---------- Phones ---------- */
@media (max-width: 767px) {
    /* Full-screen chapter: photo on top, centred on the boat, line over its foot */
    .wtr-a8-full-stage { display: block; min-height: 0; padding: 330px var(--a8-g) 8px; }
    .wtr-a8-full-stage::after { display: none; }
    .wtr-a8-chapter.is-photo-full .wtr-a8-chapter-media img[data-wtr-photo] { object-position: var(--wtr-px-m, 50%) var(--wtr-py-m, 50%); }
    body.wtr-race8 main .wtr-a8-chapter.is-photo-full h2 { font-size: 46px !important; }
    .wtr-a8-full-body { display: block; padding: 26px var(--a8-g) 56px; }
    .wtr-a8-full-body .wtr-a8-chapter-copy { padding-top: 0 !important; } /* v8's phone room for the photo is not needed here */
    .wtr-a8-chapter.is-photo-full .wtr-a8-chapter-media {
        top: 0;
        right: 0;
        bottom: auto;
        left: 0;
        height: 400px;
        -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
        mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
    }
    .wtr-a8-full-body .wtr-a8-stats { width: auto; margin-top: 30px; gap: 24px 20px; }
    .wtr-a8-full-body .wtr-a8-stats strong { font-size: 30px; }
    body.wtr-race8 main .wtr-a8-chapter p:not(.wtr-a8-closing) { font-size: 17px; }

    /* Class cards: a swipe row, one card plus a bit of the next */
    .wtr-a8 .wtr-a8-classcards {
        display: flex;
        gap: 12px;
        margin: 28px calc(-1 * var(--a8-g)) 0;
        padding: 0 var(--a8-g);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .wtr-a8 .wtr-a8-classcards::-webkit-scrollbar { display: none; }
    .wtr-a8 .wtr-a8-classcard { flex: 0 0 72%; scroll-snap-align: start; }
    body.wtr-race8 main .wtr-a8 .wtr-a8-way p { font-size: 16px; }

    body.wtr-race8 main .wtr-a8-qa summary h3 { font-size: 24px !important; }
    .wtr-a8-qa summary { padding: 18px 0; }
    .wtr-a8-qa-toggle { flex-basis: 34px; width: 34px; height: 34px; }
    .wtr-a8-qa-answer { padding-right: 0; }
}

/* ---------- Motion (only once the script has switched it on; never with "reduce motion") ---------- */
@media (prefers-reduced-motion: no-preference) {
    .wtr-a8-motion .wtr-a8-chapter .wtr-a8-chapter-media img {
        transform: scale(1);
        transition: transform 7s cubic-bezier(.2, .6, .2, 1);
    }
    .wtr-a8-motion .wtr-a8-chapter.is-in .wtr-a8-chapter-media img { transform: scale(1.06); }

    .wtr-a8-motion .wtr-a8-chapter:not(.is-photo-full) :is(.wtr-a8-chapter-copy, .wtr-a8-stats),
    .wtr-a8-motion [data-wtr-a8-part] > *,
    .wtr-a8-motion [data-wtr-a8-motion]:not(.wtr-a8-chapter) > * {
        opacity: 0;
        transform: translateY(28px);
    }
    .wtr-a8-motion .wtr-a8-chapter.is-in:not(.is-photo-full) :is(.wtr-a8-chapter-copy, .wtr-a8-stats),
    .wtr-a8-motion [data-wtr-a8-part].is-in > *,
    .wtr-a8-motion [data-wtr-a8-motion].is-in:not(.wtr-a8-chapter) > * {
        opacity: 1;
        transform: none;
        transition-property: opacity, transform;
        transition-duration: .9s;
        transition-timing-function: ease;
    }
    /* The text a moment after the photo starts; on the full-screen photo the big line comes up last. */
    .wtr-a8-motion .wtr-a8-chapter .wtr-a8-chapter-copy { transition-delay: .25s; }
    .wtr-a8-motion .wtr-a8-chapter .wtr-a8-stats { transition-delay: .45s; }
    .wtr-a8-motion .wtr-a8-full-head > .wtr-a8-label { transition-delay: .2s; }
    .wtr-a8-motion .wtr-a8-full-head.is-in > h2 { transition-delay: .6s; transition-duration: 1.1s; }
    .wtr-a8-motion [data-wtr-a8-motion]:not(.wtr-a8-chapter) > :nth-child(2) { transition-delay: .12s; }
    .wtr-a8-motion [data-wtr-a8-motion]:not(.wtr-a8-chapter) > :nth-child(3) { transition-delay: .24s; }
    .wtr-a8-motion [data-wtr-a8-motion]:not(.wtr-a8-chapter) > :nth-child(n+4) { transition-delay: .36s; }
}

/* ---------- 276.71: text lines up with the menu (Carsten, 18 Nov) ----------
 * Photos and video stay the full width of the screen; all text sits in the
 * menu's own column, using the menu's own measurements (chrome.css:
 * --wtr-chrome-gutter and --wtr-chrome-rail from 1100px, 20px below that,
 * 14px on the narrowest phones), so the headline starts under the logo and
 * nothing runs past START YOUR ROW on any screen size.
 * --a8-g is the space from the screen edge to the menu's column and --a8-c the
 * column's width. They are worked out from the section's width, so they are
 * only used for padding and for boxes placed against a full-width section. */
body.wtr-race8 { --a8-g: 20px; --a8-gv: 20px; --a8-c: calc(100% - 40px); }
@media (max-width: 359px) { body.wtr-race8 { --a8-g: 14px; } }
@media (min-width: 1100px) {
    body.wtr-race8 {
        --a8-g: max(var(--wtr-chrome-gutter, 56px), calc((100% - var(--wtr-chrome-rail, 1360px)) / 2));
        --a8-gv: max(var(--wtr-chrome-gutter, 56px), calc((100vw - var(--wtr-chrome-rail, 1360px)) / 2));
        --a8-c: min(100% - 2 * var(--wtr-chrome-gutter, 56px), var(--wtr-chrome-rail, 1360px));
    }
}
@media (min-width: 768px) {
    /* Header: text under the logo; the film starts the same distance into the menu's column as before */
    .wtr-a8-header-copy { padding-left: var(--a8-g); padding-right: var(--a8-g); }
    .wtr-a8-header-media { left: calc(var(--a8-g) + .24 * var(--a8-c)); width: auto; }

    /* Side chapters (La Gomera, Antigua): text column inside the menu's column, photo up to it */
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-chapter:not(.is-photo-full) {
        padding-left: var(--a8-g) !important;
        padding-right: var(--a8-g) !important;
    }
    .wtr-a8-chapter:is(.is-photo-left, .is-photo-right) .wtr-a8-chapter-copy,
    .wtr-a8-chapter.is-fade-short .wtr-a8-chapter-copy { max-width: min(540px, calc(44% - 40px)); }
    .wtr-a8-chapter:is(.is-photo-left, .is-photo-right) .wtr-a8-chapter-media {
        width: calc(100% - var(--a8-g) - min(540px, .44 * var(--a8-c) - 40px) - 56px);
    }

    /* Full-screen chapter (The Atlantic): the big line and the text below it */
    .wtr-a8-full-stage,
    .wtr-a8-full-body { padding-left: var(--a8-g); padding-right: var(--a8-g); }

    /* They went before you, Your road to Antigua, The big questions, Ready to row, Beyond the Atlantic */
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8:is(.wtr-a8-crews, .wtr-a8-road, .wtr-a8-questions, .wtr-a8-ready, .wtr-a8-oceans) {
        padding-left: var(--a8-g) !important;
        padding-right: var(--a8-g) !important;
    }
    /* The big questions photo still runs to the left edge of the screen */
    .wtr-a8-questions-media { margin-left: calc(-1 * var(--a8-gv)); }
}

/* The Atlantic chapter: on smaller laptops the four numbers get a column wide enough for "5,000+"
   (276.70 squeezed them into 8-264px below 1100px wide), and below 900px they sit under the text. */
@media (min-width: 768px) and (max-width: 1279px) {
    .wtr-a8-full-body { grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr); gap: 40px 56px; }
}
@media (min-width: 768px) and (max-width: 899px) {
    .wtr-a8-full-body { grid-template-columns: minmax(0, 1fr); }
    .wtr-a8-full-body .wtr-a8-stats { justify-self: start; width: min(100%, 560px); margin-top: 8px; }
}
/* A long button in a chapter (Antigua's "This could be your finish. Start your row") wraps onto two lines when the text column is narrower than it */
body.wtr-race8 main .wtr-a8-chapter-copy .wtr-a8-buttons .wtr-v23-btn { max-width: 100%; white-space: normal; line-height: 1.35 !important; text-align: center; }

/* Short laptop screens: a little less padding and a slightly smaller headline, so the facts row stays on the first screen with the extra line space */
@media (min-width: 768px) and (max-height: 800px) {
    .wtr-a8-header-copy { padding-top: 20px; padding-bottom: 24px; }
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-header { min-height: clamp(460px, calc(100svh - 97px), 900px); }
    body.wtr-race8 main .wtr-a8-header h1 { font-size: clamp(76px, min(10vw, 13.5vh), 130px) !important; }
}

/* ROW THE ATLANTIC: the two lines spaced like the Home headline, so they do not touch (Carsten, 18 Nov) */
body.wtr-race8 main .wtr-a8-header h1 { line-height: .98 !important; }

/* ---------- 276.72: the editor's previews ----------
 * Each section is previewed in a frame as tall as the section, so anything
 * sized to the screen's height would keep growing with it. In the editor the
 * header and the full-screen Atlantic photo use a typical laptop screen's
 * height instead; the website is unchanged. */
@media (min-width: 768px) {
    body.wtr-psec-in-editor:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-header { min-height: 820px !important; }
    body.wtr-psec-in-editor main .wtr-a8-header h1 { font-size: clamp(88px, 10vw, 150px) !important; }
    body.wtr-psec-in-editor .wtr-a8-full-stage { min-height: 760px; }
}

/* ---------- 276.74: photo zoom (Carsten: crop in on The Atlantic's boat; the Pacific photos at 120-140%) ----------
 * "Zoom in on laptops / phones" in the page editor crops in around the focus point. The scale property
 * adds to the motion's slow zoom (transform) instead of replacing it. */
.wtr-a8 img[data-wtr-photo] {
    scale: var(--wtr-pz, 1);
    transform-origin: var(--wtr-px, 50%) var(--wtr-py, 50%);
}
.wtr-a8-chapter-media { overflow: hidden; }
@media (max-width: 767px) {
    .wtr-a8 img[data-wtr-photo] {
        scale: var(--wtr-pz-m, var(--wtr-pz, 1));
        transform-origin: var(--wtr-px-m, var(--wtr-px, 50%)) var(--wtr-py-m, var(--wtr-py, 50%));
    }
}

/* ---------- 276.74: wide band chapters (the Pacific's Monterey and Kauaʻi, Carsten 18 Nov) ----------
 * The photo as a band across the whole width (about 760px tall on a laptop), fading into black along
 * its bottom edge; below it on black, the label and headline on the left (about 400px) and the text
 * right next to it (up to about 700px). "Short fade" (Kauaʻi) shows more of the photo. Phones: photo
 * on top, text below. */
body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-chapter.is-photo-band {
    display: block;
    min-height: 0;
    padding: 0 !important;
}
.wtr-a8-band-stage { position: relative; height: clamp(440px, 53vw, 760px); }
.wtr-a8-chapter.is-photo-band .wtr-a8-chapter-media {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%) !important;
    mask-image: linear-gradient(180deg, #000 55%, transparent 100%) !important;
}
.wtr-a8-chapter.is-photo-band.is-fade-short .wtr-a8-chapter-media {
    -webkit-mask-image: linear-gradient(180deg, #000 76%, transparent 100%) !important;
    mask-image: linear-gradient(180deg, #000 76%, transparent 100%) !important;
}
.wtr-a8-band-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 400px) minmax(0, 700px);
    gap: 28px 64px;
    align-items: start;
    margin-top: 0; /* 276.82: below the photo on black (Carsten); -64px put Kauaʻi's text on the hull lettering */
    padding: 0 var(--a8-g) 110px;
}
.wtr-a8-chapter.is-photo-band.has-no-photo .wtr-a8-band-body { margin-top: 0; padding-top: 110px; }
.wtr-a8-chapter.is-photo-band .wtr-a8-chapter-copy { max-width: none; margin-left: 0; padding-top: 0; }
body.wtr-race8 main .wtr-a8-chapter.is-photo-band .wtr-a8-chapter-copy > p:first-child { margin-top: 6px; }
.wtr-a8-chapter.is-photo-band .wtr-a8-chapter-copy > .wtr-a8-closing { margin-top: 30px; }
@media (max-width: 767px) {
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-chapter.is-photo-band { padding: 0 0 56px !important; }
    .wtr-a8-band-stage { height: 320px; }
    .wtr-a8-chapter.is-photo-band.is-fade-short .wtr-a8-band-stage { height: 360px; }
    .wtr-a8-chapter.is-photo-band .wtr-a8-chapter-media {
        -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%) !important;
        mask-image: linear-gradient(180deg, #000 55%, transparent 100%) !important;
    }
    .wtr-a8-band-body { display: block; margin-top: 0; padding: 0 var(--a8-g); }
    .wtr-a8-chapter.is-photo-band.has-no-photo .wtr-a8-band-body { padding-top: 40px; }
    .wtr-a8-band-head { margin-bottom: 14px; }
}
/* Motion: the label and headline come up first, then the text (as on the other chapters) */
@media (prefers-reduced-motion: no-preference) {
    .wtr-a8-motion .wtr-a8-chapter.is-photo-band .wtr-a8-band-head { opacity: 0; transform: translateY(28px); }
    .wtr-a8-motion .wtr-a8-chapter.is-photo-band.is-in .wtr-a8-band-head {
        opacity: 1;
        transform: none;
        transition: opacity .9s ease .1s, transform .9s ease .1s;
    }
}

/* ---------- 276.74: the header fits the first screen during a live race too ----------
 * During a race the LIVE bar sits above the menu (35px) and the race line ("Pacific 2026 is live →
 * Track the teams", 42px) above the header, so the header takes the room actually left. On short
 * laptop screens the headline is a little smaller while those bars show. */
body.wtr-race8 { --a8-above: var(--wtr-header-h, 97px); }
body.wtr-race8.wtr-race-live { --a8-above: calc(var(--wtr-header-h, 97px) + 35px); }
@media (min-width: 768px) {
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-header { min-height: clamp(560px, calc(100svh - var(--a8-above)), 900px); }
    body.wtr-race8:not(.wtr-h-page) main > .wtr-lp-raceline + section.wtr-a8.wtr-a8-header { min-height: clamp(560px, calc(100svh - var(--a8-above) - 42px), 900px); }
}
@media (min-width: 768px) and (max-height: 800px) {
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-header { min-height: clamp(400px, calc(100svh - var(--a8-above)), 900px); }
    body.wtr-race8:not(.wtr-h-page) main > .wtr-lp-raceline + section.wtr-a8.wtr-a8-header { min-height: clamp(400px, calc(100svh - var(--a8-above) - 42px), 900px); }
    body.wtr-race8.wtr-race-live main .wtr-a8-header h1 { font-size: clamp(68px, min(10vw, 11.5vh), 120px) !important; }
    body.wtr-race8.wtr-race-live .wtr-a8-header-copy { padding-top: 14px; padding-bottom: 18px; }
    body.wtr-race8.wtr-race-live .wtr-a8 .wtr-a8-facts { margin-top: 16px; }
}

/* ---------- 276.75: review of the 4K laptop and S23 screenshots (Barry, 18 Nov) ---------- */
/* Phones: the swipe rows (crew cards, class cards) snapped their first card to the screen edge;
   the snap now allows for the side space, so the first card lines up with the text. */
@media (max-width: 767px) {
    .wtr-a8-crews-row,
    .wtr-a8 .wtr-a8-classcards { scroll-padding-inline: var(--a8-g); }
}
/* Big lines and card lines break evenly, so no word is left alone on a line ("EARTH", "TIME"). */
.wtr-a8 :is(h2, .wtr-a8-closing, .wtr-a8-crew-quote, .wtr-a8-ocean-route, .wtr-a8-ocean-facts) { text-wrap: balance; }
/* The small label over the full-screen photo stays readable on a light sky. */
.wtr-a8-full-head .wtr-a8-label { text-shadow: 0 1px 10px rgba(0, 0, 0, .7); }
/* Laptops: tighter gaps between sections (some read as 230-280px on a 4K screen). */
@media (min-width: 768px) {
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-crews { padding-top: 84px !important; padding-bottom: 84px !important; }
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-road { padding-top: 84px !important; padding-bottom: 96px !important; }
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-ready { padding-bottom: 84px !important; }
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-oceans { padding-top: 64px !important; padding-bottom: 80px !important; }
    .wtr-a8-band-body { padding-bottom: 84px; }
    .wtr-a8-full-body { padding-bottom: 90px; }
}
/* Phones: a little tighter too, a darker foot behind the ocean cards' words (the white flare smoke
   in the Atlantic card), and the band's label clear of the photo. */
@media (max-width: 767px) {
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-crews { padding-top: 52px !important; padding-bottom: 48px !important; }
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-road { padding-top: 52px !important; padding-bottom: 52px !important; }
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-ready { padding-bottom: 52px !important; }
    body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-oceans { padding-top: 44px !important; padding-bottom: 52px !important; }
    .wtr-a8-ocean::after { background: linear-gradient(0deg, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .8) 34%, rgba(0, 0, 0, .3) 62%, rgba(0, 0, 0, 0) 80%); }
    .wtr-a8-band-body { margin-top: 0; } /* 276.82: below the photo on black (was -20px) */
}
/* Narrow phones (360px and less): the big line over the full-screen photo shrinks a little so
   "ATLANTIC IS SIMPLE" still fits on one line (46px from 384px wide, as on the S23). */
@media (max-width: 767px) {
    body.wtr-race8 main .wtr-a8-chapter.is-photo-full h2 { font-size: min(46px, 12vw) !important; }
}
/* The ocean cards' facts break only between facts, never inside one ("30–55 days" stays together). */
.wtr-a8 .wtr-a8-keep { white-space: nowrap; }

/* ---------- Class card photos: WTR Crisp, like every photo (276.83) ---------- */
.wtr-a8-classcard-photo img { filter: var(--wtr-crisp); }

/* ======================================================================
 * 276.88: the Indian Ocean page (Carsten, 19 Nov): the race-page design with gold (#E8BE6E) as the Indian
 * accent, for small labels only; buttons stay blue. The big questions on near-black with the headline on
 * the left and the questions on the right; the Apply to row form in a panel over the page.
 * ====================================================================== */
body.wtr-indian-page { --wtr-indian-gold: #e8be6e; }
body.wtr-indian-page main .wtr-a8-label,
body.wtr-indian-page .wtr-apply .wtr-a8-label { color: var(--wtr-indian-gold) !important; }
body.wtr-indian-page main .wtr-a8-facts :is(dd, small, .wtr-a8-fact-label, span:not(:first-child)) { color: var(--wtr-indian-gold) !important; }
body.wtr-race8.wtr-indian-page:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-questions.has-no-photo { display: block; padding: clamp(72px, 8vw, 110px) 0 !important; background: #0d0d0d !important; }
body.wtr-indian-page .wtr-a8-questions.has-no-photo .wtr-a8-questions-copy {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 64px;
    align-items: start;
    max-width: none;
    width: min(calc(100% - var(--a8-g, 64px) * 2), var(--wtr-chrome-rail, 1360px));
    margin: 0 auto;
    padding: 0;
}
body.wtr-indian-page .wtr-a8-questions.has-no-photo .wtr-a8-questions-copy > h2 { margin: 0; }
@media (max-width: 899px) {
    body.wtr-indian-page .wtr-a8-questions.has-no-photo .wtr-a8-questions-copy { display: block; }
    body.wtr-indian-page .wtr-a8-questions.has-no-photo .wtr-a8-questions-copy > h2 { margin-bottom: 24px; }
}
/* The Apply to row form: closed until a link to #apply opens it (with or without scripts) */
.wtr-apply { position: fixed; inset: 0; z-index: 2147483000; /* above the cookie banner, so the form can always be sent */ display: none; align-items: center; justify-content: center; padding: 24px; }
.wtr-apply.is-open, .wtr-apply:target { display: flex; }
.wtr-apply-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .82); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.wtr-apply-panel { position: relative; width: min(640px, 100%); max-height: calc(100svh - 48px); overflow: auto; padding: 40px; border: 1px solid #262626; border-radius: 14px; background: #161616; color: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.wtr-apply-panel h2 { margin: 0 0 12px; color: #fff !important; font: 400 clamp(36px, 4vw, 52px)/1 var(--wtr-font-display, Anton, sans-serif); text-transform: uppercase; }
.wtr-apply-lead { margin: 0 0 24px; color: rgba(255, 255, 255, .85); font-size: 17px; line-height: 1.55; }
.wtr-apply-close { position: absolute; top: 14px; right: 16px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 26px; line-height: 1; text-decoration: none; }
.wtr-apply-close:hover, .wtr-apply-close:focus-visible { background: #262626; }
html.wtr-apply-open { overflow: hidden; }
@media (max-width: 600px) { .wtr-apply { padding: 0; align-items: stretch; } .wtr-apply-panel { max-height: 100svh; border-radius: 0; padding: 32px 20px; } }
/* 276.89: a small label above the Ready to row headline (the Indian page) keeps the label style, not the body text's */
body.wtr-race8 main .wtr-a8 .wtr-a8-ready-copy p.wtr-a8-label { max-width: none; margin: 0 0 14px; font-size: 12px; line-height: 1.3; }
body.wtr-indian-page.wtr-race8 main .wtr-a8 .wtr-a8-ready-copy p.wtr-a8-label { color: var(--wtr-indian-gold, #e8be6e) !important; }

/* 278.6 (Carsten's doc, 20 Nov late: "use the same tighter spacing on the other new pages too"): laptops get about 56px
 * above and below the lower sections on the Atlantic, Pacific and Indian pages (were 64-110px), and under the words
 * below the wide photo bands. The headers and the photo chapters keep their size; phones stay as they were. */
@media (min-width: 1024px) {
    html body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8:is(.wtr-a8-crews, .wtr-a8-road, .wtr-a8-questions, .wtr-a8-oceans) { padding-top: 56px !important; padding-bottom: 56px !important; }
    html body.wtr-race8:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-ready { padding-bottom: 56px !important; }
    html body.wtr-race8.wtr-indian-page:not(.wtr-h-page) main > section.wtr-a8.wtr-a8-questions.has-no-photo { padding: 56px 0 !important; }
    .wtr-a8-band-body, .wtr-a8-full-body { padding-bottom: 56px; }
}

/* 278.9 (Carsten, 22 Nov): the class cards open Find Your Boat with their crew size chosen; FIND YOUR BOAT → under them */
.wtr-a8 .wtr-a8-classcard-link { display: block; color: inherit; text-decoration: none; }
.wtr-a8 .wtr-a8-classcard-link .wtr-a8-classcard-photo { transition: opacity .2s; }
.wtr-a8 .wtr-a8-classcard-link:hover .wtr-a8-classcard-photo { opacity: .85; }
.wtr-a8 .wtr-a8-classcard-link:hover .wtr-a8-classcard-label { color: var(--wtr-c-accent, #62d0f5); }
.wtr-a8 .wtr-a8-classcard-link:focus-visible { outline: 2px solid var(--wtr-c-accent, #62d0f5); outline-offset: 4px; border-radius: 6px; }
.wtr-a8 .wtr-a8-way-link { margin: 28px 0 0; }
.wtr-a8 .wtr-a8-way-link a { font: 800 13px/1.3 var(--wtr-font-body, Inter, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--wtr-c-accent, #62d0f5); text-decoration: none; }
.wtr-a8 .wtr-a8-way-link a:hover { color: #fff; }

/* ======================================================================
 * 280.67: Carsten's Atlantic notes (26 Nov). Also the Pacific and Indian pages (same design).
 * ====================================================================== */
/* Chapter photos (LA GOMERA, THE CROSSING, ANTIGUA): soft top and bottom on laptops, on top of the side fade */
@media (min-width: 768px) {
    section.wtr-a8-chapter.is-photo-left .wtr-a8-chapter-media {
        -webkit-mask-image: linear-gradient(270deg, transparent 0%, rgba(0, 0, 0, .5) 8%, #000 18%), linear-gradient(180deg, transparent 0, #000 16%, #000 84%, transparent 100%) !important;
        -webkit-mask-composite: source-in !important;
        mask-image: linear-gradient(270deg, transparent 0%, rgba(0, 0, 0, .5) 8%, #000 18%), linear-gradient(180deg, transparent 0, #000 16%, #000 84%, transparent 100%) !important;
        mask-composite: intersect !important;
    }
    section.wtr-a8-chapter.is-photo-right .wtr-a8-chapter-media {
        -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .5) 8%, #000 18%), linear-gradient(180deg, transparent 0, #000 16%, #000 84%, transparent 100%) !important;
        -webkit-mask-composite: source-in !important;
        mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .5) 8%, #000 18%), linear-gradient(180deg, transparent 0, #000 16%, #000 84%, transparent 100%) !important;
        mask-composite: intersect !important;
    }
    section.wtr-a8-chapter.is-photo-full .wtr-a8-chapter-media {
        -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 70%, transparent 100%) !important;
        mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 70%, transparent 100%) !important;
    }
    section.wtr-a8-chapter.is-photo-band .wtr-a8-chapter-media {
        -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 55%, transparent 100%) !important;
        mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 55%, transparent 100%) !important;
    }
    section.wtr-a8-chapter.is-photo-band.is-fade-short .wtr-a8-chapter-media {
        -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 76%, transparent 100%) !important;
        mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 76%, transparent 100%) !important;
    }
    /* THE BIG QUESTIONS: the photo runs 100px past the section, so the fades start beyond that (on screen, not clipped) */
    .wtr-a8-questions-media {
        -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent 100%), linear-gradient(180deg, transparent 0, transparent 100px, #000 240px, #000 calc(100% - 240px), transparent calc(100% - 100px)) !important;
        -webkit-mask-composite: source-in !important;
        mask-image: linear-gradient(90deg, #000 55%, transparent 100%), linear-gradient(180deg, transparent 0, transparent 100px, #000 240px, #000 calc(100% - 240px), transparent calc(100% - 100px)) !important;
        mask-composite: intersect !important;
    }
    /* READY TO ROW THE ATLANTIC?: a soft top */
    .wtr-a8-ready-media {
        -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 62%, transparent 100%) !important;
        mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 62%, transparent 100%) !important;
    }
}
/* Phones: a soft top on the chapter, questions and ready photos (their fades into the text below stay) */
@media (max-width: 767px) {
    section.wtr-a8-chapter .wtr-a8-chapter-media {
        -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 55%, transparent 100%) !important;
        mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 55%, transparent 100%) !important;
    }
    section.wtr-a8-chapter.is-fade-short .wtr-a8-chapter-media {
        -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 72%, transparent 100%) !important;
        mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 72%, transparent 100%) !important;
    }
    section.wtr-a8-chapter.is-fade-tall .wtr-a8-chapter-media {
        -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 52%, transparent 80%) !important;
        mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 52%, transparent 80%) !important;
    }
    .wtr-a8-questions-media {
        -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 70%, transparent 100%) !important;
        mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 70%, transparent 100%) !important;
    }
    .wtr-a8-ready-media {
        -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 55%, transparent 100%) !important;
        mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 55%, transparent 100%) !important;
    }
}
/* BEYOND THE ATLANTIC and THEY WENT BEFORE YOU: Home's own card blocks, fitted into the race-page sections */
.wtr-a8-home-races .wtr-h-races, .wtr-a8-home-races .wtr-h-band { padding: 0 !important; background: none !important; }
.wtr-a8-home-races .wtr-h-wrap, .wtr-a8-home-stories .wtr-h-wrap { width: auto; max-width: none; padding: 0; margin: 0; }
.wtr-a8-home-races { margin-top: 18px; }
/* 280.69: Home's card fills its half of the row, as tall as the Indian card beside it */
.wtr-a8-ocean-grid.has-home-card { align-items: stretch; }
.wtr-a8-ocean-grid.has-home-card > .wtr-a8-home-races { margin: 0; display: flex; }
.wtr-a8-home-races > .wtr-h-races { flex: 1; display: flex; }
.wtr-a8-home-races .wtr-h-wrap { flex: 1; display: flex; }
.wtr-a8-home-races .wtr-h-race-grid { flex: 1; grid-template-columns: minmax(0, 1fr) !important; }
.wtr-a8-home-races .wtr-h-race { height: 100%; }
.wtr-a8-home-stories { margin-top: 8px; }

/* 280.76 (Carsten, Indian page on phones): ROW THE / INDIAN OCEAN on two lines, the size stepping down so INDIAN OCEAN
   always fits (it broke into three on a 390px phone). INDIAN OCEAN is about 5.08 times the size wide; 20px each side. */
@media (max-width: 767px) {
    body.wtr-race8.page-template-page-templates-template-indian main .wtr-a8-header h1 { font-size: min(72px, calc((100vw - 48px) / 5.2)) !important; }
}
