/**
 * MM Reps - Gallery Lightbox
 *
 * Pairs with assets/js/mm-reps-events-lightbox.js. Enqueued site-wide
 * alongside that script, since galleries can appear on any template.
 *
 * When closed, the overlay is fully removed from interaction with both
 * visibility:hidden and pointer-events:none. We don't use display:none
 * so that the opacity transition can play before it disappears.
 */

.mm-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 0s linear 180ms;
    padding: 24px;
    box-sizing: border-box;
}

.mm-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 180ms ease, visibility 0s linear 0s;
}

.mm-lightbox__stage {
    position: relative;
    max-width: min(1200px, 100%);
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mm-lightbox__image {
    max-width: 100%;
    max-height: calc(100vh - 100px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: block;
    background: #000;
}

.mm-lightbox__btn {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 150ms ease, transform 150ms ease, border-color 150ms ease;
    padding: 0;
}

.mm-lightbox__btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
}

.mm-lightbox__btn:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: 2px;
}

.mm-lightbox__btn:active {
    transform: scale(0.94);
}

.mm-lightbox__btn svg {
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.mm-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
}

.mm-lightbox__prev,
.mm-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
}

.mm-lightbox__prev {
    left: 20px;
}

.mm-lightbox__next {
    right: 20px;
}

.mm-lightbox__prev:active,
.mm-lightbox__next:active {
    transform: translateY(-50%) scale(0.94);
}

.mm-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 14px;
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mm-lightbox__btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}

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

/* Responsive
   ============================ */

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

    .mm-lightbox__close {
        top: 12px;
        right: 12px;
    }

    .mm-lightbox__prev {
        left: 8px;
        width: 44px;
        height: 44px;
    }

    .mm-lightbox__next {
        right: 8px;
        width: 44px;
        height: 44px;
    }

    .mm-lightbox__image {
        max-height: calc(100vh - 120px);
    }
}