/* Страница списка новостей: заголовок (.section__title) + карточки + пагинация.
   Карточка целиком — ссылка на конкретную новость. */

body {
    display: flex;
    flex-flow: column;
    min-height: 100dvh;
}

footer {
    margin-top: auto;
}

.news {
    padding: 48px 0 80px;
}

.news__title {
    margin-bottom: 32px;
}

.news__list {
    display: flex;
    flex-flow: column;
    gap: 24px;
}

.news__card {
    display: flex;
    gap: 40px;
    padding: 24px;
    background: white;
    border-radius: 14px;
    box-shadow: var(--primary-box-shadow);
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--primary-transition-config);
}

.news__card:hover {
    box-shadow: 0 8px 24px 0 rgba(207, 207, 207, 0.4);
}

.news__image {
    position: relative;
    flex: 0 0 auto;
    width: 352px;
    height: 235px;
    border-radius: 10px;
    overflow: hidden;
}

.news__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news__image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(71, 71, 71, 0.2);
}

.news__body {
    display: flex;
    flex-flow: column;
    min-width: 0;
    flex: 1 1 0;
}

.news__date {
    color: var(--primary-text-900);
    font-size: 14px;
    line-height: 135%;
}

.news__card-title {
    margin-top: 20px;
    color: var(--primary-text-1000);
    font-weight: bold;
    font-size: 18px;
    line-height: 110%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* дата-бейдж поверх картинки — только на мобильном */
.news__date-badge {
    display: none;
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 12px 16px;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    border-top-left-radius: 10px;
}

.news__excerpt {
    margin-top: 20px;
    color: var(--primary-text-900);
    font-size: 14px;
    line-height: 135%;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news__more {
    margin-top: auto;
    padding-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color-1000);
    font-weight: bold;
    font-size: 16px;
    line-height: 110%;
    align-self: flex-start;
}

.news__more-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

/* пагинация */
.news__pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.news__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 34px;
    padding: 8px 10px;
    border: 1px solid #dcdcdc;
    border-radius: 2px;
    color: var(--primary-text-900);
    font-size: 16px;
    line-height: 110%;
    text-decoration: none;
    transition: var(--primary-transition-config);
    transition-property: background-color, color, border-color;
}

.news__page:hover {
    border-color: var(--primary-color-1000);
    color: var(--primary-color-1000);
}

.news__page--active,
.news__page--active:hover {
    background: #f4a94f;
    border-color: #f4a94f;
    color: white;
}

.news__page--prev,
.news__page--next {
    padding: 8px 4px;
}

.news__page--prev svg,
.news__page--next svg {
    width: 12px;
    height: 12px;
}

@media screen and (max-width: 1023px) {
    .news__image {
        width: 280px;
        height: 200px;
    }

    .news__more {
        display: none;
    }
}

@media screen and (max-width: 1023px) and (min-width: 768px) {
    .news__title {
        font-size: 20px;
    }
}

@media screen and (max-width: 767px) {
    .news {
        padding: 32px 0 64px;
    }

    .news__card {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .news__image {
        width: 100%;
        height: 200px;
    }

    .news__body {
        gap: 0;
    }

    /* дату показываем бейджем на картинке, текст сверху скрываем */
    .news__date {
        display: none;
    }

    .news__date-badge {
        display: block;
    }

    .news__card-title {
        margin-top: 0;
        font-size: 16px;
    }

    .news__excerpt {
        margin-top: 8px;
    }
}
