/* =====================================================
   Masonry Gallery — Stili Frontend
   ===================================================== */

.mg-gallery-wrap {
    position: relative;
    width: 100%;
}

.mg-sizer {
    display: block;
}

/* Ogni cella */
.mg-item {
    overflow: hidden;
}

.mg-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.3s ease;
}

.mg-item img:hover {
    opacity: 0.88;
}

/* Link lightbox */
.mg-lightbox-trigger {
    display: block;
    cursor: zoom-in;
}

/* Messaggio vuoto */
.mg-empty {
    color: #999;
    font-style: italic;
}

/* =====================================================
   LIGHTBOX OVERLAY
   ===================================================== */
.mg-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mg-overlay.is-open {
    display: flex;
}

.mg-overlay-inner {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-overlay-img {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* Bottoni */
.mg-overlay-close,
.mg-overlay-prev,
.mg-overlay-next {
    position: fixed;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 100000;
    padding: 0;
}

.mg-overlay-close:hover,
.mg-overlay-prev:hover,
.mg-overlay-next:hover {
    background: rgba(255,255,255,0.28);
}

.mg-overlay-close { top: 16px;  right: 16px; font-size: 1.8rem; }
.mg-overlay-prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.mg-overlay-next  { right: 16px; top: 50%; transform: translateY(-50%); }
