/* ==========================================================================
   Responsive Gallery Lightbox — Front-end styles
   ========================================================================== */

.rgl-gallery {
    --rgl-columns: 4;
    --rgl-gap: 12px;
    position: relative;
    margin: 24px 0;
}

/* ---- Desktop / tablet : grille ---- */
.rgl-track {
    display: grid;
    grid-template-columns: repeat(var(--rgl-columns), 1fr);
    gap: var(--rgl-gap);
}

.rgl-item {
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #eee;
    aspect-ratio: 1 / 1;
}
.rgl-item img{
	height:100%;
}
.rgl-link {
    display: block;
    width: 100%;
    height: 100%;
}

.rgl-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.rgl-item:hover .rgl-img {
    transform: scale(1.06);
}

.rgl-dots {
    display: none;
}

/* ---- Mobile : slider tactile avec scroll-snap ---- */
@media (max-width: 767px) {
    .rgl-track {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: var(--rgl-gap);
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .rgl-track::-webkit-scrollbar {
        display: none;
    }

    .rgl-item {
        flex: 0 0 82%;
        scroll-snap-align: center;
        aspect-ratio: 4 / 3;
    }

    .rgl-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-top: 10px;
    }

    .rgl-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.2);
        transition: background 0.2s ease, transform 0.2s ease;
    }

    .rgl-dot.is-active {
        background: rgba(0, 0, 0, 0.75);
        transform: scale(1.3);
    }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.rgl-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    padding: 24px;
}

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

.rgl-lightbox-stage {
    position: relative;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rgl-lightbox-img {
    max-width: 92vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 4px;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.rgl-lightbox-img.is-visible {
    opacity: 1;
    transform: scale(1);
}

.rgl-lightbox-caption {
    color: #f1f1f1;
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
    max-width: 80vw;
    opacity: 0.85;
}

.rgl-lightbox-counter {
    position: absolute;
    top: -36px;
    left: 0;
    color: #ddd;
    font-size: 13px;
    letter-spacing: 0.03em;
}

.rgl-lightbox-close,
.rgl-lightbox-prev,
.rgl-lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.rgl-lightbox-close:hover,
.rgl-lightbox-prev:hover,
.rgl-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.rgl-lightbox-close {
    top: -18px;
    right: -18px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    top: 24px;
    right: 24px;
    position: fixed;
}

.rgl-lightbox-prev,
.rgl-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    font-size: 22px;
    position: fixed;
}

.rgl-lightbox-prev {
    left: 24px;
}

.rgl-lightbox-next {
    right: 24px;
}

.rgl-lightbox-spinner {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rgl-spin 0.8s linear infinite;
}

@keyframes rgl-spin {
    to { transform: rotate(360deg); }
}

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

@media (max-width: 600px) {
    .rgl-lightbox-prev,
    .rgl-lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .rgl-lightbox-prev { left: 8px; }
    .rgl-lightbox-next { right: 8px; }
    .rgl-lightbox-close { top: 12px; right: 12px; }
}
