/* =========================================================
   CAROUSEL BLOCK
   ========================================================= */

.carousel-block {
    position: relative;
    overflow: hidden;
    --slides-visible: 3; /* overridden by JS via data-slides-visible */
}

/* ---- Embla wrapper ---- */
.carousel-block .embla {
    overflow: hidden;
}

.carousel-block .embla__container {
    display: flex;
    touch-action: pan-y;
    backface-visibility: hidden;
}

.carousel-block .embla__slide {
    flex: 0 0 calc(100% / var(--slides-visible));
    min-width: 0;
    position: relative;
    padding: 0 8px;
    box-sizing: border-box;
}

.carousel-block .embla__slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Caption ---- */
.carousel-block .carousel-caption {
    margin: 6px 0 0;
    font-size: 0.8em;
    opacity: 0.7;
    text-align: center;
}

/* ---- Prev / Next buttons ---- */
.carousel-block .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    padding: 4px 18px 8px 18px;
    z-index: 10;
    transition: background 0.2s;
}

.carousel-block .carousel-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.carousel-block .carousel-btn--prev { left: 0; }
.carousel-block .carousel-btn--next { right: 0; }

/* ---- Dots ---- */
.carousel-block .carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 12px 0 0;
}

.carousel-block .carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.carousel-block .carousel-dot.is-active {
    background: rgba(0, 0, 0, 0.7);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .carousel-block .embla__slide {
        flex: 0 0 100%;
    }

    .carousel-block .carousel-btn {
        font-size: 1.4rem;
        padding: 4px 18px 8px 18px;
    }
}

/* =========================================================
   CAROUSEL POPUP LIGHTBOX
   ========================================================= */

.carousel-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.carousel-popup__inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-popup__slide {
    display: none;
    flex-direction: column;
    align-items: center;
}

.carousel-popup__slide.is-active {
    display: flex;
}

.carousel-popup__slide img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.carousel-popup__caption {
    margin: 10px 0 0;
    color: rgba(255,255,255,0.7);
    font-size: 0.85em;
    text-align: center;
}

/* Boutons popup */
.carousel-popup__close,
.carousel-popup__prev,
.carousel-popup__next {
    position: fixed;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    border: none;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s;
    user-select: none;
    z-index: 100;
}

.carousel-popup__close:hover,
.carousel-popup__prev:hover,
.carousel-popup__next:hover {
    background: rgba(0, 0, 0, 0.65);
}

.carousel-popup__close {
    top: 16px;
    right: 20px;
    font-size: 2.5rem;
    padding: 4px 12px;
    border-radius: 4px;
}

.carousel-popup__prev,
.carousel-popup__next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    padding: 12px 16px;
}

.carousel-popup__prev { left: 0; }
.carousel-popup__next { right: 0; }

/* Curseur pointer sur les images du carousel */
.carousel-block .embla__slide img {
    cursor: pointer;
}
