
/*
 * Homepage lead and editorial refinements
 *
 * Preserve established colors, typography,
 * homepage media, sticky behavior and layout.
 */

/* Lead panel */

.home-lead {
    padding-top: var(--space-2);
    padding-bottom: var(--space-7);
    background: var(--color-surface-primary);
}

.home-lead__layout {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--space-5);
    row-gap: var(--space-6);
    align-items: center;
}

/* Intro */

.home-lead__intro {
    grid-column: 1 / 8;
    grid-row: 1;
    max-width: 42rem;
}

.home-lead__eyebrow {
    display: none;
}

/*
 * Large campaign headline.
 *
 * Explicit newlines are preserved.
 * The solid offset shadow follows the
 * active theme's action color.
 */

.home-lead__heading {
    max-width: 100%;
    margin: 0;

    color: var(--color-text-primary);

    font-family: var(--font-display);
    font-size: clamp(3.5rem, 5.5vw, 6rem);
    font-weight: var(--font-display-weight);

    line-height: 1.05;
    letter-spacing: -0.025em;

    white-space: pre-line;

    text-shadow:
        0.055em 0.055em 0 var(--color-action);
}

.home-lead__body {
    max-width: 36rem;
    margin: var(--space-5) 0 0;

    color: var(--color-text-secondary);
    font-size: 1.05rem;
    line-height: 1.65;
}

/*
 * Compact signup panel
 *
 * Row 1: First name / Last name
 * Row 2: Email
 * Row 3: ZIP / Sign Up
 */

.home-lead__signup {
    grid-column: 8 / -1;
    grid-row: 1;

    min-width: 0;
    width: 100%;

    padding: 0.85rem 1rem;

    border: 2px solid var(--color-surface-contrast);
    background: var(--color-surface-primary);
}

.home-lead__signup .signup-form__fields {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    column-gap: 0.75rem;
    row-gap: 0.65rem;

    align-items: end;
}

.home-lead__signup .form-field {
    min-width: 0;
    gap: 0.2rem;
}

.home-lead__signup .form-field__label {
    margin: 0;

    font-size: 0.69rem;
    line-height: 1.2;
    letter-spacing: 0.055em;
}

.home-lead__signup .form-field__input {
    min-height: 2.7rem;

    padding: 0.55rem 0.75rem;

    font-size: 0.9rem;
    line-height: 1.3;
}

.home-lead__signup .signup-form__fields
> .form-field--first-name {
    grid-column: 1;
}

.home-lead__signup .signup-form__fields
> .form-field--last-name {
    grid-column: 2;
}

.home-lead__signup .signup-form__fields
> .form-field--email {
    grid-column: 1 / -1;
}

.home-lead__signup .signup-form__fields
> .form-field--zip {
    grid-column: 1;
}

.home-lead__signup .signup-form__button {
    grid-column: 2;

    width: 100%;
    min-width: 0;
    min-height: 2.7rem;

    gap: var(--space-2);
    padding-inline: 0.75rem;

    font-size: 0.78rem;
    line-height: 1.2;
}

.home-lead__signup .signup-form__note {
    margin-top: 0.65rem;

    font-size: 0.69rem;
    line-height: 1.4;
}

/* Campaign media */

.home-lead__photo {
    grid-column: 1 / 10;
    grid-row: 2;

    width: 100%;
    min-width: 0;

    align-self: stretch;

    aspect-ratio: 16 / 9;
    margin: 0;
}

.home-lead__photo img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;
}

.home-lead__video {
    grid-column: 10 / -1;
    grid-row: 2;

    align-self: stretch;

    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

/* Meet Joshua */

.page-home .home-story {
    padding-block: var(--space-9);
    background: var(--color-surface-accent);
    color: var(--color-text-on-accent);
}

.page-home .home-story__layout {
    display: grid;
    grid-template-columns:
        minmax(0, 0.88fr)
        minmax(0, 1.12fr);

    align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem);

    padding: 0;
    border: 0;
}

.page-home .home-story__photo {
    width: 100%;
    min-width: 0;
    max-height: none;

    margin: 0;
    overflow: hidden;

    aspect-ratio: 4 / 5;
}

.page-home .home-story__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-home .home-story__content {
    max-width: 40rem;
    padding: 0;
}

.page-home .home-story__eyebrow {
    display: none;
}

.page-home .home-story__heading {
    max-width: 20ch;
    margin: 0;

    color: var(--color-text-on-accent);
    font-size: var(--type-display-split);
    line-height: 1.13;
    letter-spacing: 0;
}

.page-home .home-story__copy {
    max-width: 37rem;
    margin-top: var(--space-5);

    color: var(--color-text-on-accent);
    font-size: 1.05rem;
    line-height: 1.7;
}

.page-home .home-story__actions {
    margin-top: var(--space-6);
}

