/* ------------------------------------------------------------------ */
/* Carousel + Lightbox Block                                          */
/* ------------------------------------------------------------------ */

.carousel-lightbox {
    --cl-height: 560px;
    --cl-height-mobile: 320px;
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.carousel-lightbox-placeholder {
    padding: 2rem;
    text-align: center;
    color: #555;
    background: #f3f3f3;
    border: 1px dashed #bbb;
    border-radius: 6px;
}

/* Viewport clips the sliding track */
.carousel-lightbox .cl-viewport {
    position: relative;
    overflow: hidden;
    height: var(--cl-height);
    background: #eee;
}

.carousel-lightbox .cl-track {
    display: flex;
    height: 100%;
    /* transform is driven inline by JS; keep the transition here */
    transition: transform 0.45s ease;
    will-change: transform;
}

.carousel-lightbox .cl-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.carousel-lightbox .cl-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: zoom-in;
    -webkit-user-select: none;
    user-select: none;
}

.carousel-lightbox.cl-fit-contain .cl-image {
    object-fit: contain;
}

/* When lightbox is disabled the image shouldn't invite a click */
.carousel-lightbox[data-lightbox="false"] .cl-image {
    cursor: default;
}

/* ---- Arrows -------------------------------------------------------- */
.carousel-lightbox .cl-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #222;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.carousel-lightbox .cl-arrow:hover,
.carousel-lightbox .cl-arrow:focus-visible {
    background: #fff;
}

.carousel-lightbox .cl-arrow--prev { left: 16px; }
.carousel-lightbox .cl-arrow--next { right: 16px; }

/* ---- Dots ---------------------------------------------------------- */
.carousel-lightbox .cl-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.carousel-lightbox .cl-dot {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 1px solid #b8b8b8;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.carousel-lightbox .cl-dot:hover {
    border-color: #666;
}

.carousel-lightbox .cl-dot.is-active {
    background: #333;
    border-color: #333;
}

@media (max-width: 600px) {
    .carousel-lightbox .cl-viewport {
        height: var(--cl-height-mobile);
    }
    /* Arrows out of the way on touch; swipe is the primary control */
    .carousel-lightbox .cl-arrow {
        width: 38px;
        height: 38px;
        background: rgba(255, 255, 255, 0.75);
    }
    .carousel-lightbox .cl-arrow--prev { left: 8px; }
    .carousel-lightbox .cl-arrow--next { right: 8px; }
}

/* ------------------------------------------------------------------ */
/* Fullscreen Lightbox                                                */
/* ------------------------------------------------------------------ */

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

.cl-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
}

.cl-lightbox.is-open {
    display: flex;
}

.cl-lightbox__stage {
    position: relative;
    margin: 0;
    max-width: min(1200px, 90vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.cl-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 2.5rem);
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    background: #fff;
}

.cl-lightbox__bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 0.6rem 0.25rem;
    color: #fff;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.cl-lightbox__counter {
    opacity: 0.85;
}

/* Controls */
.cl-lightbox__close,
.cl-lightbox__arrow {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.cl-lightbox__close:hover,
.cl-lightbox__close:focus-visible,
.cl-lightbox__arrow:hover,
.cl-lightbox__arrow:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

.cl-lightbox__close {
    top: 1.25rem;
    right: 1.25rem;
}

.cl-lightbox__arrow--prev {
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}

.cl-lightbox__arrow--next {
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 600px) {
    .cl-lightbox__stage {
        max-width: 100vw;
        padding: 0 3.25rem;
    }
    .cl-lightbox__close,
    .cl-lightbox__arrow {
        width: 38px;
        height: 38px;
    }
    .cl-lightbox__arrow--prev { left: 0.5rem; }
    .cl-lightbox__arrow--next { right: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .carousel-lightbox .cl-track {
        transition: none;
    }
}
