/* ==========================================================================
   ARQUITECTURA LIMPIA - VISTA: NUESTRO EQUIPO (RODRIGUEZ & PEÑA)
   ========================================================================== */

/* 1. RESET Y BASES DE VISTA */
.content-wrapper {
    padding: 140px 0 80px 0; /* Espacio óptimo para el navbar flotante */
}

/* 2. TIPOGRAFÍAS Y ENCABEZADOS */
.section-title {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.section-subtitle {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-light);
    font-size: 1.1rem;
}

.sub-section-title {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 2.2rem;
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
    z-index: 1;
}

.sub-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #c5a059;
    border-radius: 2px;
}

/* ==========================================================================
   ⚡ MOTOR DE SUPERPOSICIÓN PREMIUM OPTIMIZADO (ESCRITORIO)
   ========================================================================== */

/* Contenedor Estructural */
.team-card-wrapper {
    position: relative;
    width: 100%;
    max-width: 265px; 
    height: 350px;    
    perspective: 1000px;
    z-index: 10;
}

/* Tarjeta Interna: Cristal Seda unificado */
.team-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 350px;
    max-height: 350px;
    
    background: rgba(235, 240, 245, 0.45) !important; 
    backdrop-filter: blur(20px) !important;  
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important; 
    border-radius: 20px !important; 
    box-shadow: 0 10px 30px rgba(18, 27, 37, 0.04) !important;
    
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 5;
    
    /* ANIMACIÓN DE CIERRE CORREGIDA Y FLUIDA EN ESCRITORIO */
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s ease, 
                background-color 0.4s ease,
                border-color 0.4s ease !important;

    transform: translateZ(0);              
        -webkit-transform: translateZ(0);          
        backface-visibility: hidden;               
        -webkit-backface-visibility: hidden;       
        will-change: max-height, box-shadow;       
    
}

/* Cabecera de la Tarjeta */
.card-head {
    height: 85px; 
    background: transparent !important; 
    position: relative;
    overflow: visible;  
}

.circle-overlay {
    position: absolute;
    width: 140px;
    height: 140px;
    background: rgba(18, 27, 37, 0.03); 
    border-radius: 50%;
    top: -30px;
    right: -30px;
}

/* Foto Redonda */
.photo-container {
    position: absolute;
    bottom: -35px; 
    left: 50%;
    transform: translateX(-50%);
    width: 105px; 
    height: 105px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.9); 
    background: var(--white);
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(18, 27, 37, 0.08);
    z-index: 10;
    display: flex;       
    align-items: center;
    justify-content: center;
}

.photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;  
    display: block;
}

/* Bloque de Información */
.team-info {
    margin-top: 45px;   
    padding: 0 20px 20px 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team-info h3 {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 1.18rem; 
    font-weight: 700;
    color: var(--primary-color) !important;
    margin-bottom: 6px;
}

/* Bloque Oculto Biográfico (Desktop) */
.rp-extra-bio {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    width: 100%;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.3s ease;
}

/* Textos Biográficos Interiores */
.bio-text p {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.84rem;
    color: #4a5568 !important; 
    line-height: 1.55;
    font-weight: 500;
    text-align: left;
    margin-bottom: 12px;
}

.stack-divider {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    color: #c5a059; 
    font-weight: 600;
    border-top: 1px solid rgba(18, 27, 37, 0.08);
    padding-top: 12px;
    margin-top: 8px;
    text-align: center;
}

/* ==========================================================================
   ⚡ EFECTO HOVER PREMIUM (SÓLO ACTIVO EN ESCRITORIO)
   ========================================================================== */
@media (min-width: 769px) {
    .team-card-wrapper:hover {
        z-index: 900 !important; 
    }

    .team-card-wrapper:hover .team-card {
        max-height: 1000px !important; 
        z-index: 900 !important; 
        background: rgba(255, 255, 255, 0.98) !important; 
        border-color: rgba(197, 160, 89, 0.4) !important; 
        box-shadow: 0 25px 50px rgba(18, 27, 37, 0.12) !important; 
        transform: none !important; 
    }

    .team-card-wrapper:hover .rp-extra-bio {
        max-height: 700px;
        opacity: 1;
        margin-top: 12px;
    }
}

/* ==========================================================================
   BADGES DE ROLES
   ========================================================================== */
.badge-role {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.70rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 30px;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif;
}

.badge-role.role-lawyer {
    background-color: rgba(197, 160, 89, 0.12);
    color: #a47c32;
    border: 1px solid rgba(197, 160, 89, 0.2);
}

.badge-role.role-ops {
    background-color: rgba(44, 62, 80, 0.08);
    color: #2c3e50;
    border: 1px solid rgba(44, 62, 80, 0.15);
}

.badge-role.role-tech {
    background-color: rgba(0, 119, 181, 0.08);
    color: #0077b5;
    border: 1px solid rgba(0, 119, 181, 0.15);
}

/* ==========================================================================
   GRIDS DE DISTRIBUCIÓN PREMIUM
   ========================================================================== */
.team-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px 24px;
    justify-items: center;
    align-items: stretch;
    margin-top: 25px;
    width: 100%;
    position: relative;
}

