/**
 * Page composition for /news.
 * The document shell, breadcrumbs and hero are owned by
 * layout/internal-page-shell.css; the hero card is owned by
 * components/editorial-summary-card.css.
 */

body[data-page="news"] {
    --news-accent: var(--color-accent);
    --news-ink: var(--color-text-primary);
    --news-muted: var(--color-text-muted);
    --internal-page-noise-opacity: 0;
}

.news-page__content {
    padding-block: clamp(1.5rem, 2.4vw, 2rem) clamp(2rem, 5vw, 4rem);
}

.news-empty > .news-page__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    border-radius: 0.9rem;
    background: rgba(8, 125, 150, 0.1);
    color: var(--news-accent);
}

.news-page__icon svg {
    width: 1.45rem;
    height: 1.45rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.news-catalog__header {
    max-width: 48rem;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.news-catalog__header h2 {
    margin: 0;
    color: var(--news-ink);
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.news-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(0.9rem, 1.8vw, 1.25rem);
}

.news-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
    isolation: isolate;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.news-grid > .news-card:first-child {
    border-color: color-mix(in srgb, var(--news-accent) 28%, var(--color-border));
    background:
        linear-gradient(135deg, var(--color-bg-card-strong), var(--color-accent-wash));
    box-shadow:
        inset 0.25rem 0 0 var(--news-accent),
        var(--shadow-card);
}

.news-card:hover,
.news-card:focus-within {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--news-accent) 35%, var(--color-border));
    box-shadow: var(--shadow-card-lg);
}

.news-card--with-media {
    grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr);
}

.news-card__media {
    display: block;
    margin: 0;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--color-accent-light);
}

.news-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 260ms ease;
}

.news-card:hover .news-card__media img {
    transform: scale(1.025);
}

.news-card__body {
    display: grid;
    grid-template-columns: minmax(8.75rem, 10rem) minmax(0, 1fr) 3rem;
    grid-template-areas:
        "date title action"
        "date excerpt action";
    align-items: center;
    gap: 0.7rem clamp(1.2rem, 2.4vw, 2rem);
    min-width: 0;
    padding: clamp(1.45rem, 2.4vw, 1.75rem);
}

.news-card--with-media .news-card__body {
    grid-template-columns: minmax(0, 1fr) 3rem;
    grid-template-areas:
        "date action"
        "title action"
        "excerpt action";
    align-content: center;
}

.news-card time {
    grid-area: date;
    align-self: stretch;
    display: flex;
    align-items: flex-start;
    padding-right: clamp(1rem, 2vw, 1.5rem);
    border-right: 1px solid var(--color-border-strong);
    color: var(--news-accent);
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
}

.news-card--with-media time {
    align-self: auto;
    padding-right: 0;
    border-right: 0;
}

.news-card h3 {
    grid-area: title;
    margin: 0;
    color: var(--news-ink);
    font-size: clamp(1.25rem, 1.7vw, 1.55rem);
    line-height: 1.22;
    text-wrap: balance;
}

.news-card__title-link {
    color: inherit;
    text-decoration: none;
}

.news-card__title-link::after {
    content: '';
    position: absolute;
    z-index: 2;
    inset: 0;
    border-radius: var(--radius-lg);
}

.news-card:hover .news-card__title-link {
    color: var(--color-accent-hover);
}

.news-card__body > p {
    grid-area: excerpt;
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--news-muted);
    font-size: 0.98rem;
    line-height: 1.62;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.news-card__action {
    grid-area: action;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--color-border-icon-soft);
    border-radius: var(--radius-full);
    background: var(--color-accent-light);
    color: var(--news-accent);
    box-shadow: var(--shadow-icon-soft);
    transition:
        transform 180ms ease,
        background-color 180ms ease,
        color 180ms ease;
}

.news-card__action svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.news-card:hover .news-card__action,
.news-card:focus-within .news-card__action {
    transform: translateX(0.2rem);
    background: var(--news-accent);
    color: var(--color-text-inverse);
}

.news-card__title-link:focus-visible {
    outline: none;
}

.news-card__title-link:focus-visible::after {
    outline: 3px solid var(--color-accent-strong);
    outline-offset: -4px;
}

.news-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--news-accent);
    font-weight: 800;
    text-decoration: none;
    transition: color 180ms ease;
}

.news-link:hover {
    color: var(--color-accent-hover);
}

.news-link svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
    transition: transform 180ms ease;
}

.news-link:hover svg {
    transform: translateX(0.2rem);
}

.news-link--back {
    margin: 0 0 clamp(1.4rem, 3vw, 2.4rem);
}

.news-link--back:hover svg {
    transform: translateX(-0.2rem);
}

.news-detail {
    width: 100%;
}

.news-article {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(1.4rem, 4vw, 3.3rem);
    overflow: hidden;
    border-top: 0.25rem solid var(--news-accent);
}

.news-article__media {
    max-width: min(100%, 72ch);
    margin: 0 auto clamp(1.6rem, 4vw, 3rem);
    overflow: hidden;
    border-radius: clamp(0.9rem, 2vw, 1.4rem);
    background: var(--color-accent-light);
}

