#image-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.image-gallery-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.gallery-modal-image,
.gallery-close,
.gallery-prev,
.gallery-next {
    pointer-events: auto;
}

.gallery-modal-image {
    position: absolute;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.gallery-modal-image[hidden] {
    display: none;
}

.gallery-slide-in-right {
    animation: gallery-slide-in-right 0.5s ease;
}

.gallery-slide-in-left {
    animation: gallery-slide-in-left 0.5s ease;
}

@keyframes gallery-slide-in-right {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes gallery-slide-in-left {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

.gallery-close,
.gallery-prev,
.gallery-next {
    position: absolute;
    border: 0;
    background: transparent;
    color: white;
    cursor: pointer;
    z-index: 10;
}

.gallery-close {
    top: 20px;
    right: 25px;
    font-size: 2rem;
    line-height: 1;
}

.gallery-prev,
.gallery-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    padding: 1rem;
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.image-gallery-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.image-gallery-controls button {
    display: inline-block;
    border: 1px solid #fff;
    border-radius: 0;
    background: #fff;
    color: #0f172a;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1.5;
    padding: 0.375rem 3rem;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out,
                border-color 0.15s ease-in-out,
                box-shadow 0.15s ease-in-out;
}

.image-gallery-controls button:hover {
    background: #cbd5e1;
    border-color: #cbd5e1;
}

.image-gallery-controls button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgb(207 207 207 / 50%);
}

.image-gallery-controls button:active {
    background: #cbd5e1;
    border-color: #cbd5e1;
}

.image-gallery-controls button:disabled {
    opacity: 0.65;
    pointer-events: none;
}

body.image-gallery-open {
    overflow: hidden;
}

.gallery-slide {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#image-gallery-modal {
    touch-action: none;
}