
/*
 * News page
 *
 * The archive shares the homepage's news-card
 * component and presentation styles.
 *
 * This file controls the archive layout and
 * the individual news article presentation.
 */


/*
 * News archive hero
 */

.page-news .hero--interior .hero__heading {
    max-width: 22ch;
}


/*
 * News archive grid
 */

.page-news .news-archive__grid {
    display: grid;

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

    gap: var(--space-5);

    width: 100%;
}


/*
 * Featured news article
 *
 * The first article spans the entire grid,
 * following the homepage's featured
 * image-and-text presentation.
 */

.page-news .news-archive__grid > .news-card:first-child {
    grid-column: 1 / -1;
}

.page-news
.news-archive__grid
> .news-card:first-child
.news-card__title {
    font-size: var(--type-display-card-featured);
}


/*
 * Desktop featured card
 */

@media (min-width: 48.01rem) {
    .page-news
    .news-archive__grid
    > .news-card:first-child
    .news-card__surface {
        display: grid;

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

        align-items: stretch;
    }

    .page-news
    .news-archive__grid
    > .news-card:first-child
    .news-card__media {
        min-height: 20rem;

        aspect-ratio: auto;

        margin-bottom: var(--space-5);
    }

    .page-news
    .news-archive__grid
    > .news-card:first-child
    .news-card__content {
        min-width: 0;
    }

    /*
     * Keep text-only featured articles usable.
     */

    .page-news
    .news-archive__grid
    > .news-card:first-child.news-card--no-media
    .news-card__surface {
        display: flex;
    }
}


/*
 * Archive pagination
 */

.page-news .news-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    gap: var(--space-4);

    margin-top: var(--space-7);

    padding-top: var(--space-5);

    border-top: 1px solid var(--color-border);

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

    font-weight: 700;
}

.page-news .news-pagination a {
    color: var(--color-text-primary);

    text-underline-offset: 0.2rem;
}

.page-news .news-pagination a:hover,
.page-news .news-pagination a:focus-visible {
    color: var(--color-link);
}


/*
 * Individual news articles
 *
 * Keep the centered editorial presentation
 * on each article's own page.
 */

.news-article {
    background: var(--color-surface-primary);
}

.news-article__header {
    padding-block:
        var(--space-9)
        var(--space-7);

    text-align: center;
}

.news-article__eyebrow {
    margin:
        0
        0
        var(--space-4);

    color: var(--color-link);

    font-size: 0.8rem;
    font-weight: 800;

    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.news-article__title {
    max-width: 21ch;

    margin: 0 auto;

    font-family: var(--font-display);
    font-size: clamp(2.4rem, 4.3vw, 3.9rem);
    font-weight: var(--font-display-weight);
    line-height: 1.12;

    letter-spacing: var(--font-display-tracking-tight);

    text-wrap: balance;
}

.news-article__summary {
    max-width: 43rem;

    margin:
        var(--space-5)
        auto
        0;

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

    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
    line-height: 1.6;

    text-wrap: pretty;
}

.news-article__date {
    margin:
        var(--space-5)
        0
        0;

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

    font-size: 0.9rem;
    font-weight: 700;
}

.news-article__figure {
    width: min(
        calc(100% - (var(--container-padding) * 2)),
        62rem
    );

    margin: 0 auto;
}

.news-article__image {
    display: block;

    width: 100%;
    height: auto;

    border-radius: var(--radius-sm);
}

.news-article__caption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;

    gap:
        var(--space-2)
        var(--space-4);

    margin-top: var(--space-3);

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

    font-size: 0.8rem;
    line-height: 1.5;
}

.news-article__credit {
    color: var(--color-text-secondary);

    font-size: 0.75rem;
    opacity: 0.8;
}

.news-article__body {
    padding-block:
        var(--space-8)
        var(--space-10);
}

.news-article__prose {
    max-width: 44rem;

    margin-inline: auto;

    font-size: 1.075rem;
}

.news-article__prose p {
    margin-bottom: var(--space-5);

    line-height: 1.85;
}


/*
 * Tablet
 */

@media (max-width: 64rem) {
    .page-news .news-archive__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


/*
 * Mobile cards
 */

@media (max-width: 48rem) {
    .page-news .news-archive__grid {
        grid-template-columns: minmax(0, 1fr);

        gap: var(--space-4);
    }

    .page-news
    .news-archive__grid
    > .news-card:first-child {
        grid-column: auto;
    }

    .page-news
    .news-archive__grid
    > .news-card:first-child
    .news-card__surface {
        display: flex;
        flex-direction: column;
    }

    .page-news
    .news-archive__grid
    > .news-card:first-child
    .news-card__media {
        min-height: 0;

        aspect-ratio: 16 / 10;

        margin-bottom: 0;
    }
}


/*
 * Small screens
 */

@media (max-width: 40rem) {
    .page-news .hero--interior .hero__heading {
        max-width: 13ch;
    }

    .page-news .news-pagination {
        margin-top: var(--space-6);
    }

    .news-article__header {
        padding-block:
            var(--space-7)
            var(--space-6);
    }

    .news-article__title {
        font-size: clamp(2.1rem, 9vw, 3rem);
        line-height: 1.15;
    }

    .news-article__summary {
        margin-top: var(--space-4);
    }

    .news-article__figure {
        width: 100%;
    }

    .news-article__image {
        border-radius: 0;
    }

    .news-article__caption {
        padding-inline: var(--container-padding);
    }

    .news-article__body {
        padding-block:
            var(--space-7)
            var(--space-9);
    }

    .news-article__prose {
        font-size: 1rem;
    }
}
