.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(6, 15, 26, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.gallery-lightbox-figure {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-lightbox-img {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.gallery-lightbox-img.is-loaded {
    opacity: 1;
    transform: scale(1);
}

.gallery-lightbox-counter {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    letter-spacing: 0.02em;
}

.gallery-lightbox-close,
.gallery-lightbox-arrow {
    position: fixed;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.24);
}

.gallery-lightbox-close {
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
}

.gallery-lightbox-arrow {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
}

.gallery-lightbox-prev {
    left: 20px;
}

.gallery-lightbox-next {
    right: 20px;
}

.gallery-lightbox-arrow.is-hidden {
    display: none;
}

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

@media (max-width: 640px) {
    .gallery-lightbox {
        padding: 16px;
    }

    .gallery-lightbox-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }

    .gallery-lightbox-arrow {
        width: 40px;
        height: 40px;
    }

    .gallery-lightbox-prev {
        left: 8px;
    }

    .gallery-lightbox-next {
        right: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-lightbox,
    .gallery-lightbox-img {
        transition: none;
    }
}
