/* ==========================================================================
   SECCIÓN DE PROYECTOS (Grid de Tarjetas en Zig-Zag)
   ========================================================================== */
.proyectos-section {
    padding: 80px 4vw 100px 4vw;
    background-color: #ffffff;
}

.proyectos-grid {
    display: flex;
    flex-direction: column;
    gap: 80px; /* Espaciado entre cada proyecto */
    max-width: 1200px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   TARJETA INDIVIDUAL (Estructura Base / Móvil)
   -------------------------------------------------------------------------- */
.proyecto-card {
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.4s ease;
}

.proyecto-card:hover {
    transform: translateY(-5px);
}

/* Contenedor de la foto */
.proyecto-img-wrapper {
    width: 100%;
    height: 350px;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* El filtro oscuro por encima de la foto*/
.proyecto-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.15); 
    transition: background 0.6s ease;
    z-index: 1;
    pointer-events: none; /* Previene bloqueo de clics */
}

/* Al pasar el mouse, el filtro desaparece e ilumina la foto */
.proyecto-card:hover .proyecto-img-wrapper::after {
    background: rgba(0, 0, 0, 0.0);
}

.proyecto-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.proyecto-card:hover .proyecto-img-wrapper img {
    transform: scale(1.05); 
}

/* --------------------------------------------------------------------------
   Textos y Fondo Geométrico de la tarjeta
   -------------------------------------------------------------------------- */
.proyecto-info {
    width: 100%;
    padding: 40px 30px;
    
    background: radial-gradient(rgba(0, 0, 0, 0.08) 15%, transparent 16%) 0 0,
                radial-gradient(rgba(0, 0, 0, 0.08) 15%, transparent 16%) 8px 8px,
                radial-gradient(rgba(255, 255, 255, 0.9) 15%, transparent 20%) 0 1px,
                radial-gradient(rgba(255, 255, 255, 0.9) 15%, transparent 20%) 8px 9px;
    background-color: #f0f2f5;
    background-size: 16px 16px;
    
    border-radius: 0 0 12px 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    border-bottom: 5px solid var(--color-red, #e20613);
    
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Tipografías internas */
.proyecto-cliente {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--color-red, #e20613);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.proyecto-titulo {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-darker, #111111);
    margin-bottom: 15px;
    line-height: 1.2;
}

.proyecto-desc {
    color: #555555;
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
}

/* --------------------------------------------------------------------------
   EL BOTÓN DINÁMICO (Llamado a la acción)
   -------------------------------------------------------------------------- */
.cta-link {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--color-red, #e20613);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    text-decoration: none; /* Aseguramos que no tenga subrayado nativo */
    transition: transform 0.3s ease, color 0.3s ease;
    cursor: pointer;
    outline: none;
}

/* Efecto de foco para accesibilidad por teclado */
.cta-link:focus-visible {
    color: var(--color-darker, #111111);
    text-decoration: underline;
}

.proyecto-card:hover .cta-link {
    transform: translateX(8px);
}

/* --------------------------------------------------------------------------
   RESPONSIVE: PANTALLAS GRANDES (El Efecto Superposición en Z)
   -------------------------------------------------------------------------- */
@media (min-width: 900px) {
    .proyecto-card {
        flex-direction: row;
        align-items: center; 
    }
    
    .proyecto-img-wrapper {
        width: 60%; 
        height: 500px; 
        border-radius: 12px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    }
    
    .proyecto-info {
        width: 45%;
        min-height: 350px;
        margin-left: -8%;  /* Superposición izquierda */
        z-index: 2; 
        border-radius: 12px; 
        padding: 60px 50px;
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15); 
        border-bottom: none;
        border-right: 5px solid var(--color-red, #e20613);
    }
    
    /* Inversión Z para filas pares */
    .proyecto-card:nth-child(even) {
        flex-direction: row-reverse;
    }
    
    .proyecto-card:nth-child(even) .proyecto-info {
        margin-left: 0;
        margin-right: -8%; /* Superposición derecha */
        border-right: none;
        border-left: 5px solid var(--color-red, #e20613);
    }
}