/* ── MASONRY GRID ── */
.mgp-masonry {
    column-gap: var(--mgp-gap, 12px);
}

/* ── ITEM ── */
.mgp-item {
    break-inside: avoid;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    /* initial hidden state — JS adds .mgp-visible */
}

/* --- Estado inicial: todas ocultas hasta que JS las revele --- */
/* (excepto animación "none") */
.mgp-item:not(.mgp-anim-none) {
    opacity: 0;
}

/* Transformaciones iniciales por tipo de animación */
.mgp-anim-fade-up     { transform: translateY(50px); }
.mgp-anim-fade-down   { transform: translateY(-50px); }
.mgp-anim-fade        { transform: none; }
.mgp-anim-zoom        { transform: scale(0.88); }
.mgp-anim-slide-left  { transform: translateX(-60px); }
.mgp-anim-slide-right { transform: translateX(60px); }
.mgp-anim-none        { opacity: 1 !important; transform: none !important; }

/* Cuando el JS añade .mgp-visible → animar a posición final */
.mgp-item.mgp-visible {
    opacity: 1 !important;
    transform: translate(0) scale(1) !important;
    transition-delay: var(--delay, 0ms);
}

/* ── IMAGEN ── */
.mgp-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.55s cubic-bezier(.25,.8,.25,1), filter 0.4s ease;
    filter: brightness(0.9) saturate(0.92);
}
.mgp-item:hover img {
    transform: scale(1.045);
    filter: brightness(1.02) saturate(1.08);
}

/* ── CAPTION OVERLAY ── */
.mgp-item-caption {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 32px 14px 14px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.mgp-item:hover .mgp-item-caption { opacity: 1; }

.mgp-cap-title {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: #fff;
}
.mgp-cap-text {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.7);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ LIGHTBOX ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mgp-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--lb-bg, rgba(5,5,5,.96));
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: var(--lb-font, 'Jost', sans-serif);
}
.mgp-lightbox.mgp-lb-open {
    display: flex;
    animation: mgpLbIn 0.28s ease;
}
@keyframes mgpLbIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Stage */
.mgp-lb-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(92vw, 1200px);
    animation: mgpImgIn 0.32s cubic-bezier(.25,.8,.25,1);
}
@keyframes mgpImgIn {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* Image */
.mgp-lb-img-wrap {
    position: relative;
    line-height: 0;
}
.mgp-lb-img {
    display: block;
    max-width: min(92vw, 1200px);
    max-height: 82vh;
    object-fit: contain;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 30px 80px rgba(0,0,0,.8);
}

/* Spinner */
.mgp-lb-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.2);
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.mgp-lb-spinner.active { opacity: 1; }
.mgp-lb-spinner::after {
    content: '';
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: var(--lb-accent, #c9a96e);
    border-radius: 50%;
    animation: mgpSpin .7s linear infinite;
}
@keyframes mgpSpin { to { transform: rotate(360deg); } }

/* Info */
.mgp-lb-info {
    margin-top: 14px;
    text-align: center;
}
.mgp-lb-title {
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--lb-accent, #c9a96e);
    margin: 0 0 4px;
}
.mgp-lb-caption {
    font-size: .72rem;
    color: rgba(255,255,255,.45);
    letter-spacing: .06em;
    margin: 0;
}

/* Close */
.mgp-lb-close {
    position: fixed;
    top: 20px; right: 22px;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;
    background: transparent;
    color: rgba(255,255,255,.8);
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
    z-index: 100000;
}
.mgp-lb-close:hover {
    border-color: var(--lb-accent, #c9a96e);
    background: rgba(255,255,255,.06);
    color: #fff;
}

/* Nav arrows */
.mgp-lb-nav {
    position: fixed;
    top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 4px;
    background: rgba(0,0,0,.4);
    color: rgba(255,255,255,.8);
    cursor: pointer;
    transition: border-color .2s, background .2s;
    z-index: 100000;
    user-select: none;
}
.mgp-lb-nav:hover {
    border-color: var(--lb-accent, #c9a96e);
    background: rgba(255,255,255,.07);
}
.mgp-lb-prev { left: 16px; }
.mgp-lb-next { right: 16px; }

/* Counter */
.mgp-lb-counter {
    position: fixed;
    bottom: 20px; left: 50%; transform: translateX(-50%);
    font-size: .66rem;
    letter-spacing: .3em;
    color: rgba(255,255,255,.3);
    z-index: 100000;
    font-family: var(--lb-font, 'Jost', sans-serif);
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .mgp-lb-prev { left: 8px; }
    .mgp-lb-next { right: 8px; }
    .mgp-lb-close { top: 14px; right: 14px; }
}
