/* =========================================
   ESTILOS DE GALERÍA "WOW"
   ========================================= */

/* Contenedor */
.gallery-wrapper {
    background-color: #f8f9fa;
    min-height: 100vh;
    padding: 140px 20px 80px 20px;
    text-align: center;
}

/* Encabezado */
.gallery-header h1 {
    font-family: 'Great Vibes', cursive; /* Cursiva elegante como el menú */
    font-size: 4.5rem;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 400;
}

.gallery-header p {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 50px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Filtros */
.gallery-filters {
    margin-bottom: 50px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-btn {
    background: transparent;
    border: 2px solid #ccc;
    padding: 10px 30px;
    border-radius: 50px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    transition: all 0.4s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Poppins', sans-serif;
}

.filter-btn:hover, .filter-btn.active {
    background-color: #0f172a; /* Azul oscuro */
    color: #fff;
    border-color: #0f172a;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.3);
}

/* Grid Masonry (Estilo Pinterest automático) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    grid-auto-flow: dense; /* Ayuda a rellenar huecos */
}

/* Items de Galería */
.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 300px; /* Altura base */
}

/* Variación de tamaños para efecto mosaico (Opcional, requiere ajustar HTML para clases span) 
   Por ahora dejamos altura fija para consistencia en carga automática */

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

/* Efecto Hover */
.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    z-index: 2;
}

.gallery-item:hover img {
    transform: scale(1.15);
}

/* Overlay (Capa oscura con texto) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 30px;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.overlay-text {
    text-align: center;
    color: white;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.gallery-item:hover .overlay-text {
    transform: translateY(0);
}

.overlay-text h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.overlay-text span {
    font-size: 0.9rem;
    font-weight: 300;
    color: #ffd700; /* Dorado */
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* LIGHTBOX (Visor) */
.lightbox {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    border-radius: 5px;
    box-shadow: 0 0 50px rgba(255,255,255,0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.show .lightbox-content {
    transform: scale(1);
}

#lightbox-caption {
    margin-top: 20px;
    color: #ccc;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #ffd700;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-header h1 { font-size: 3rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .gallery-item { height: 200px; }
}