/* ======================================================
   SC LIGHTBOX
====================================================== */

body.sc-lightbox--open {
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}

.sc-lightbox {
    z-index: 2147483640;
    display: none;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 240ms ease;
    pointer-events: none;
    overscroll-behavior: contain;
}

.sc-lightbox--open {
    opacity: 1;
    pointer-events: auto;
}

.sc-lightbox__image {
    max-width: min(80vw, 1280px);
    max-height: calc(100dvh - 80px);
    opacity: 0;
    transform: scale(0.94);
    transition:
        opacity 240ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
    user-select: none;
    -webkit-user-drag: none;
    will-change: opacity, transform;
    cursor: default;
}

.sc-lightbox__image--visible {
    opacity: 1;
    transform: scale(1);
}

@keyframes sc-lb-from-right {
    from { opacity: 0; transform: translateX(52px) scale(0.97); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes sc-lb-from-left {
    from { opacity: 0; transform: translateX(-52px) scale(0.97); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.sc-lightbox__image--from-right {
    animation: sc-lb-from-right 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sc-lightbox__image--from-left {
    animation: sc-lb-from-left 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sc-lightbox__spinner {
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(255, 255, 255, 0.75);
    opacity: 0;
    transition: opacity 200ms ease;
}

.sc-lightbox--loading .sc-lightbox__spinner {
    opacity: 1;
    animation: sc-lb-spin 700ms linear infinite;
}

@keyframes sc-lb-spin {
    to { transform: rotate(360deg); }
}

.sc-lightbox__close,
.sc-lightbox__arrow {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.42);
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.sc-lightbox__close {
    top: 16px;
    right: 16px;
}

.sc-lightbox__close:hover,
.sc-lightbox__arrow:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
}

.sc-lightbox__counter {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

@media (max-width: 767px) {
    .sc-lightbox__arrow { display: none !important; }

    .sc-lightbox__image {
        max-width: 94vw;
        max-height: calc(100dvh - 72px);
        border-radius: 10px;
    }

    .sc-lightbox__toolbar {
        top: 12px;
        right: 12px;
    }

    .sc-lightbox__close {
        width: 36px;
        height: 36px;
        top: 12px;
        right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sc-lightbox {
        transition: opacity 80ms ease;
    }

    .sc-lightbox__image,
    .sc-lightbox__image--from-right,
    .sc-lightbox__image--from-left {
        animation: none;
        transition: opacity 80ms ease;
        transform: none !important;
    }
}
