/* =========================================================================
   GALERÍA BENTO GRID - ALTO IMPACTO (GSAP + CUSTOM LIGHTBOX)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

/* Ocultamiento del scrollbar principal de la página para la inmersión de galería */
body.gallery-page {
    background-color: #f8f9fc;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
}

/* ==========================================
   HERO SIMPLE BENTO
   ========================================== */
.bento-hero {
    height: 40vh;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #1a1c22 0%, #e63946 100%);
    color: white;
    padding: 0 20px;
    margin-top: 80px; /* Espacio para el Navbar */
}

.bento-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.bento-hero p {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
    max-width: 600px;
}

/* ==========================================
   BENTO GRID LAYOUT
   ========================================== */
.bento-section {
    padding: 80px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: 300px; /* Altura base */
    gap: 24px;
}

/* Clases Modificadoras para el ritmo Asimétrico (Bento Styles) */
.bento-col-2 {
    grid-column: span 2;
}
.bento-row-2 {
    grid-row: span 2;
}

/* Responsividad Estricta del Grid */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        grid-auto-rows: 250px;
    }
}

@media (max-width: 768px) {
    .bento-col-2 {
        grid-column: span 1;
    }
    .bento-row-2 {
        grid-row: span 1;
    }
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 350px;
    }
    .bento-hero {
        margin-top: 60px;
    }
}

/* ==========================================
   ITEMS & HOVER EFFECTS (CSS3)
   ========================================== */
.bento-item {
    position: relative;
    border-radius: 20px; /* Bordes redondeados requeridos */
    overflow: hidden;
    cursor: pointer;
    /* Sombras suaves de varias capas (box-shadow) */
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 20px 25px -5px rgba(0, 0, 0, 0.05);
    
    /* Inicia oculto para animación GSAP (stagger de abajo hacia arriba) */
    opacity: 0; 
    transform: translateY(60px); 
    background: #000; /* Fondo negro puro detrás de la imagen por si acaso */
}

.bento-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), filter 0.6s ease;
    filter: brightness(0.9); /* Ligeramente apagado por defecto */
}

/* Efecto de Hover: Ligero escalado y brillo */
.bento-item:hover .bento-img {
    transform: scale(1.08);
    filter: brightness(1.15);
}

/* Efecto Glassmorphism para el Titulo */
.glass-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    /* Efecto Glass puro */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    
    transform: translateY(100%); /* Oculto inicialmente bajándolo */
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none; /* Que no bloquee clicks */
}

.bento-item:hover .glass-overlay {
    transform: translateY(0);
}

.glass-title {
    color: #fff;
    margin: 0 0 5px 0;
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6); 
    font-family: 'Montserrat', sans-serif;
}

.glass-desc {
    color: rgba(255,255,255,0.95);
    margin: 0;
    font-size: 0.95rem;
    font-weight: 400;
    text-shadow: 0 1px 5px rgba(0,0,0,0.6);
}

/* ==========================================
   CUSTOM LIGHTBOX (CERO LIBRERÍAS)
   ========================================== */
.custom-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    /* Desenfoque elegante de fondo (backdrop-filter: blur) */
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.custom-lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.custom-lightbox.active .lightbox-content {
    transform: scale(1);
    opacity: 1;
}

.lightbox-img {
    width: 100%;
    height: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.lightbox-caption {
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 15px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.lightbox-close {
    position: absolute;
    top: -20px;
    right: -40px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 2;
}

.lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
    color: #e63946;
}

@media (max-width: 768px) {
    .lightbox-close {
        top: -50px;
        right: 0;
    }
}

/* Modificadores al navbar para que empate bien */
body.gallery-page .action-container .btn-contact {
    background: var(--primary);
    color: white;
}
body.gallery-page .action-container .btn-contact:hover {
    background: var(--secondary);
}
