/* ─── MGM Frontend Gallery ──────────────────────────────────────────────── */
.mgm-frontend-gallery { margin: 40px 0; }

.mgm-gallery-heading {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    color: #1e293b;
}

.mgm-gallery-grid-fe {
    display: grid;
    gap: 12px;
}

/* Columns via parent class */
.mgm-cols-2 .mgm-gallery-grid-fe { grid-template-columns: repeat(2, 1fr); }
.mgm-cols-3 .mgm-gallery-grid-fe { grid-template-columns: repeat(3, 1fr); }
.mgm-cols-4 .mgm-gallery-grid-fe { grid-template-columns: repeat(4, 1fr); }
.mgm-cols-5 .mgm-gallery-grid-fe { grid-template-columns: repeat(5, 1fr); }
.mgm-cols-6 .mgm-gallery-grid-fe { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 768px) {
    .mgm-cols-4 .mgm-gallery-grid-fe,
    .mgm-cols-5 .mgm-gallery-grid-fe,
    .mgm-cols-6 .mgm-gallery-grid-fe { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
    .mgm-gallery-grid-fe { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Item */
.mgm-gallery-item { margin: 0; }
.mgm-gallery-item a { display: block; overflow: hidden; border-radius: 8px; }

.mgm-gallery-item img {
    width: 100%; aspect-ratio: 1;
    object-fit: cover; display: block;
    border-radius: 8px;
    transition: transform .3s ease;
}
.mgm-gallery-item a:hover img { transform: scale(1.04); }

figcaption {
    font-size: 12px;
    color: #64748b;
    text-align: center;
    margin-top: 5px;
}

/* ── Lightbox ─────────────────────────────────────────────────────────── */
.mgm-lightbox-backdrop {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,.88);
    display: flex; align-items: center; justify-content: center;
    animation: mgmFadeIn .2s ease;
}
@keyframes mgmFadeIn { from { opacity: 0; } to { opacity: 1; } }

.mgm-lightbox-inner {
    position: relative;
    max-width: 90vw; max-height: 90vh;
    display: flex; flex-direction: column; align-items: center;
    gap: 12px;
}
.mgm-lightbox-inner img {
    max-width: 90vw; max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    animation: mgmZoomIn .2s ease;
}
@keyframes mgmZoomIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.mgm-lightbox-caption { color: rgba(255,255,255,.8); font-size: 14px; text-align: center; }

.mgm-lightbox-close {
    position: fixed; top: 20px; right: 24px;
    width: 40px; height: 40px;
    background: rgba(255,255,255,.15);
    border: none; border-radius: 50%;
    color: #fff; font-size: 24px; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.mgm-lightbox-close:hover { background: rgba(255,255,255,.3); }

.mgm-lightbox-nav {
    position: fixed; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px;
    background: rgba(255,255,255,.15);
    border: none; border-radius: 50%;
    color: #fff; font-size: 22px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.mgm-lightbox-nav:hover { background: rgba(255,255,255,.3); }
.mgm-lightbox-prev { left: 16px; }
.mgm-lightbox-next { right: 16px; }
