/* ==========================================================================
   News Lightbox — clic en imágenes del detalle de noticia para ampliarlas
   a pantalla completa (imagen completa, sin recorte).
   ========================================================================== */

/* Cursor de zoom en las imágenes ampliables */
.article-featured-image,
.article-body img,
.gallery-item img {
    cursor: zoom-in;
}

/* Overlay de pantalla completa */
.news-lightbox {
    position: fixed;
    inset: 0;
    /* Máximo: por encima del header del sitio (10000) y widgets flotantes
       (chat "Ideas Fuerza", tooltips 100000). Convención del proyecto para
       lightboxes/modales full-screen (ver indagacion-lightbox.css). */
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    cursor: zoom-out;
}

.news-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

/* Imagen ampliada: completa dentro del viewport, sin recortes */
.news-lightbox__img {
    max-width: 95vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.96);
    transition: transform 0.2s ease;
    cursor: default;
}

.news-lightbox.is-open .news-lightbox__img {
    transform: scale(1);
}

/* Pie de imagen (usa el alt/caption si existe) */
.news-lightbox__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1.25rem;
    margin: 0 auto;
    max-width: 90vw;
    padding: 0 1rem;
    text-align: center;
    color: #ffffff;
    font-size: 0.9rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* Oculta el pie cuando no hay texto */
.news-lightbox__caption:empty {
    display: none;
}

/* Botón cerrar */
.news-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.news-lightbox__close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Evita el scroll del fondo mientras el lightbox está abierto */
body.news-lightbox-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .news-lightbox {
        padding: 1rem;
    }

    .news-lightbox__img {
        max-width: 100vw;
        max-height: 85vh;
    }
}
