/**
 * Слайдер новостей CNIIS — разместить на Bitrix-сайте:
 * https://cniis.ru/local/css/news-slider.css
 */
.news-slider {
    position: relative;
    width: min(100%, 960px);
    margin: 32px auto 40px;
    padding: 20px 56px 48px;
    box-sizing: border-box;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fb 100%);
    border: 1px solid rgba(209, 36, 33, 0.12);
    border-radius: 20px;
    box-shadow:
        0 4px 24px rgba(15, 23, 42, 0.06),
        0 1px 3px rgba(15, 23, 42, 0.04);
}

.news-slider::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.news-slider .swiper-wrapper {
    align-items: center;
}

.news-slider .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    opacity: 0.45;
    transform: scale(0.96);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.news-slider .swiper-slide-active {
    opacity: 1;
    transform: scale(1);
}

.news-slider__figure {
    position: relative;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.news-slider__figure img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(68vh, 520px);
    object-fit: contain;
    cursor: zoom-in;
    border-radius: 16px;
    background: #fff;
    box-shadow:
        0 16px 48px rgba(15, 23, 42, 0.14),
        0 0 0 1px rgba(15, 23, 42, 0.05);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.news-slider__figure img:hover {
    transform: translateY(-2px);
    box-shadow:
        0 22px 56px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(209, 36, 33, 0.15);
}

.news-slider .caption,
.news-slider figcaption.caption {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(88%, 640px);
    margin: 0;
    padding: 10px 20px;
    font-style: italic;
    font-size: 15px;
    line-height: 1.5;
    color: #1e293b;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 999px;
    border: 1px solid rgba(209, 36, 33, 0.12);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    text-align: center;
}

.news-slider .caption:empty,
.news-slider figcaption.caption:empty {
    display: none !important;
}

.news-slider .swiper-button-prev,
.news-slider .swiper-button-next {
    color: #d12421;
    width: 48px;
    height: 48px;
    margin-top: -28px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    border: 1px solid rgba(209, 36, 33, 0.18);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.news-slider .swiper-button-prev:hover,
.news-slider .swiper-button-next:hover {
    background: #fff;
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(209, 36, 33, 0.18);
}

.news-slider .swiper-button-prev::after,
.news-slider .swiper-button-next::after {
    font-size: 18px;
    font-weight: 800;
}

.news-slider .swiper-button-prev {
    left: 8px;
}

.news-slider .swiper-button-next {
    right: 8px;
}

.news-slider .swiper-pagination {
    bottom: 12px !important;
}

.news-slider .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #d12421;
    opacity: 0.25;
    transition: width 0.25s ease, opacity 0.25s ease;
}

.news-slider .swiper-pagination-bullet-active {
    width: 28px;
    border-radius: 999px;
    opacity: 1;
}

/* Модальное окно полноразмерного фото */
.news-slider-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 24px;
    box-sizing: border-box;
}

.news-slider-modal.is-open {
    display: flex;
}

.news-slider-modal__img {
    max-width: 94%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.news-slider-modal__caption {
    color: #fff;
    margin-top: 16px;
    font-size: 16px;
    font-style: italic;
    text-align: center;
    max-width: 90%;
    opacity: 0.92;
}

.news-slider-modal__close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.news-slider-modal__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Таблицы из Word */
table.docx-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 15px;
}

table.docx-table td,
table.docx-table th {
    border: 1px solid #ccc;
    padding: 8px 12px;
    vertical-align: top;
}

table.docx-table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Legacy Slick (старые новости) */
.slider__item .caption:empty {
    display: none !important;
}

@media (max-width: 768px) {
    .news-slider {
        padding: 12px 40px 40px;
        border-radius: 16px;
        margin: 20px auto 28px;
    }

    .news-slider__figure img {
        max-height: 340px;
        border-radius: 12px;
    }

    .news-slider .swiper-button-prev,
    .news-slider .swiper-button-next {
        width: 40px;
        height: 40px;
    }

    .news-slider .caption,
    .news-slider figcaption.caption {
        font-size: 13px;
        padding: 8px 14px;
        border-radius: 12px;
        max-width: 92%;
    }
}
