/* ========================================================
   ESTILOS INTERNOS DE ÁLBUMES - Misión Morada de Paz
   ======================================================== */

/* --- REGLA UNIVERSAL --- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0; padding: 0;
    background-color: #f4f7f6; /* Fondo gris claro, resalta las fotos */
    color: #333;
}

/* --- MENÚ SUPERIOR SIMPLIFICADO --- */
.barra-navegacion {
    position: sticky; top: 0;
    background-color: #ffffff;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.8rem 2rem; box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 1000;
}
.barra-navegacion .logo { display: flex; align-items: center; gap: 10px; font-weight: bold; font-size: 1.2rem; color: #4CAF50; text-decoration: none; }
.logo-img { height: 60px; width: auto; object-fit: contain; }
.enlaces-menu { list-style: none; margin: 0; padding: 0; }
.enlaces-menu a { text-decoration: none; color: #555; font-weight: 500; transition: color 0.3s ease; }
.enlaces-menu a:hover { color: #4CAF50; }

/* --- CONTENIDO DEL ÁLBUM --- */
.encabezado-album { 
    padding: 4rem 1rem 4rem 1rem; 
    max-width: 900px; 
    margin: 0 auto; 
}

.encabezado-album h1 { 
    color: #4CAF50; 
    margin-bottom: 1rem; 
    border-bottom: 2px solid #ddd;
    padding-bottom: 0.5rem;
}

.texto-album p { 
    color: #555; 
    line-height: 1.8; 
    margin-bottom: 1rem; 
    text-align: justify; 
}

/* --- CUADRÍCULA ASIMÉTRICA (MOSAICO DE FOTOS) --- */
.mosaico-detalle {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 250px;
    gap: 15px;
    margin-top: 3rem;
}

/* Nuevo contenedor que encierra a cada foto */
.item-galeria {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden; /* Evita que el zoom se salga de la caja */
    cursor: pointer; /* Muestra la manito */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.item-galeria img {
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block;
    transition: transform 0.4s ease; /* Transición suave para el zoom de fondo */
}

/* La capa negra y el icono de lupa con el signo más (dibujado en código) */
.item-galeria::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.6); /* Color negro al 60% de opacidad */
    
    /* Dibuja un ícono SVG de lupa con un "+" directamente desde el CSS */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50px; /* Tamaño del ícono */
    
    opacity: 0; /* Totalmente transparente por defecto */
    transition: opacity 0.3s ease;
    
    /* IMPORTANTE: Permite que el clic "atraviese" la capa negra y toque la imagen para que tu Lightbox JS siga funcionando sin cambios */
    pointer-events: none; 
}

/* Efectos al pasar el ratón (Hover) */
.item-galeria:hover::after {
    opacity: 1; /* Hace visible la capa negra y la lupa */
}

.item-galeria:hover img { 
    transform: scale(1.05); /* Pequeño zoom a la foto detrás de la capa */
}

/* La primera foto destaca ocupando más espacio en pantallas grandes */
@media (min-width: 768px) {
    .foto-destacada-mosaico { 
        grid-column: span 2; 
        grid-row: span 2; 
    }
}

/* Efectos al pasar el ratón (Hover) */
.item-galeria:hover::after {
    opacity: 1; /* Hace visible la capa negra y la lupa */
}

.item-galeria:hover img { 
    transform: scale(1.05); /* Pequeño zoom a la foto detrás de la capa */
}

/* La primera foto destaca ocupando más espacio en pantallas grandes */
@media (min-width: 768px) {
    .foto-destacada-mosaico { 
        grid-column: span 2; 
        grid-row: span 2; 
    }
}

/* --- LIGHTBOX (PANTALLA COMPLETA) --- */
.lightbox {
    display: none; /* Oculto por defecto */
    position: fixed; 
    z-index: 2000; /* Asegura que esté por encima de todo */
    left: 0; 
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.9); /* Fondo negro casi opaco */
    justify-content: center; 
    align-items: center;
}

.lightbox-contenido {
    max-width: 90%; 
    max-height: 90%; 
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5); 
    animation: zoomIn 0.3s ease; /* Animación de entrada */
}

@keyframes zoomIn { 
    from { transform: scale(0.8); opacity: 0; } 
    to { transform: scale(1); opacity: 1; } 
}

.cerrar-lightbox {
    position: absolute; 
    top: 20px; 
    right: 35px; 
    color: #f1f1f1; 
    font-size: 40px;
    font-weight: bold; 
    cursor: pointer; 
    transition: color 0.3s ease;
}

.cerrar-lightbox:hover { 
    color: #4CAF50; /* Cambia a verde al pasar el ratón */
}

/* --- DISEÑO RESPONSIVO CELULARES --- */
@media (max-width: 768px) {
    .barra-navegacion { flex-direction: column; align-items: center; padding: 1rem 0.5rem; gap: 15px; }
    .barra-navegacion .logo { justify-content: center; width: 100%; margin-bottom: 5px; }
    .encabezado-album h1 { font-size: 1.8rem; }
    .mosaico-detalle { grid-auto-rows: 200px; } /* Fotos un poco más pequeñas en celular */
}