.lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 28px;
    background: rgba(90, 91, 94, 0.88);
}

.lightbox-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    width: min(1120px, 100%);
    animation: lightboxIn 0.22s ease;
}

@keyframes lightboxIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lightbox-figure {
    display: grid;
    gap: 12px;
    justify-items: center;
}

.lightbox-image {
    width: auto;
    max-width: 100%;
    max-height: 76vh;
    border: 4px solid #fff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    background: #fff;
}

.lightbox-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 18px 0;
    color: #fff;
    text-align: center;
}

.lightbox-counter {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.lightbox-title {
    font-size: 1rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(95, 92, 96, 0.78);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
    background: rgba(120, 143, 172, 0.92);
    border-color: rgba(255, 255, 255, 0.5);
    outline: none;
}

.lightbox-close {
    top: -8px;
    right: 0;
    width: 48px;
    height: 48px;
    font-size: 1.85rem;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: -18px;
}

.lightbox-next {
    right: -18px;
}

@media (max-width: 900px) {
    .lightbox-modal {
        padding: 18px;
    }

    .lightbox-prev {
        left: 0;
    }

    .lightbox-next {
        right: 0;
    }
}

@media (max-width: 600px) {
    .lightbox-modal {
        padding: 12px;
    }

    .lightbox-content {
        width: 100%;
        padding-top: 54px;
    }

    .lightbox-close {
        top: 0;
        right: 0;
    }

    .lightbox-prev,
    .lightbox-next {
        top: auto;
        bottom: -60px;
        transform: none;
    }

    .lightbox-prev {
        left: calc(50% - 58px);
    }

    .lightbox-next {
        right: calc(50% - 58px);
    }

    .lightbox-image {
        max-height: 68vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox-content {
        animation: none;
    }
}
