/* ==========================================================================
   YCMC GALERIE GENERIQUE - Masonry + Lightbox
   ========================================================================== */

.ycmc-gallery {
    column-count: var(--ycmc-gallery-cols, 3);
    column-gap: 10px;
    width: 100%;
    margin: 20px 0;
}

.ycmc-gallery-empty {
    color: #686868;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.ycmc-gallery__item {
    display: block;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin: 0 0 10px;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    background: #f4f4f4;
}

.ycmc-gallery__item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.4s ease, filter 0.3s ease;
}

.ycmc-gallery__item:hover img {
    transform: scale(1.04);
    filter: brightness(1.05);
}

/* Responsive */
@media screen and (max-width: 1024px) {
    .ycmc-gallery { column-count: 2; }
}

@media screen and (max-width: 520px) {
    .ycmc-gallery { column-count: 1; }
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */

body.ycmc-lb-locked { overflow: hidden; }

.ycmc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 15, 25, 0.94);
    padding: 20px;
}

.ycmc-lightbox.is-open {
    display: flex;
    animation: ycmcLbFadeIn 0.2s ease;
}

@keyframes ycmcLbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ycmc-lightbox__stage {
    margin: 0;
    padding: 0;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ycmc-lightbox__img {
    max-width: 100%;
    max-height: 82vh;
    display: block;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.ycmc-lightbox__caption {
    color: #fff;
    margin-top: 14px;
    text-align: center;
    max-width: 80ch;
    font-size: 0.95rem;
    line-height: 1.4;
}

.ycmc-lightbox__close,
.ycmc-lightbox__prev,
.ycmc-lightbox__next {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.ycmc-lightbox__close:hover,
.ycmc-lightbox__prev:hover,
.ycmc-lightbox__next:hover {
    background: rgba(255, 255, 255, 0.28);
}

.ycmc-lightbox__close {
    top: 20px;
    right: 20px;
    font-size: 1.8rem;
}

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

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

.ycmc-lightbox__prev:hover { transform: translateY(-50%) scale(1.08); }
.ycmc-lightbox__next:hover { transform: translateY(-50%) scale(1.08); }

.ycmc-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

@media screen and (max-width: 767px) {
    .ycmc-lightbox { padding: 10px; }
    .ycmc-lightbox__close,
    .ycmc-lightbox__prev,
    .ycmc-lightbox__next {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .ycmc-lightbox__close { top: 10px; right: 10px; }
    .ycmc-lightbox__prev { left: 8px; }
    .ycmc-lightbox__next { right: 8px; }
    .ycmc-lightbox__img  { max-height: 78vh; }
    .ycmc-lightbox__caption { font-size: 0.85rem; margin-top: 8px; }
}
