/* Masonry Gallery Pro - Front CSS v3.1 */

.mga-grid {
    width: 100%;
}

.mga-item {
    width: calc((100% - (var(--mga-cols, 4) - 1) * var(--mga-gap, 20px)) / var(--mga-cols, 4));
    margin-bottom: var(--mga-gap, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.25s ease;
    box-sizing: border-box;
}
.mga-item.mga-whitebg { background: #ffffff; }
.mga-item:hover { transform: scale(1.03); }

.mga-item img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    border-radius: 4px;
}

/* ── Lightbox ── */
#mga-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}
#mga-lightbox.mga-open { display: flex; }

#mga-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.88);
    animation: mgaFadeIn .2s ease;
}

#mga-lb-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: mgaZoomIn .28s cubic-bezier(.34,1.56,.64,1);
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

#mga-lb-img {
    max-width: 92vw;
    max-height: 95vh;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

#mga-lb-caption { display: none; /* caché */ }
#mga-lb-caption-hidden {
    margin: 14px 0 0;
    font-size: 14px;
    color: #555;
    text-align: center;
    max-width: 500px;
}

#mga-lb-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    border: none;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    line-height: 1;
    padding: 0;
}
#mga-lb-close:hover { background: #d00; }

@keyframes mgaFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes mgaZoomIn {
    from { opacity: 0; transform: scale(.65); }
    to   { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 900px) {
    .mga-item {
        width: calc((100% - 2 * var(--mga-gap, 20px)) / 3);
    }
}
@media (max-width: 600px) {
    .mga-item {
        width: calc((100% - var(--mga-gap, 20px)) / 2);
    }
}
@media (max-width: 380px) {
    .mga-item { width: 100%; }
}
