/* ================================================
   Josephine Gallery
   ================================================ */
.josephine-gallery {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* ── Тумбы ── */
.josephine-gallery__thumbs {
    width: 80px;
    flex-shrink: 0;
}

.josephine-gallery__thumbs .swiper {
    height: auto;
}

.josephine-gallery__thumbs .swiper-slide {
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.2s ease;
    overflow: hidden;
    /* Фиксированная высота слайда на десктопе — Swiper считает сколько влезает */
    height: 80px;
}

.josephine-gallery__thumbs .swiper-slide-thumb-active {
    opacity: 1;
    outline: 1.5px solid #333;
    outline-offset: -1.5px;
}

.josephine-gallery__thumbs .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ── Главное фото ── */
.josephine-gallery__main {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.josephine-gallery__main .swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

/* ── Мобильный: тумбы горизонтально снизу ── */
@media (max-width: 768px) {
    .josephine-gallery {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .josephine-gallery__thumbs {
        width: 100%;
    }

    .josephine-gallery__thumbs .swiper {
        height: auto;
    }

    .josephine-gallery__thumbs .swiper-wrapper {
        flex-direction: row !important;
    }

    /* Сбрасываем бесконечную ширину для всех слайдов */
    .swiper-slide {
        width: 100% !important;
    }

    /* 4 тумбы с отступом 4px = (100% - 12px) / 4 */
    .josephine-gallery__thumbs .swiper-slide {
        width: calc(25% - 3px) !important;
        height: auto !important; /* height: auto только на мобиле */
    }

    .josephine-gallery__thumbs .swiper-slide img {
        height: auto;
        aspect-ratio: 1;
    }
}