/* Home (front-page.php), loaded only on the front page. Every class is prefixed hv- so nothing
   collides with Matcha's utilities (.btn, .card, ...). Neutral sections use the theme's --bg, --fg and
   --surface tokens so the header's light/dark toggle keeps working. */

/* core.css sets overflow-x: hidden on html and body, which turns body into a scroll container and
   breaks the sticky stage of the opening; clip keeps the same look without that side effect. */
html,
body {
    overflow-x: clip;
}

.hv-wrap {
    width: min(1200px, 100% - 2 * clamp(16px, 4vw, 64px));
    margin-inline: auto;
}

.hv-center {
    text-align: center;
}

.hv-block {
    padding-block: clamp(80px, 9vw, 128px);
}

.hv-h2 {
    margin: 0;
    font-size: clamp(32px, 3.8vw, 54px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.hv-lead {
    max-width: 46ch;
    margin: 14px 0 0;
    font-size: 18px;
    line-height: 1.55;
}

.hv-center .hv-lead {
    margin-inline: auto;
}

.hv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 28px;
    border: 0;
    border-radius: 999px;
    font: 700 16px/1 "Open Sans", sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1), filter 180ms ease;
}

.hv-btn:active {
    transform: scale(0.97);
}

.hv-btn--yellow,
.hv-btn--yellow:hover {
    background: var(--yellow);
    color: var(--darkblue);
}

.hv-btn--dark,
.hv-btn--dark:hover {
    background: var(--darkblue);
    color: #ffffff;
}

.hv-btn:focus-visible,
.hv-arrows button:focus-visible,
.hv-slides__nav button:focus-visible,
.hv-film__toggle:focus-visible,
.hv-strip__item:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .hv-btn:hover {
        filter: brightness(1.07);
    }
}

/* Opening: the campaign carousel holds while the film grows in a circle over it. ----------- */

.hv-opening {
    position: relative;
    height: 320vh;
}

.hv-opening__stage {
    position: sticky;
    top: 0;
    height: 100svh;
    overflow: clip;
    background: #1c1c1c;
}

.hv-slides {
    position: absolute;
    inset: 0;
}

.hv-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 700ms ease, visibility 0s linear 700ms;
}

.hv-slide.is-current {
    opacity: 1;
    visibility: visible;
    transition: opacity 700ms ease;
}

.hv-slide__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hv-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
}

.hv-slide__text {
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    bottom: 16svh;
    color: #ffffff;
}

.hv-slide__kicker {
    display: inline-block;
    margin-bottom: 18px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--yellow);
    color: var(--darkblue);
    font-size: 14px;
    font-weight: 800;
}

.hv-slide__title {
    max-width: 22ch;
    margin: 0;
    color: #ffffff;
    font-size: clamp(34px, 4.4vw, 64px);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.hv-slide__lead {
    max-width: 46ch;
    margin: 18px 0 28px;
    font-size: 18px;
    line-height: 1.55;
}

.hv-slides__nav {
    position: absolute;
    z-index: 2;
    right: calc(clamp(16px, 4vw, 64px) + 72px); /* clear of the floating WhatsApp button */
    bottom: 6svh;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
}

.hv-slides__nav button {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    cursor: pointer;
}

.hv-slides__dots {
    display: flex;
    gap: 8px;
}

.hv-slides__dots span {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.55);
    transition: width 300ms ease, background-color 300ms ease;
}

.hv-slides__dots span.is-current {
    width: 28px;
    background: var(--yellow);
}

.hv-film {
    position: absolute;
    inset: 0;
    z-index: 3;
    clip-path: circle(0% at 50% 50%);
}

.hv-film video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hv-film__text {
    position: absolute;
    left: clamp(16px, 4vw, 64px);
    bottom: 8svh;
    max-width: 30ch;
    margin: 0;
    color: #ffffff;
    font-size: clamp(24px, 2.6vw, 40px);
    font-weight: 800;
    line-height: 1.4;
    opacity: 0;
}