.team-bottom-row-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 24px;
    justify-items: center;
    align-items: stretch;
    margin-top: 25px;
    width: 100%;
    grid-column: 1 / -1;
    max-width: 1020px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

/* ==========================================================================
   SECCIÓN SOCIO FUNDADOR (DON JORGE - ORIGINAL E INTACTO)
   ========================================================================== */
.founder-honor-section {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 50px auto;
    padding: 30px;
    border-radius: 20px;
}

.founder-avatar-wrapper {
    width: 190px;
    height: 190px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    position: relative;
    padding: 6px;
    background: linear-gradient(135deg, var(--primary-color), #c5a059);
    box-shadow: 0 12px 30px rgba(18, 27, 37, 0.12);
}

.founder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--white);
    display: block;
}

.founder-name {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.founder-bio {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.98rem;
    line-height: 1.7;
    color: #4a5568;
    margin: 15px auto 0 auto;
    font-weight: 500;
}

/* ==========================================================================
   📱 RESPONSIVIDAD MÓVIL ABSOLUTA (SIN INTERACCIONES NI COLAPSOS)
   ========================================================================== */
@media (max-width: 1200px) and (min-width: 769px) {
    .team-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 35px 24px;
    }
    .team-bottom-row-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
    }
}

@media (max-width: 768px) {
    .founder-honor-section {
        margin-bottom: 40px !important;
        height: auto !important;
    }

    .team-grid-container, 
    .team-bottom-row-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 35px !important;
        margin-top: 30px !important;
        padding: 0 10px;
    }

        /* 2. Destruimos alturas fijas: Las tarjetas ahora ocupan su espacio real */
    .team-card-wrapper {
        max-width: 100% !important;
        height: auto !important; /* Altura orgánica según su contenido interno */
        margin-bottom: 0 !important;
        perspective: none !important;
    }

    .team-card {
        position: relative !important; /* Vuelve al flujo normal, no flota ni pisa a nadie */
        height: auto !important;
        min-height: min-content !important;
        max-height: none !important; /* Desbloqueado */
        
        background: rgba(255, 255, 255, 0.98) !important; /* Sólido y ultra legible */
        border-color: rgba(18, 27, 37, 0.08) !important;
        box-shadow: 0 10px 30px rgba(18, 27, 37, 0.05) !important;
        transition: none !important; /* Cero brincos en móvil */
    }

    /* 3. Forzamos que la biografía esté 100% visible por defecto */
    .rp-extra-bio {
        max-height: none !important;
        opacity: 1 !important;
        margin-top: 15px !important;
        display: block !important;
    }

    /* 4. Neutralización absoluta de Hovers/Taps en teléfonos */
    .team-card-wrapper:hover {
        z-index: 1 !important;
    }

    .team-card-wrapper:hover .team-card {
        max-height: none !important;
        min-height: min-content !important;
        background: rgba(255, 255, 255, 0.98) !important;
        border-color: rgba(18, 27, 37, 0.08) !important;
        box-shadow: 0 10px 30px rgba(18, 27, 37, 0.05) !important;
        transform: none !important;
    }

    .team-card-wrapper:hover .rp-extra-bio {
        max-height: none !important;
        opacity: 1 !important;
    }

    .founder-name {
        font-size: 1.8rem;
    }
}