.news-article__media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 38rem;
    object-fit: cover;
}

.news-article__body {
    width: 100%;
    max-width: min(100%, 72ch);
    margin-inline: auto;
    color: var(--color-text-body);
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    line-height: 1.8;
}

.news-article__body > :first-child {
    margin-top: 0;
}

.news-article__body > :last-child {
    margin-bottom: 0;
}

.news-article__body > p:first-child {
    color: var(--news-ink);
    font-size: 1.04em;
}

.news-article__body h2,
.news-article__body h3 {
    margin: 2em 0 0.7em;
    color: var(--news-ink);
    line-height: 1.2;
}

.news-article__body p,
.news-article__body ul,
.news-article__body ol,
.news-article__body blockquote,
.news-article__body pre {
    margin-block: 1.15em;
}

.news-article__body li + li {
    margin-top: 0.45em;
}

.news-article__body ul,
.news-article__body ol {
    padding-inline-start: 1.45em;
}

.news-article__body ul {
    list-style: disc outside;
}

.news-article__body ol {
    list-style: decimal outside;
}

.news-article__body li {
    list-style: inherit;
    padding-inline-start: 0.25em;
}

.news-article__body li::marker {
    color: var(--news-accent);
    font-weight: 800;
}

.news-article__body a {
    color: var(--news-accent);
    text-underline-offset: 0.16em;
}

.news-article__body a:hover {
    color: var(--color-accent-hover);
}

.news-article__body blockquote {
    margin-inline: 0;
    padding: 0.9rem 1.2rem;
    border-left: 0.25rem solid var(--news-accent);
    background: rgba(8, 125, 150, 0.07);
}

.news-article__body pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 1rem;
    border-radius: 0.75rem;
    background: #102836;
    color: #f4fbfd;
}

.news-empty {
    display: grid;
    justify-items: start;
    max-width: 48rem;
    margin-inline: auto;
    padding: clamp(1.5rem, 4vw, 2.8rem);
}

.news-empty .news-page__icon {
    margin-bottom: 1rem;
}

.news-empty h2 {
    margin: 0;
    color: var(--news-ink);
}

.news-empty p {
    margin: 0.8rem 0 1.5rem;
    color: var(--news-muted);
    line-height: 1.7;
}

html.a11y .news-card,
html.a11y .news-article,
html.a11y .news-empty {
    border-color: currentColor !important;
    background: var(--a11y-bg) !important;
    box-shadow: none !important;
}

html.a11y .news-card *,
html.a11y .news-article *,
html.a11y .news-empty * {
    color: inherit !important;
}

html.a11y .news-card__action {
    background: var(--color-bg-secondary) !important;
    border-color: currentColor !important;
    box-shadow: none !important;
}

html.a11y .news-article__body li::marker {
    color: currentColor !important;
}

html.a11y[data-images="off"] .news-card--with-media {
    grid-template-columns: minmax(0, 1fr);
}

html.a11y[data-images="off"] :is(.news-card__media, .news-article__media) {
    display: none !important;
}

html.a11y .news-catalog__header > p,
html.a11y .news-catalog__header h2 {
    color: inherit !important;
}

@media (prefers-reduced-motion: reduce) {
    .news-card,
    .news-card__media img,
    .news-card__action,
    .news-link,
    .news-link svg {
        transition: none;
    }

    .news-card:hover,
    .news-card:focus-within,
    .news-card:hover .news-card__action,
    .news-card:focus-within .news-card__action {
        transform: none;
    }
}

@media (max-width: 760px) {
    .news-page__content {
        padding-top: 1.15rem;
    }

    .news-page__nav {
        flex-wrap: nowrap;
        gap: 0.65rem;
        margin-inline: -1rem;
        padding: 0.15rem 1rem 0.55rem;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-padding-inline: 1rem;
        scrollbar-width: thin;
    }

    .news-page__pill {
        width: auto;
        min-height: 2.6rem;
        flex: 0 0 auto;
        padding: 0.65rem 1.05rem;
        white-space: nowrap;
    }

    .news-catalog__header {
        margin-bottom: 1.5rem;
    }

    .news-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .news-card__media {
        grid-column: 1;
        aspect-ratio: 16 / 9;
    }

    .news-card__body {
        grid-column: 1;
        grid-template-columns: minmax(0, 1fr) 2.6rem;
        grid-template-areas:
            "date action"
            "title title"
            "excerpt excerpt";
        gap: 0.75rem 1rem;
        padding: 1.25rem;
    }

    .news-card time,
    .news-card--with-media time {
        align-self: center;
        padding-right: 0;
        border-right: 0;
    }

    .news-card h3 {
        font-size: clamp(1.2rem, 6.2vw, 1.4rem);
    }

    .news-card__body > p {
        line-height: 1.58;
        -webkit-line-clamp: 3;
    }

    .news-card__action {
        width: 2.5rem;
        height: 2.5rem;
    }

    .news-article {
        padding: 1.25rem;
    }
}