.hv-film__text span {
    padding: 0.05em 0.25em;
    background: var(--darkblue);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.hv-film__toggle {
    position: absolute;
    right: calc(clamp(16px, 4vw, 64px) + 72px);
    bottom: 6svh;
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font: 600 14px/1 "Open Sans", sans-serif;
    cursor: pointer;
    opacity: 0;
}

/* Without the scroll scene (no script, reduced motion) the film is its own screen below the slides. */
.hv-opening:not(.is-live) {
    height: auto;
}

.hv-opening:not(.is-live) .hv-opening__stage {
    position: relative;
    height: auto;
}

.hv-opening:not(.is-live) .hv-slides {
    position: relative;
    height: 100svh;
}

.hv-opening:not(.is-live) .hv-film {
    position: relative;
    height: 100svh;
    clip-path: none;
}

.hv-opening:not(.is-live) .hv-film__text,
.hv-opening:not(.is-live) .hv-film__toggle {
    opacity: 1;
}

/* Programs: white cards on the yellow field. ---------------------------------------------------- */

.hv-impact {
    background: var(--yellow);
    color: var(--darkblue);
}

.hv-split {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 56px;
    align-items: start;
}

.hv-programs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hv-program {
    overflow: hidden;
    border-radius: 18px;
    background: #ffffff;
}

.hv-program img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.hv-program > div {
    display: grid;
    justify-items: start;
    gap: 8px;
    padding: 20px 22px 24px;
}

.hv-program h3 {
    margin: 0;
    color: var(--darkblue);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
}

.hv-program p {
    margin: 0;
    color: var(--darkblue);
    font-size: 16px;
    line-height: 1.5;
}

.hv-program a {
    color: var(--darkblue);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

/* Donation: the four portraits edge to edge. ------------------------------------------------- */

.hv-give {
    padding-top: clamp(80px, 9vw, 128px);
    background: var(--darkblue);
    color: #ffffff;
}

.hv-give .hv-center {
    margin-bottom: 48px;
}

.hv-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.hv-strip__item {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4.4;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}

.hv-strip__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hv-strip__plate {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    display: grid;
    gap: 4px;
    padding: 20px 22px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
}

.hv-strip__plate b {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
}

.hv-strip__plate small {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.hv-strip__plate em {
    margin-top: 6px;
    font-style: normal;
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.hv-strip__plate--sky { background: var(--lightblue); color: var(--darkblue); }
.hv-strip__plate--yellow { background: var(--yellow); color: var(--darkblue); }
.hv-strip__plate--tomato { background: var(--tomato); color: #1c1c1c; }
.hv-strip__plate--white { background: #ffffff; color: var(--darkblue); }
.hv-strip__plate--white b { font-size: 32px; }

@media (hover: hover) and (pointer: fine) {
    .hv-strip__item:hover {
        color: inherit;
    }

    .hv-strip__item:hover img {
        transform: scale(1.05);
    }
}

/* Results: counters on yellow. ------------------------------------------------------------------ */

.hv-results {
    background: var(--yellow);
    color: var(--darkblue);
}

.hv-counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 48px;
}

.hv-counters strong {
    display: block;
    font-size: clamp(48px, 5.4vw, 80px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.hv-counters span {
    display: block;
    margin-top: 12px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.45;
}

/* Testimonials: a carousel, turned into a helix by the scroll scene. ------------------------- */

.hv-voices {
    background: var(--lightblue);
    color: var(--darkblue);
}

.hv-voices__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
}

.hv-arrows {
    display: flex;
    gap: 10px;
}

.hv-arrows button {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: var(--darkblue);
    color: #ffffff;
    cursor: pointer;
}

.hv-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(420px, 85%);
    gap: 24px;
    margin-top: 40px;
    padding-bottom: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.hv-quote {
    display: grid;
    align-content: space-between;
    gap: 28px;
    padding: 36px 32px;
    border-radius: 16px;
    background: #ffffff;
    color: var(--darkblue);
    scroll-snap-align: start;
}

.hv-quote p {
    margin: 0;
    font-size: 18px;
    line-height: 1.6;
}

.hv-quote b {
    display: block;
    font-size: 18px;
}

.hv-quote small {
    color: #46677a;
    font-size: 15px;
}

.hv-voices.is-helix {
    display: grid;
    align-content: center;
    min-height: 100svh;
    padding-block: 96px 48px;
    overflow: hidden;
}

.hv-voices.is-helix .hv-arrows {
    display: none;
}

.hv-voices.is-helix .hv-track {
    position: relative;
    display: block;
    height: min(520px, 62svh);
    margin-top: 24px;
    overflow: visible;
    perspective: 1600px;
}

.hv-voices.is-helix .hv-quote {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(460px, 84vw);
    max-height: 100%;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 55, 85, 0.18);
    will-change: transform, opacity;
}

.hv-voices.is-helix .hv-quote p {
    font-size: 17px;
}

.hv-helix-count {
    margin: 12px 0 0;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

/* Godparent programme. -------------------------------------------------------------------------- */

.hv-godparent {
    background-position: center;
    background-size: cover;
}

.hv-godparent__panel {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: end;
    overflow: hidden;
    border-radius: 20px;
    background: var(--surface);
    color: var(--fg);
}

.hv-godparent__panel > div {
    padding: 48px;
}

.hv-godparent__logo {
    width: min(440px, 100%);
    height: auto;
    margin: -24px 0 12px -16px;
}

.hv-godparent__panel p {
    max-width: 46ch;
    margin: 20px 0 28px;
    font-size: 18px;
    line-height: 1.6;
}

.hv-godparent__photo {
    width: 100%;
    height: auto;
}

/* News. ----------------------------------------------------------------------------------------- */

.hv-news {
    background: var(--bg);
    color: var(--fg);
}

.hv-news__featured {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    overflow: hidden;
    margin-top: 48px;
    border-radius: 18px;
    background: var(--surface);
}

.hv-news__featured img {
    width: 100%;
    height: 100%;
    min-height: 380px;
    object-fit: cover;
}

.hv-news__featured > div {
    display: grid;
    align-content: space-between;
    gap: 24px;
    padding: 40px;
}

.hv-news__featured h3 {
    margin: 14px 0 0;
    font-size: clamp(24px, 2.4vw, 30px);
    font-weight: 800;
    line-height: 1.2;
}

.hv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    opacity: 0.8;
}

.hv-news__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.hv-news__card {
    overflow: hidden;
    border-radius: 18px;
    background: var(--surface);
}

.hv-news__card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.hv-news__card > div {
    display: grid;
    gap: 12px;
    padding: 22px 24px 26px;
}

.hv-news__card h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
}

.hv-read {
    justify-self: start;
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

/* Partners: each card takes the colour set in the admin. --------------------------------------- */

.hv-partners {
    background: var(--surface);
    color: var(--fg);
}

.hv-logos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin: 48px 0 40px;
    padding: 0;
    list-style: none;
}

.hv-logos li {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 18px;
    border-radius: 18px;
    background: var(--bg);
    box-shadow: inset 0 0 0 1px rgba(0, 55, 85, 0.1);
}

.hv-logos a {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

.hv-logos img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Newsletter. ----------------------------------------------------------------------------------- */

.hv-newsletter {
    background: var(--darkblue);
    color: #ffffff;
}

.hv-newsletter__form {
    max-width: 640px;
    margin: 32px auto 0;
}

.hv-newsletter__off {
    margin: 0;
    font-size: 16px;
    opacity: 0.85;
}

/* Phones and tablets. --------------------------------------------------------------------------- */

@media (max-width: 899px) {
    .hv-split,
    .hv-godparent__panel,
    .hv-news__featured {
        grid-template-columns: 1fr;
    }

    .hv-programs,
    .hv-news__grid,
    .hv-counters {
        grid-template-columns: 1fr;
    }

    .hv-strip {
        grid-template-columns: 1fr 1fr;
    }

    .hv-godparent__panel > div {
        padding: 32px 24px;
    }

    .hv-news__featured img {
        min-height: 240px;
    }

    .hv-slide__text {
        bottom: 14svh;
    }

    .hv-slides__nav {
        right: auto;
        left: clamp(16px, 4vw, 64px);
    }
}

@media (max-width: 520px) {
    .hv-strip {
        grid-template-columns: 1fr;
    }

    .hv-strip__item {
        aspect-ratio: 4 / 5;
    }
}
