/**
 * Shakewell single-page image lightbox.
 *
 * Standalone (non-Mix) stylesheet — enqueued directly on single builder pages.
 * Namespaced under .sw-lightbox to avoid collisions with theme/Tailwind styles.
 */

/* Trigger affordance — layout is unchanged, only the cursor hints clickability. */
[data-sw-lightbox] {
    cursor: zoom-in;
    display: block;
}

/* Overlay root */
.sw-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(9, 9, 12, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

/* Prevent background scroll while open */
.sw-lightbox-lock {
    overflow: hidden;
}

.sw-lightbox__figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sw-lightbox__img {
    max-width: 100%;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.sw-lightbox__caption {
    color: #f2f2f2;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    max-width: 720px;
}

.sw-lightbox__caption:empty {
    display: none;
}

/* Controls (close / prev / next) */
.sw-lightbox__btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease, transform 0.15s ease;
}

.sw-lightbox__btn:hover,
.sw-lightbox__btn:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    outline: none;
}

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

.sw-lightbox__close {
    top: 20px;
    right: 20px;
}

.sw-lightbox__prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.sw-lightbox__next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.sw-lightbox__prev:hover,
.sw-lightbox__next:hover {
    transform: translateY(-50%) scale(1.05);
}

/* Hide nav when the set has a single image */
.sw-lightbox[data-single="true"] .sw-lightbox__prev,
.sw-lightbox[data-single="true"] .sw-lightbox__next {
    display: none;
}

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

    .sw-lightbox__btn {
        width: 40px;
        height: 40px;
    }

    .sw-lightbox__prev {
        left: 8px;
    }

    .sw-lightbox__next {
        right: 8px;
    }

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