@charset "UTF-8";

/* モーダル */
.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.gallery-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}

.gallery-modal__content {
    position: absolute;
    top: calc(172px + (100vh - 172px) / 2);
    left: 50%;
    width: min(600px, calc(100% - 40px));
    max-height: calc(100vh - 172px);
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    overflow: visible;
    padding-bottom: 25px;
}

.gallery-modal__close {
    position: absolute;
    top: -34px;
    right: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 20;
}

.gallery-modal__close::before,
.gallery-modal__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 2px;
    background: #FFFFFF;
    border-radius: 999px;
    transform-origin: center;
}

.gallery-modal__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.gallery-modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* スライダー外枠 */
.gallery-modal__slider {
    position: relative;
}

/* Swiper本体 */
.gallery-swiper {
    position: relative;
    overflow: hidden;
}

.gallery-swiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-swiper .swiper-slide figure {
    margin: 0;
    width: 100%;
    text-align: center;
    color: #FFFFFF;
}

.gallery-swiper .swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 240px);
    margin: 0 auto;
    object-fit: contain;
}

.gallery-swiper .swiper-slide figcaption {
    margin-top: 10px;
    line-height: 1.3;
    font-weight: 700;
}

/* 左右ボタン */
.gallery-swiper__prev,
.gallery-swiper__next {
    position: absolute;
    top: 50%;
    z-index: 10;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translateY(-50%);
}

.gallery-swiper__prev {
    left: -45px;
}

.gallery-swiper__next {
    right: -45px;
}

.gallery-swiper__next svg {
    transform: rotate(180deg);
}

.gallery-swiper__prev.swiper-button-disabled,
.gallery-swiper__next.swiper-button-disabled {
    opacity: 1;
    pointer-events: auto;
}

html.is-modal-open,
html.is-modal-open body {
    overflow: hidden;
}

/* sp */
@media screen and (max-width: 767px) {
    .gallery-modal__content {
        width: calc(100% - 100px);
        top: 50%;
    }

    .gallery-modal__close {
        top: -34px;
        right: 0;
    }

    .gallery-swiper .swiper-slide img {
        max-height: calc(100vh - 110px);
    }

    .gallery-swiper .swiper-slide figcaption {
        margin-top: 7px;
        font-size:  clamp(12px, 3.2vw, 18px);
    }

    .gallery-swiper__prev {
        width: 24px;
        height: 24px;
        left: -30px;
    }

    .gallery-swiper__next {
        width: 24px;
        height: 24px;
        right: -30px;
    }
}