/* ==========================================================================
   Блок галереи изображений (image_gallery)
   ========================================================================== */

.image-gallery-block {
    margin-top: 50px;
    margin-bottom: 50px;
}

/* ----------------------------------------
   Swiper-контейнер — явная высота обязательна,
   потому что Swiper CSS задаёт height:100% на
   .swiper-wrapper и .swiper-slide
   ---------------------------------------- */

.image-gallery-block .image-gallery-block__swiper {
    display: block; /* переопределяет глобальный .swiper { display: none } из style.css */
    position: relative;
    height: 480px;
    overflow: hidden;
    background: #f0f0f0;
    user-select: none;
    -webkit-user-select: none;
    max-width: 650px;
    margin-left: 0;
}

.image-gallery-block .image-gallery-block__caption {
    max-width: 650px;
    width: 100%;
}

.image-gallery-block .wp-element-caption {
    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 140%;
    color: #414141;
    font-feature-settings: "clig" off, "liga" off;
    opacity: 0.5;
    margin-top: 15px;
}

/* ----------------------------------------
   Слайд и фигура занимают всю высоту контейнера
   ---------------------------------------- */

.image-gallery-block__swiper .swiper-wrapper {
    height: 100%;
}

.image-gallery-block__swiper .swiper-slide {
    height: 100%;
}

.image-gallery-block__swiper .image-gallery-block__figure {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    display: block;
}

/* ----------------------------------------
   Изображение — cover, без прыжков высоты
   ---------------------------------------- */

.image-gallery-block__figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ----------------------------------------
   Подпись к слайду — оверлей с градиентом
   ---------------------------------------- */

.image-gallery-block__figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 56px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.45));
    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #fff;
    text-align: center;
}

/* ----------------------------------------
   Кнопки навигации (prev / next)
   ---------------------------------------- */

.image-gallery-block__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #414141;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.image-gallery-block__nav:hover {
    background: #414141;
    color: #fff;
}

.image-gallery-block__nav:focus-visible {
    outline: 2px solid #414141;
    outline-offset: 2px;
}

.image-gallery-block__nav--prev {
    left: 12px;
}

.image-gallery-block__nav--next {
    right: 12px;
}

.image-gallery-block__nav.swiper-button-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ----------------------------------------
   Пагинация — поверх изображения, снизу
   ---------------------------------------- */

.image-gallery-block__pagination {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.image-gallery-block__swiper .swiper-pagination-bullet {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    opacity: 1;
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    pointer-events: auto;
}

.image-gallery-block__swiper .swiper-pagination-bullet-active {
    background: #fff;
    transform: scale(1.3);
}

/* ----------------------------------------
   Общая подпись под галереей
   ---------------------------------------- */

.image-gallery-block__caption {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #888;
    text-align: center;
    margin: 10px 0 0;
}

/* ----------------------------------------
   Placeholder в редакторе Gutenberg
   ---------------------------------------- */

.image-gallery-block__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    background: #fafafa;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    color: #aaa;
}

.image-gallery-block__placeholder p {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    margin: 0;
}

/* ----------------------------------------
   Адаптив
   ---------------------------------------- */

@media screen and (max-width: 1024px) {
    .image-gallery-block__swiper {
        height: 380px;
    }
}

@media screen and (max-width: 767px) {
    .image-gallery-block {
        margin-top: 32px;
        margin-bottom: 32px;
    }

    .image-gallery-block__swiper {
        height: 280px;
    }

    .image-gallery-block__nav {
        width: 34px;
        height: 34px;
    }

    .image-gallery-block__nav--prev {
        left: 8px;
    }

    .image-gallery-block__nav--next {
        right: 8px;
    }

    .image-gallery-block__figcaption {
        padding: 30px 44px 12px;
        font-size: 12px;
    }
}

@media screen and (max-width: 440px) {
    .image-gallery-block__swiper {
        height: 220px;
    }
}
