/* ==========================================================
   ОБЩИЕ НАСТРОЙКИ СТРАНИЦ НОВОСТЕЙ
   ========================================================== */

.news-page,
.news-detail-page {
    padding: 32px 0 82px;
}

.news-container {
    width: min(calc(100% - 96px), 1320px);
    margin: 0 auto;
}


/* ==========================================================
   ЗАГОЛОВОК И СОРТИРОВКА
   ========================================================== */

.news-page__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 50px;
    margin-bottom: 34px;
}

.news-page__title {
    margin: 0;
    color: #0878bd;
    font-size: 46px;
    line-height: 1.08;
    font-weight: 400;
}

.news-sort {
    display: flex;
    align-items: center;
    gap: 28px;
    width: min(100%, 630px);
}

.news-sort__label {
    flex-shrink: 0;
    color: #222222;
    font-size: 19px;
    line-height: 1.2;
}

.news-sort__select-wrapper {
    position: relative;
    flex: 1;
}

.news-sort__select-wrapper::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 20px;
    width: 9px;
    height: 9px;
    border-right: 2px solid #b9b9b9;
    border-bottom: 2px solid #b9b9b9;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.news-sort__select-wrapper::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 48px;
    width: 1px;
    height: 22px;
    background: #d4d4d4;
    transform: translateY(-50%);
    pointer-events: none;
}

.news-sort__select {
    width: 100%;
    height: 46px;
    padding: 0 65px 0 18px;
    border: 1px solid #c9c9c9;
    border-radius: 13px;
    background: #ffffff;
    color: #333333;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    appearance: none;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.news-sort__select:hover {
    border-color: #999999;
}

.news-sort__select:focus {
    border-color: #0878bd;
    box-shadow: 0 0 0 3px rgba(8, 120, 189, 0.12);
}


/* ==========================================================
   СЕТКА НОВОСТЕЙ
   ========================================================== */

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

.news-card {
    min-width: 0;
}

.news-card__link {
    position: relative;
    display: block;
    aspect-ratio: 1.2 / 1;
    overflow: hidden;
    border-radius: 16px;
    background: #e8e8e8;
    color: #ffffff;
    text-decoration: none;
    isolation: isolate;
}

.news-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.news-card__link:hover .news-card__image {
    transform: scale(1.035);
}

.news-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.02) 25%,
            rgba(0, 0, 0, 0.18) 54%,
            rgba(0, 0, 0, 0.82) 100%
        );
}

.news-card__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background:
        linear-gradient(135deg, #0878bd, #075f98);
    text-align: center;
    font-size: 22px;
    line-height: 1.3;
}

.news-card__content {
    position: absolute;
    right: 28px;
    bottom: 25px;
    left: 28px;
    z-index: 2;
}

.news-card__title {
    margin: 0 0 13px;
    color: #ffffff;
    font-size: clamp(19px, 1.6vw, 25px);
    line-height: 1.15;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.news-card__line {
    width: 100%;
    height: 1px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.82);
}

.news-card__date {
    color: #ffffff;
    font-size: 16px;
    line-height: 1;
}


/* ==========================================================
   ПАГИНАЦИЯ
   ========================================================== */

.news-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 52px;
}

.news-pagination__link,
.news-pagination__arrow,
.news-pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 18px;
    text-decoration: none;
}

.news-pagination__link,
.news-pagination__arrow {
    color: #0878bd;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.news-pagination__link:hover,
.news-pagination__arrow:hover {
    background: rgba(8, 120, 189, 0.1);
}

.news-pagination__link--active {
    background: #0878bd;
    color: #ffffff;
    pointer-events: none;
}

.news-pagination__arrow {
    font-size: 28px;
    line-height: 1;
}

.news-pagination__ellipsis {
    color: #888888;
}

.news-empty {
    display: flex;
    min-height: 300px;
    align-items: center;
    justify-content: center;
    border: 1px solid #dddddd;
    border-radius: 16px;
}

.news-empty__text {
    margin: 0;
    color: #777777;
    font-size: 20px;
}


/* ==========================================================
   СТРАНИЦА ОТДЕЛЬНОЙ НОВОСТИ
   ========================================================== */

.news-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    color: #0878bd;
    font-size: 17px;
    text-decoration: none;
}

.news-detail__back:hover {
    text-decoration: underline;
}

.news-detail {
    max-width: 1100px;
    margin: 0 auto;
}

.news-detail__header {
    margin-bottom: 35px;
}

.news-detail__title {
    max-width: 1000px;
    margin: 0 0 17px;
    color: #0878bd;
    font-size: clamp(36px, 4vw, 58px);
    line-height: 1.08;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.news-detail__date {
    display: block;
    color: #777777;
    font-size: 17px;
}

.news-detail__annotation {
    max-width: 900px;
    margin: 25px 0 0;
    color: #333333;
    font-size: 21px;
    line-height: 1.5;
}


/* ==========================================================
   СЛАЙДЕР НОВОСТИ
   ========================================================== */

.news-slider {
    position: relative;
    margin-bottom: 48px;
}

.news-slider__viewport {
    overflow: hidden;
    border-radius: 20px;
    background: #eeeeee;
}

.news-slider__track {
    display: flex;
    transition: transform 0.45s ease;
    will-change: transform;
}

.news-slider__slide {
    position: relative;
    flex: 0 0 100%;
    margin: 0;
    aspect-ratio: 16 / 9;
}

.news-slider__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #eeeeee;
}

