.news-container {
    padding-top: 135px;
}

.breadcrumbs__list {
    color: var(--color-primary);
}

.breadcrumbs__current,
.breadcrumbs__separator {
    color: var(--color-shades-tertiary);
}

.breadcrumbs__link {
    color: var(--color-primary);
}

.news-header {
    margin-top: 32px;
    margin-bottom: 32px;
}


/* --- News grid ---------------------------------------------------------- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 64px;
    gap: 1px;
    background-color: transparent;
    transition: background-color 400ms ease;
}

.news-container.is-visible .news-grid {
    background-color: var(--color-shades-quad);
    transition-delay: 600ms;
}

/* --- Card --------------------------------------------------------------- */
.news-grid .news-card {
    display: flex;
    flex-direction: column;
    padding: 32px;
    background-color: var(--color-surface);
    /* covers the grid bg, leaving only the 1px lines */
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

/* Placeholder cells fill incomplete rows so the grid background
   doesn't show through as gray empty cells */
.news-grid .news-card--placeholder {
    background-color: var(--color-surface);
    pointer-events: none;
}

/* Image with date pill */
.news-grid .news-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 16px;
}

.news-grid .news-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.news-grid .news-card:hover .news-card__image img {
    transform: scale(1.05);
}

/* Title — bold, up to two lines */
.news-grid .news-card__title {
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: var(--weight-medium);
    color: var(--color-shades-primary);
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.news-grid .news-card:hover .news-card__title {
    color: var(--color-primary);
}

/* Caption — lighter, up to two lines */
.news-grid .news-card__caption {
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: var(--weight-regular);
    color: var(--color-shades-tertiary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Date pill on the image */
.news-grid .news-card__date {
    position: absolute;
    bottom: 16px;
    right: 16px;
    height: 32px;
    width: 100px;
    background-image: url('/images/assets/date_background.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: var(--weight-medium);
    color: var(--color-shades-primary);
    white-space: nowrap;
    z-index: 1;
}

/* Row-edge padding (3 columns): start flush right, end flush left */
.news-grid .news-card:nth-child(3n + 1) {
    padding-right: 0;
}

.news-grid .news-card:nth-child(3n) {
    padding-left: 0;
}


/* ==========================================================================
   Animations — news listing page
   ========================================================================== */

/* --- Breadcrumbs / header ----------------------------------------------- */
.news-container .breadcrumbs,
.news-container .news-header {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.news-container.is-visible .breadcrumbs {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0ms;
}

.news-container.is-visible .news-header {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 150ms;
}

/* Decorative stick grows in */
.news-container .news-header .stick {
    transform: scaleY(0);
    transform-origin: bottom center;
    transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1) 300ms;
}

.news-container.is-visible .news-header .stick {
    transform: scaleY(1);
}

/* --- Cards stagger fade-up ---------------------------------------------- */
.news-container .news-grid .news-card {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 600ms ease,
        transform 600ms cubic-bezier(0.22, 1, 0.36, 1),
        color 0.25s ease;
    transition-delay: calc(var(--card-index, 0) * 70ms + 400ms);
}

.news-container.is-visible .news-grid .news-card {
    opacity: 1;
    transform: translateY(0);
}

/* Placeholders shouldn't animate or show during the reveal */
.news-container .news-grid .news-card--placeholder {
    opacity: 1;
    transform: none;
    transition: none;
}


/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {

    .news-container .breadcrumbs,
    .news-container .news-header,
    .news-container .news-header .stick,
    .news-container .news-grid .news-card {
        transition: none;
        transform: none;
        opacity: 1;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        /* real spacing instead of 1px divider lines */
        background-color: transparent;
        /* no grid bg → no gray empty cells, ever */
    }

    .news-container.is-visible .news-grid {
        padding: 0;
        /* spacing now comes from gap, not padding */
        background-color: transparent;
        /* nothing to cover */
    }

    /* placeholders not needed here — no divider bg to expose gray */
    .news-grid .news-card--placeholder {
        display: none;
    }

    /* reset all the 3-col edge padding rules */
    .news-grid .news-card:nth-child(3n + 1),
    .news-grid .news-card:nth-child(3n),
    .news-grid .news-card:nth-child(2n + 1),
    .news-grid .news-card:nth-child(2n) {
        padding: 0;
    }
}


@media (max-width: 600px) {
    .news-grid {
        grid-template-columns: 1fr;
        /* single column */
        gap: 48px;
        /* real spacing between cards */
        background-color: transparent;
        /* remove the divider-line background */
    }

    .news-grid .news-card {
        padding: 0;
        /* full-width cards */
        background-color: transparent;
        /* no grid bg to cover anymore */
    }

    /* placeholders would just be empty full-width gaps — remove them */
    .news-grid .news-card--placeholder {
        display: none;
    }

    /* reset row-edge padding from the larger layouts */
    .news-grid .news-card:nth-child(3n + 1),
    .news-grid .news-card:nth-child(3n),
    .news-grid .news-card:nth-child(2n + 1),
    .news-grid .news-card:nth-child(2n) {
        padding: 0;
    }

    .news-grid .news-card__title {
        font-size: 16px;
    }

    .news-grid .news-card__caption {
        font-size: 14px;
    }
}