/* =========================================================
   GLOBAL GALLERY MODAL
   ========================================================= */

.gallery-modal {
    position: fixed;
    z-index: 11000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px 96px;
    background: rgba(12, 13, 15, 0.92);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
            opacity 0.25s ease,
            visibility 0.25s ease;
}

.gallery-modal--active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.gallery-modal__swiper {
    width: 100%;
    height: 100%;
}

.gallery-modal__slide {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 64px;
}

.gallery-modal__slide img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    border-radius: 20px;
}

.gallery-modal__close,
.gallery-modal__prev,
.gallery-modal__next {
    position: absolute;
    z-index: 5;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: #101114;
    cursor: pointer;
    transition:
            background 0.2s ease,
            transform 0.2s ease;
}

.gallery-modal__close:hover,
.gallery-modal__prev:hover,
.gallery-modal__next:hover {
    background: #f2f3f5;
}

.gallery-modal__close:active,
.gallery-modal__prev:active,
.gallery-modal__next:active {
    transform: scale(0.96);
}

.gallery-modal__close {
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
}

.gallery-modal__prev,
.gallery-modal__next {
    top: 50%;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
}

.gallery-modal__prev {
    left: 24px;
}

.gallery-modal__next {
    right: 24px;
}

.gallery-modal__prev:active,
.gallery-modal__next:active {
    transform: translateY(-50%) scale(0.96);
}

.gallery-modal__pagination {
    position: absolute;
    z-index: 4;
    right: auto;
    bottom: 22px;
    left: 50%;
    width: auto;
    color: #ffffff;
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    letter-spacing: 0.08em;
    transform: translateX(-50%);
}

.gallery-modal--single .gallery-modal__prev,
.gallery-modal--single .gallery-modal__next,
.gallery-modal--single .gallery-modal__pagination {
    display: none;
}

html.gallery-modal-open,
body.gallery-modal-open {
    overflow: hidden;
}

@media (max-width: 855px) {
    .gallery-modal {
        padding: 64px 56px;
    }

    .gallery-modal__slide {
        padding: 0 36px;
    }
}

@media (max-width: 650px) {
    .gallery-modal {
        padding: 56px 16px;
    }

    .gallery-modal__slide {
        padding: 0;
    }

    .gallery-modal__slide img {
        border-radius: 16px;
    }

    .gallery-modal__prev,
    .gallery-modal__next {
        top: auto;
        bottom: 18px;
        width: 44px;
        height: 44px;
        transform: none;
    }

    .gallery-modal__prev {
        left: 16px;
    }

    .gallery-modal__next {
        right: 16px;
    }

    .gallery-modal__prev:active,
    .gallery-modal__next:active {
        transform: scale(0.96);
    }

    .gallery-modal__close {
        top: 12px;
        right: 12px;
    }
}