.news-slider__caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 35px 25px 18px;
    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.75),
            transparent
        );
    color: #ffffff;
    font-size: 16px;
}

.news-slider__button {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.52);
    color: #ffffff;
    font-size: 37px;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.news-slider__button:hover {
    background: rgba(0, 0, 0, 0.75);
}

.news-slider__button--previous {
    left: 20px;
}

.news-slider__button--next {
    right: 20px;
}

.news-slider__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 17px;
}

.news-slider__dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #c7c7c7;
    cursor: pointer;
    transition:
        width 0.2s ease,
        border-radius 0.2s ease,
        background-color 0.2s ease;
}

.news-slider__dot--active {
    width: 28px;
    border-radius: 10px;
    background: #0878bd;
}

.news-slider__counter {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 4;
    display: flex;
    gap: 4px;
    padding: 7px 12px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font-size: 14px;
}


/* ==========================================================
   ТЕКСТ И ВИДЕО НОВОСТИ
   ========================================================== */

.news-detail__description {
    color: #252525;
    font-size: 19px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

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

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

.news-detail__description img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.news-detail__description a {
    color: #0878bd;
}

.news-detail__description iframe {
    max-width: 100%;
}

.news-detail__video-section {
    margin-top: 48px;
}

.news-detail__section-title {
    margin: 0 0 22px;
    color: #0878bd;
    font-size: 34px;
    line-height: 1.2;
    font-weight: 400;
}

.news-detail__video {
    display: block;
    width: 100%;
    max-height: 680px;
    border-radius: 18px;
    background: #000000;
}


/* ==========================================================
   ПЛАНШЕТ
   ========================================================== */

@media (max-width: 1000px) {
    .news-container {
        width: min(calc(100% - 48px), 1320px);
    }

    .news-page__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 24px;
    }

    .news-sort {
        width: 100%;
    }

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


/* ==========================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ========================================================== */

@media (max-width: 650px) {
    .news-page,
    .news-detail-page {
        padding: 24px 0 55px;
    }

    .news-container {
        width: calc(100% - 48px);
    }

    .news-page__header {
        gap: 16px;
        margin-bottom: 43px;
    }

    .news-page__title {
        font-size: 39px;
        line-height: 1.05;
    }

    .news-sort {
        display: block;
    }

    .news-sort__label {
        display: block;
        margin: 0 0 11px 10px;
        color: #b0b0b0;
        font-size: 18px;
    }

    .news-sort__select {
        height: 54px;
        padding-left: 20px;
        border: 2px solid #c4c4c4;
        border-radius: 22px;
        font-size: 17px;
    }

    .news-sort__select-wrapper::before {
        display: none;
    }

    .news-sort__select-wrapper::after {
        right: 22px;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 21px;
    }

    .news-card__link {
        aspect-ratio: 1.35 / 1;
        border-radius: 18px;
    }

    .news-card__content {
        right: 42px;
        bottom: 28px;
        left: 42px;
    }

    .news-card__title {
        margin-bottom: 10px;
        font-size: 27px;
        line-height: 1.17;
    }

    .news-card__date {
        font-size: 17px;
    }

    .news-pagination {
        gap: 4px;
        margin-top: 35px;
    }

    .news-pagination__link,
    .news-pagination__arrow,
    .news-pagination__ellipsis {
        min-width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .news-pagination__arrow {
        font-size: 25px;
    }

    .news-detail__back {
        margin-bottom: 22px;
    }

    .news-detail__title {
        font-size: 36px;
    }

    .news-detail__annotation {
        font-size: 18px;
    }

    .news-slider {
        margin-right: -24px;
        margin-left: -24px;
    }

    .news-slider__viewport {
        border-radius: 0;
    }

    .news-slider__slide {
        aspect-ratio: 4 / 3;
    }

    .news-slider__button {
        width: 40px;
        height: 40px;
        font-size: 30px;
    }

    .news-slider__button--previous {
        left: 12px;
    }

    .news-slider__button--next {
        right: 12px;
    }

    .news-slider__counter {
        right: 12px;
        bottom: 12px;
    }

    .news-slider__dots {
        padding: 0 24px;
    }

    .news-detail__description {
        font-size: 17px;
        line-height: 1.65;
    }

    .news-detail__section-title {
        font-size: 29px;
    }
}


/* ==========================================================
   УЗКИЕ ТЕЛЕФОНЫ
   ========================================================== */

@media (max-width: 420px) {
    .news-container {
        width: calc(100% - 32px);
    }

    .news-page__title {
        font-size: 34px;
    }

    .news-card__content {
        right: 25px;
        bottom: 24px;
        left: 25px;
    }

    .news-card__title {
        font-size: 23px;
    }

    .news-slider {
        margin-right: -16px;
        margin-left: -16px;
    }
}