/* Contrasting action buttons */

.page-home .home-story__link:first-child {
    background: var(--color-surface-contrast);
    border-color: var(--color-surface-contrast);
    color: var(--color-text-on-contrast);
}

.page-home .home-story__link:nth-child(2) {
    background: var(--color-surface-primary);
    border-color: var(--color-surface-contrast);
    color: var(--color-text-primary);
}

.page-home .home-story__link:first-child:hover,
.page-home .home-story__link:first-child:focus-visible {
    background: var(--color-surface-contrast-hover);
    border-color: var(--color-surface-contrast-hover);
    color: var(--color-text-on-contrast);
}

.page-home .home-story__link:nth-child(2):hover,
.page-home .home-story__link:nth-child(2):focus-visible {
    background: var(--color-surface-contrast);
    color: var(--color-text-on-contrast);
}

/* Homepage typography */

.page-home .home-record__heading,
.page-home .home-priorities__heading,
.page-home .section-heading__title,
.page-home .signup-band__heading,
.page-home .donation-band__heading,
.page-home .home-support__heading {
    letter-spacing: 0;
    line-height: 1.13;
}

.page-home .home-record__heading,
.page-home .home-priorities__heading {
    max-width: 20ch;
}

.page-home .home-priorities__item {
    letter-spacing: 0.01em;
}

/* Preserve sticky homepage lead behavior */

@media (min-width: 64.0625rem) and (min-height: 44rem) {
    .page-home .home-lead {
        position: sticky;

        top: var(
            --home-lead-sticky-top,
            var(--site-header-height, 4.5rem)
        );

        z-index: var(--layer-raised);
        isolation: isolate;

        scroll-margin-top:
            calc(
                var(--site-header-height, 4.5rem)
                + var(--space-4)
            );
    }

    .page-home .home-story {
        padding-block: var(--space-7);
    }

    .page-home .home-story__photo {
        max-height:
            min(
                31rem,
                calc(
                    100dvh
                    - var(--site-header-height, 4.5rem)
                    - 9rem
                )
            );
    }
}

/*
 * Desktop optical alignment.
 *
 * The grid already centers the content boxes.
 * Shift the signup down to match the visible
 * center of the large headline and paragraph.
 *
 * Do not apply to the stacked mobile layout.
 */

@media (min-width: 64.0625rem) {
    .home-lead__signup {
        transform: translateY(var(--space-6));
    }
}

/* Tablet */

@media (max-width: 64rem) {
    .home-lead__layout {
        column-gap: var(--space-4);
    }

    .home-lead__intro {
        grid-column: 1 / 7;
    }

    .home-lead__signup {
        grid-column: 7 / -1;
    }

    .home-lead__heading {
        font-size: clamp(3rem, 5vw, 4.4rem);
    }
}

@media (max-width: 58rem) {
    .home-lead__layout {
        grid-template-columns: 1fr;
        row-gap: var(--space-5);
    }

    .home-lead__intro,
    .home-lead__photo,
    .home-lead__signup,
    .home-lead__video {
        grid-column: 1;
    }

    .home-lead__intro {
        grid-row: 1;
    }

    .home-lead__photo {
        grid-row: 2;
    }

    .home-lead__signup {
        grid-row: 3;
        max-width: 38rem;
    }

    .home-lead__video {
        grid-row: 4;

        height: auto;
        min-height: 0;
        aspect-ratio: 4 / 5;
    }

    .home-lead__heading {
        font-size: clamp(3rem, 8vw, 5.25rem);
    }

    .page-home .home-story__layout {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .page-home .home-story__photo {
        width: min(100%, 32rem);
    }

    .page-home .home-story__content {
        max-width: 44rem;
    }
}

/* Mobile */

@media (max-width: 48rem) {
    .home-lead {
        padding-top: var(--space-2);
        padding-bottom: var(--space-6);
    }

    .home-lead__heading {
        font-size: clamp(2.4rem, 11vw, 3.5rem);
        line-height: 1.03;
    }

    .home-lead__signup {
        padding: 0.85rem;
    }

    .page-home .home-story {
        padding-block: var(--space-8);
    }

    .page-home .home-story__photo {
        width: 100%;
    }

    .page-home .home-story__heading {
        font-size: clamp(2.1rem, 8vw, 3rem);
    }
}

@media (max-width: 36rem) {
    .home-lead__signup .signup-form__fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-lead__signup .signup-form__fields
    > .form-field,
    .home-lead__signup .signup-form__button {
        grid-column: 1;
    }

    .page-home .home-story__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-home .home-story__link {
        width: 100%;
    }
}

/* Very narrow phones */

@media (max-width: 22rem) {
    .home-lead__heading {
        font-size: clamp(1.95rem, 8.7vw, 2.3rem);
    }
}
