:root {
    --primary-color: #0046B5;
}

/* Sección de Galería */
.gallery-section {
    padding: 80px 0;
    background-color: var(--light-gray);
    gap: 2rem;
    padding: 4rem 6rem;
}

.gallery-container {
    width: 100%;
    max-width: 1400px;
    margin: 2rem auto;
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Grid principal */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
    min-height: 600px;
}

/* Celda de título */
.title-cell {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.title-cell h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: white;
}

.title-cell p {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Celdas de proyecto */
.project-cell {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-cell:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.project-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Imágenes de proyecto */
.project-image {
    height: 60%;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-cell:hover .project-image img {
    transform: scale(1.05);
}

/* Detalles del proyecto */
.project-details {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-details h3 {
    color: var(--text-color);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.project-details p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Media Queries */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto auto;
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }

    .title-cell {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .gallery-section {
        padding: 2rem 1rem; /* Reducido al mínimo para maximizar espacio */
    }

    .gallery-container {
        padding: 0 8px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .title-cell {
        text-align: center;
        align-items: center;
        padding: 20px;
    }

    .title-cell h2 {
        font-size: 1.8rem;
    }

    /* Ajustes específicos para celdas de proyecto en móvil */
    .project-cell {
        min-height: 300px; /* Altura mínima para mejor visualización */
    }

    .project-image {
        height: 55%; /* Ajustado para mejor proporción en móvil */
    }

    .project-details {
        padding: 12px;
    }

    .project-details h3 {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }

    .project-details p {
        font-size: 0.85rem;
    }
}
/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-cell {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.gallery-cell:nth-child(1) { animation-delay: 0.1s; }
.gallery-cell:nth-child(2) { animation-delay: 0.2s; }
.gallery-cell:nth-child(3) { animation-delay: 0.3s; }
.gallery-cell:nth-child(4) { animation-delay: 0.4s; }
.gallery-cell:nth-child(5) { animation-delay: 0.5s; }
.gallery-cell:nth-child(6) { animation-delay: 0.6s; }
.gallery-cell:nth-child(7) { animation-delay: 0.7s; }
.gallery-cell:nth-child(8) { animation-delay: 0.8s; }