/* News list page */
.news-page {
    max-width: none;
}

.news-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 16px;
    row-gap: 60px;

    max-width: 1200px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.news-list li {
    margin: 0;
    padding: 0;
    min-width: 0;
}

.news-list-item {
    scroll-margin-top: 120px;
}

.news-list figure {
    margin: 0;
    min-width: 0;
}

/* News card image: fixed 8:5 ratio */
.news-card-image {
    width: 100%;
    aspect-ratio: 8 / 5;
    background-color: #f3f3f3;
    overflow: hidden;
}

.news-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card-image-empty {
    background-color: #f5f5f5;
}

.news-card {
    display: block;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.news-card-text {
    margin-top: 8px;
    min-width: 0;
}

.news-date {
    display: block;
    margin: 0 0 5px;

    font-size: 15px;
    line-height: 1.35;
    font-weight: 400;
    color: #555;
    letter-spacing: -0.02em;
}

/* News title: one line only */
.news-title {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 7px;

    font-size: 20px;
    line-height: 1.18;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.035em;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* News description: up to 4 lines */
.news-description {
    display: -webkit-box;
    margin: 0;

    font-size: 16px;
    line-height: 1.35;
    font-weight: 400;
    color: #333;
    letter-spacing: -0.02em;

    line-clamp: 4;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card:hover,
.news-card:focus {
    opacity: 0.6;
}

/* Pagination */
.news-page .pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    max-width: 1200px;
    margin-top: 30px;
    padding-top: 2rem;

    font-size: 16px;
    line-height: 1.4;
}

.news-page .pagination a {
    color: #02cafc;
    text-decoration: none;
    font-weight: 400;
}

.news-page .pagination a:hover,
.news-page .pagination a:focus {
    color: #000;
    text-decoration: none;
}

.news-page .pagination a:first-child,
.news-page .pagination-disabled:first-child {
    justify-self: start;
}

.news-page .pagination a:last-child,
.news-page .pagination-disabled:last-child {
    justify-self: end;
}

.news-page .pagination-current {
    justify-self: center;
    color: #777;
    font-weight: 400;
}

.news-page .pagination-disabled {
    color: #d0d0d0;
    font-weight: 400;
}

/* Latest News on Home */
.home-news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;

    width: 100%;
    margin: 0;
    padding: 0;
}

.home-news-item {
    width: 100%;
    margin: 0;
    padding: 0;
}

.home-news-item a {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    column-gap: 24px;
    align-items: baseline;

    width: 100%;

    color: inherit;
    text-decoration: none;
}

.home-news-item time {
    font-size: 18px;
    line-height: 1.35;
    font-weight: 400;
    color: #555;
    letter-spacing: -0.02em;

    white-space: nowrap;
}

.home-news-item p {
    margin: 0;

    font-size: 18px;
    line-height: 1.35;
    font-weight: 400;
    color: #000;
    letter-spacing: -0.02em;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-news-item a:hover p,
.home-news-item a:focus p {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Tablet */
@media screen and (max-width: 960px) {
    .news-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-page .pagination {
        margin-top: 28px;
        padding-top: 1.5rem;
        font-size: 14px;
        line-height: 1.4;
    }

    .news-page .pagination a,
    .news-page .pagination-disabled,
    .news-page .pagination-current {
        font-size: 14px;
        line-height: 1.4;
        font-weight: 400;
    }
}

/* Mobile */
@media screen and (max-width: 640px) {
    .news-list {
        grid-template-columns: 1fr;
        row-gap: 48px;
    }

    .news-title {
        font-size: 20px;
        line-height: 1.2;
    }

    .news-description {
        font-size: 16px;
        line-height: 1.4;

        line-clamp: 4;
        -webkit-line-clamp: 4;
    }

    .news-page .pagination {
        margin-top: 28px;
        padding-top: 1.5rem;
        font-size: 14px;
        line-height: 1.4;
    }

    .news-page .pagination a,
    .news-page .pagination-disabled,
    .news-page .pagination-current {
        font-size: 14px;
        line-height: 1.4;
        font-weight: 400;
    }

    .home-news-item a {
        grid-template-columns: 96px minmax(0, 1fr);
        column-gap: 14px;
    }

    .home-news-item time,
    .home-news-item p {
        font-size: 16px;
    }
}