/* =========================================================================
   Grid de galería "justified" — acomoda horizontales y verticales
   ========================================================================= */
.jgallery {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 1.5rem 0;
}
.jgallery__item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: #e9eaf2;
    line-height: 0;
    height: 200px;          /* fallback sin JS; el JS calcula la altura por fila */
    flex-grow: 1;
    cursor: zoom-in;
}
.jgallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}
.jgallery__item:hover img { transform: scale(1.06); }

.jgallery__cap {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 18px 12px 8px;
    font-size: .82rem; line-height: 1.3; color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,.65));
    opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease;
}
.jgallery__item:hover .jgallery__cap { opacity: 1; transform: none; }

/* Lightbox simple */
.jglb { position: fixed; inset: 0; background: rgba(20,18,40,.92); display: none; align-items: center; justify-content: center; z-index: 9999; }
.jglb.is-open { display: flex; }
.jglb img { max-width: 92vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.jglb__close, .jglb__nav { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer;
    width: 48px; height: 48px; border-radius: 50%; font-size: 1.3rem; display: grid; place-items: center; transition: background .2s ease; }
.jglb__close:hover, .jglb__nav:hover { background: rgba(255,255,255,.28); }
.jglb__close { top: 22px; right: 22px; }
.jglb__nav { top: 50%; transform: translateY(-50%); }
.jglb__nav--prev { left: 22px; } .jglb__nav--next { right: 22px; }
@media (max-width: 600px) { .jglb__nav { width: 40px; height: 40px; } }
