/**
 * Estilos para la página de Trabajos (Galería)
 * Bordador Errante
 */

/* ===== SECCIÓN GALERÍA ===== */
.gallery {
    padding-top: 7rem;
    padding-bottom: 2rem;
    text-align: center;
    background-color: #fafafa;
}

.gallery .section-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* ===== FILTROS ===== */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 1.5rem 0 2rem;
}

.filter-btn {
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #556b5d;
    color: #556b5d;
}

.filter-btn.active {
    background: #556b5d;
    color: white;
    border-color: #556b5d;
}

/* ===== CONTENEDOR GALERÍA ===== */
.gallery-container {
    max-width: 1300px;
    margin: 0 auto 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0 30px;
}

/* ===== ITEMS DE GALERÍA ===== */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    aspect-ratio: 4/3;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;

    /* Optimización de renderizado */
    content-visibility: auto;
    contain-intrinsic-size: 280px 210px;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

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

/* ===== OVERLAY ===== */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-body);
}

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

/* ===== ESTADO VACÍO ===== */
.gallery .no-trabajos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .gallery {
        padding-top: 6rem;
    }

    .gallery .section-title {
        font-size: 2rem;
    }

    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 0 15px;
    }

    .gallery-item {
        aspect-ratio: 1/1;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        grid-template-columns: 1fr;
    }

    .gallery-item {
        aspect-ratio: 4/3;
    }
}