
/* GRID LAYOUT */
.lmg-gallery { 
    display: grid; 
    gap: 15px;
    grid-auto-rows: var(--lmg-row-h, 220px);
}
.lmg-gallery.columns-1 { grid-template-columns: repeat(1, 1fr); }
.lmg-gallery.columns-2 { grid-template-columns: repeat(2, 1fr); }
.lmg-gallery.columns-3 { grid-template-columns: repeat(3, 1fr); }
.lmg-gallery.columns-4 { grid-template-columns: repeat(4, 1fr); }
.lmg-gallery.columns-5 { grid-template-columns: repeat(5, 1fr); }

/* Media fit */
.lmg-img,
.lmg-video,
.lmg-gallery iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lmg-item.is-youtube { position: relative; }
.lmg-item.is-youtube .lmg-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    font-size: 4rem;
    color: #fff;
    text-shadow: 0 0 8px rgba(0,0,0,.6);
    pointer-events: none;
}

/* Lightbox overlay */
.lmg-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.lmg-lightbox img,
.lmg-lightbox video,
.lmg-lightbox iframe {
    width: 80vw;      /* or 90vw */
    height: 45vw;     /* 16:9 ratio */
    max-height: 90vh; /* never exceed viewport height */
}

