/* News index and article pages, plus the news section that the */
/* project detail page reuses. Depends on the custom properties  */
/* declared in core/css/style.css.                               */

.news-index {
    padding: 90px 0 110px;
}

.news-index-header {
    max-width: 940px;
    margin-bottom: 60px;
}

.news-index-header h1 {
    margin: 16px 0 24px;
    font-size: clamp(48px, 7vw, 88px);
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -4px;
}

.news-index-header > p:last-child {
    max-width: 680px;
    margin: 0;
    color: var(--muted-color);
    font-size: 19px;
}

/* Cards */

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.news-card {
    height: 100%;
    overflow: hidden;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    transition:
        transform 220ms ease,
        box-shadow 220ms ease,
        border-color 220ms ease;
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-gold);
    box-shadow: 0 18px 40px rgba(23, 26, 41, 0.10);
}

.news-card-link {
    height: 100%;
    display: flex;
    flex-direction: column;
    color: inherit;
}

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

.news-card-media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.news-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stand-in for articles published without a cover image, so the */
/* grid keeps its rhythm instead of collapsing to a text block.  */
.news-card-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: var(--dark-surface);
}

.news-card-placeholder-mark {
    width: 42%;
    max-width: 180px;
    height: auto;
    opacity: 0.65;
}

.news-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 26px;
}

.news-card-meta {
    margin: 0 0 10px;
    color: var(--accent-color);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.news-card-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.25;
}

.news-card-summary {
    margin: 14px 0 0;
    color: var(--muted-color);
}

.news-card-action {
    margin-top: auto;
    padding-top: 22px;
    color: var(--accent-color);
    font-weight: 700;
}

.news-empty {
    grid-column: 1 / -1;
    min-height: 240px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 40px;
    color: var(--muted-color);
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: 18px;
}

/* Pagination */

.news-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.news-pagination-status {
    margin: 0;
    color: var(--muted-color);
    font-size: 15px;
}

.news-pagination-link {
    padding: 10px 20px;
    color: var(--accent-color);
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    transition:
        border-color 220ms ease,
        background 220ms ease;
}

.news-pagination-link:hover {
    background: var(--card-background);
    border-color: var(--brand-gold);
}

.news-pagination-link:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Breadcrumb */

.news-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    color: var(--muted-color);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

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

.news-breadcrumb a:hover {
    text-decoration: underline;
}

/* Article page */

.news-article {
    padding: 70px 0 110px;
}

.news-article-header {
    max-width: 800px;
}

.news-article-meta {
    margin: 0 0 14px;
    color: var(--accent-color);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.news-article-title {
    margin: 0;
    font-size: clamp(36px, 5.5vw, 64px);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -2px;
}

.news-article-summary {
    margin: 24px 0 0;
    color: var(--muted-color);
    font-size: 20px;
    line-height: 1.6;
}

.news-article-cover {
    margin: 48px 0 0;
    overflow: hidden;
    border-radius: 18px;
}

.news-article-cover img {
    width: 100%;
    height: auto;
}

.news-article-body {
    max-width: 720px;
    margin-top: 48px;
    font-size: 18px;
    line-height: 1.8;
}

.news-article-body p {
    margin: 0 0 20px;
}

.news-article-body p:last-child {
    margin-bottom: 0;
}

/*
 * The gallery below the article text. Plain equal tiles rather than
 * the project page's mosaic: news photographs arrive as a set of
 * equals, with no first image that deserves the large cell.
 */
.news-gallery {
    margin-top: 64px;
}

.news-gallery h2 {
    margin: 0 0 28px;
    font-size: clamp(24px, 3.4vw, 34px);
    line-height: 1.15;
}

.news-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.news-gallery-item {
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--border-color);
    border-radius: 16px;
}

.news-gallery-item a {
    width: 100%;
    height: 100%;
    display: block;
}

.news-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 350ms ease;
}

.news-gallery-item:hover img {
    transform: scale(1.035);
}

.news-related {
    margin-top: 90px;
    padding-top: 48px;
    border-top: 1px solid var(--border-color);
}

.news-related h2 {
    margin: 0 0 32px;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
}

/* News section inside the project detail page */

.project-news {
    padding: 90px 0;
}

.project-news-more {
    margin: 40px 0 0;
}

.news-more-link {
    display: inline-block;
    padding: 14px 28px;
    color: var(--accent-color);
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    transition:
        border-color 220ms ease,
        background 220ms ease;
}

.news-more-link:hover {
    background: var(--card-background);
    border-color: var(--brand-gold);
}

.news-more-link:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Arabic sets tighter tracking badly on the display sizes above, */
/* and its glyphs need the extra leading.                         */
[dir="rtl"] .news-index-header h1,
[dir="rtl"] .news-article-title {
    line-height: 1.25;
    letter-spacing: 0;
}

@media (max-width: 1000px) {
    .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 720px) {
    .news-index {
        padding: 70px 0 85px;
    }

    .news-index-header {
        margin-bottom: 40px;
    }

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

    .news-article {
        padding: 50px 0 80px;
    }

    .news-article-summary {
        font-size: 18px;
    }

    .news-article-body {
        font-size: 17px;
    }

    .news-gallery {
        margin-top: 48px;
    }

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

    .news-related {
        margin-top: 60px;
    }

    .project-news {
        padding: 70px 0;
    }

    .news-pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-card,
    .news-pagination-link,
    .news-gallery-item img,
    .news-more-link {
        transition: none;
    }

    .news-card:hover {
        transform: none;
    }
}
