/**
 * Scroll-Triggered Marquee Styles
 */

.wml-stm {
    width: 100%;
    /* Use clip (not hidden): overflow-x:hidden forces overflow-y to compute to
       auto, turning this box into a nested scroll container that traps the page
       scroll. clip hides the horizontal overflow without creating a scroller. */
    overflow-x: clip;
    overflow-y: visible;
    /* Stop the browser from anchoring to the moving rows, which causes the
       page scroll to stutter/halt when reversing direction */
    overflow-anchor: none;
}

/* The main wrapper — no overflow hidden so the rotated gallery
   top/bottom edges remain fully visible */
.wml-stm-wrapper {
    position: relative;
    width: 100%;
    height: 120vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wml-stm-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* The rotated container */
.wml-stm-gallery {
    display: flex;
    flex-direction: column;
    gap: 2vw;
    width: 120vw;
}

/* Individual strips — max-content keeps the row exactly as wide as its images */
.wml-stm-row {
    display: flex;
    gap: 2vw;
    width: max-content;
    will-change: transform;
    overflow-anchor: none;
}

/* Start positions ensure there is room to animate without showing empty space */
.wml-stm-row-right {
    transform: translateX(-50vw);
}

.wml-stm-row-left {
    transform: translateX(0vw);
}

/* Image styling — forced square */
.wml-stm-row img {
    width: 20vw;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Clickable hint when the lightbox is enabled */
.wml-stm[data-lightbox="true"] .wml-stm-img {
    cursor: zoom-in;
}

/* ───────────────────────── Lightbox ───────────────────────── */

.wml-stm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.wml-stm-lightbox.is-active {
    display: block;
}

.wml-stm-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    cursor: zoom-out;
    will-change: opacity;
}

.wml-stm-lightbox-img {
    position: fixed;
    /* left/top/width/height/transform are all driven by GSAP */
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    cursor: zoom-out;
    will-change: left, top, width, height, transform;
}

/* Lock page scroll while the lightbox is open */
body.wml-stm-lb-locked {
    overflow: hidden;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .wml-stm-row img {
        width: 40vw;
    }

    .wml-stm-gallery {
        width: 150vw;
    }

    .wml-stm-row-right {
        transform: translateX(-80vw);
    }
}
