/* ===== Новости дня ===== */

.news-slider {
    --news-gap: 20px;
    width: 100%;
    margin: 30px 0;
    min-width: 0;
}

.news-slider__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 15px;
}

.news-slider__links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.news-slider__link {
    font-size: 14px;
    color: #333;
    text-decoration: none;
}

.news-slider__link:hover {
    text-decoration: underline;
}

button.news-slider__link {
    border: 0;
    padding: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.news-slider__controls {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.news-slider__title {
    margin: 0;
    font-size: 24px;
    line-height: 1.3;
    font-weight: 700;
    color: #202631;
}

.news-slider__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #e0e4e9;
    border-radius: 50%;
    background: #fff;
    color: #252d38;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    transition:
        background .2s ease,
        color .2s ease,
        border-color .2s ease,
        opacity .2s ease;
}

.news-slider__arrow:hover:not(:disabled) {
    background: #202631;
    border-color: #202631;
    color: #fff;
}

.news-slider__arrow:disabled {
    opacity: .35;
    cursor: default;
}


.news-slider__viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
}

.news-slider__viewport::-webkit-scrollbar {
    display: none;
}

.news-slider__track {
    display: flex;
    align-items: stretch;
    gap: var(--news-gap);
}

.news-slider__card {
    flex: 0 0 calc((100% - 3 * var(--news-gap)) / 4);
    min-width: 0;
    scroll-snap-align: start;
}

.news-slider__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none !important;
}

.news-slider__image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    background: #f0f2f5;
}

.news-slider__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.news-slider__link:hover .news-slider__image img {
    transform: scale(1.045);
}

.news-slider__no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 12px;
    color: #858c97;
    font-size: 14px;
    text-align: center;
}

.news-slider__date {
    display: block;
    margin-top: 13px;
    color: #858c97;
    font-size: 13px;
    line-height: 1.4;
}

.news-slider__name {
    margin: 6px 0 0;
    color: #202631;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
    transition: color .2s ease;
}

.news-slider__link:hover .news-slider__name {
    color: #2878c8;
}

/* Попап */

.news-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.news-popup.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.news-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .75);
}

.news-popup__dialog {
    position: relative;
    z-index: 1;
    width: 92%;
    max-width: 760px;
    max-height: 94vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
    box-sizing: border-box;
}

.news-popup__content {
    width: 100%;
    max-width: none;
    margin: 0 auto;
}

.news-popup__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 65vh;
    object-fit: contain;
    margin: 0 auto 8px;
}

.news-popup__title {
    font-size: 19px;
    line-height: 1.3;
    margin: 0 0 5px;
}

.news-popup__date {
    display: inline-block;
    font-size: 13px;
    line-height: 1.4;
    color: #666;
    background: #f1f1f1;
    padding: 4px 9px;
    margin: 0 0 10px;
    border-radius: 4px;
}

.news-popup__preview {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.news-popup__preview p {
    margin: 0 0 6px;
}

.news-popup__close {
    position: sticky;
    float: right;
    top: 0;
    z-index: 3;
    margin: -12px -10px 0 10px;
    border: 0;
    background: #fff;
    font-size: 32px;
    cursor: pointer;
}

.news-popup__nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    font-size: 24px;
    cursor: pointer;
}

.news-popup__nav--prev {
    left: max(15px, calc((100vw - 1050px) / 2));
}

.news-popup__nav--next {
    right: max(15px, calc((100vw - 1050px) / 2));
}

/* Планшеты: три карточки */

@media (max-width: 1100px) {
    .news-slider__card {
        flex-basis: calc((100% - 2 * var(--news-gap)) / 3);
    }
}

/* Телефоны: две карточки */

@media (max-width: 650px) {
    .news-slider {
        --news-gap: 14px;
        margin: 24px 0;
    }

    .news-slider__title {
        font-size: 21px;
    }

    .news-slider__card {
        flex-basis: calc((100% - var(--news-gap)) / 2);
    }

    .news-slider__image {
        border-radius: 9px;
    }

    .news-slider__name {
        font-size: 14px;
        line-height: 1.4;
    }

    .news-slider__date {
        margin-top: 10px;
        font-size: 12px;
    }

    .news-slider__arrow {
        width: 20px;
        height: 20px;
		font-size: 15px;
    }
		
	.news-slider__header {
        align-items: flex-start;
    }

    .news-slider__links {
        flex-wrap: wrap;
        gap: 10px 15px;
    }

    .news-popup.is-open {
        padding: 8px;
    }

   .news-popup__dialog {
        width: 100%;
        max-height: 96vh;
        padding: 10px;
    }

    .news-popup__image {
        max-height: 55vh;
        margin-bottom: 7px;
    }

    .news-popup__title {
        font-size: 15px;
        margin-bottom: 5px;
    }

    .news-popup__nav {
        position: absolute;
        top: 120px;
		width: 25px;
		height: 25px;
		font-size: 12px;		
    }

	/* Выравнивание стрелок слайдера и попапа */
	.news-slider__arrow,
	.news-popup__nav {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		padding: 0;
		line-height: 1;
	}

	/* Скрываем текстовые символы стрелок */
	.news-slider__arrow,
	.news-popup__nav {
		font-size: 0;
	}

	/* Рисуем стрелки независимо от шрифта */
	.news-slider__arrow::before,
	.news-popup__nav::before {
		content: "";
		display: block;
		width: 9px;
		height: 9px;
		border-top: 2px solid currentColor;
		border-right: 2px solid currentColor;
		flex-shrink: 0;
	}

	.news-slider__arrow--prev::before,
	.news-popup__nav--prev::before {
		transform: rotate(-135deg);
		margin-left: 4px;
	}

	.news-slider__arrow--next::before,
	.news-popup__nav--next::before {
		transform: rotate(45deg);
		margin-right: 4px;
	}
	
}