/* =========================================
   IMPORTACIÓN DE FUENTES
   ========================================= */
@font-face {
    font-family: 'Avenir Next';
    src: url('https://beltatelier.co/wp-content/uploads/2025/07/avenir-next-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Avenir Next Ultralight';
    src: url('https://beltatelier.co/wp-content/uploads/2025/07/AvenirNextCyr-UltraLight.ttf') format('truetype');
    font-weight: 275;
    font-style: normal;
}

@font-face {
    font-family: 'Utopia Std';
    src: url('https://beltatelier.co/wp-content/uploads/2025/07/UtopiaStd-Italic.ttf') format('truetype');
    font-weight: 400; /* Asumiendo 400 ya que no definiste un 275 para Utopia especificamente en reglas generales pero el archivo se llama Italic */
    font-style: italic;
}

:root {
    --bg-accent: #c2b7a9;
    --transition-speed: 0.8s;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Contenedor Principal */
.team-container {
    display: flex;
    width: 100%;
    height: 100vh; /* Ocupa toda la altura de la pantalla */
    overflow: hidden;
    gap: 3px; /* <--- Agrega esto. Puedes subirlo a 15px o 20px según tu gusto */
    font-family: 'Avenir Next', Arial, sans-serif;
}

/* Variación DARK */
.team-container.btc-mode-dark {
    background-color: #000000;
}

/* Variación LIGHT */
.team-container.btc-mode-light {
    background-color: #ffffff;
}

/* Ajuste opcional: Si es light, quizás quieras que los paneles cerrados tengan un fondo gris muy claro en vez de #111 */
.team-container.btc-mode-light .member-panel {
    background-color: #ffffff;
}

/* Forzamos la altura para evitar que Elementor la ponga en 'auto' */
.team-container img.bg-image {
    position: absolute;
    top: 3%; /* <--- CAMBIO: Crea el aire superior */
    left: 0;
    width: 100% !important;
    height: 97% !important; /* <--- CAMBIO: Ajusta la altura para que no desborde abajo */
    object-fit: cover;
    object-position: top center; /* <--- CAMBIO: Mantiene la cabeza visible al bajar la foto */
    filter: grayscale(100%);
    transition: all var(--transition-speed) var(--ease);
    z-index: 1;
    border: none !important; /* Por si acaso Elementor añade bordes */
}

.member-panel {
    position: relative;
    flex: 1;
    height: 100%;
    transition: flex var(--transition-speed) var(--ease), 
                background-color var(--transition-speed) var(--ease);
    cursor: pointer;
    overflow: hidden;
    background-color: #111;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 40%, transparent 100%); /* ESTO AÑADE LA SOMBRA INFERIOR */
}

.member-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%; /* Altura de la sombra */
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    z-index: 1; /* Por encima de la imagen */
    pointer-events: none;
    transition: opacity var(--transition-speed) var(--ease);
}

/* Ocultar la sombra cuando el panel está activo (porque el fondo se vuelve claro) */
.member-panel.active::after {
    opacity: 0;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: all var(--transition-speed) var(--ease);
    z-index: 1;
}

.member-panel.active .bg-image {
    filter: grayscale(0%);
    width: 45% !important; /* Forzamos el cambio de ancho al abrirse */
    height: 97% !important; /* <--- CAMBIO: Consistencia con el estado normal */
    left: 0;
    top: 3%; /* <--- CAMBIO: Consistencia con el estado normal */
    object-position: top center; /* <--- CAMBIO: Asegura el encuadre */
}

/* --- CONTENEDOR DE INFORMACIÓN --- */
.member-info {
    position: absolute;
    bottom: 5%; /* Distancia fija desde abajo para que todos se alineen igual */ 
    left: 60%;
    transform: translateX(-50%) rotate(0deg);
    z-index: 3;
    transition: all var(--transition-speed) var(--ease);
    pointer-events: none;
    width: 85%; /* Un poco más ancho para que los cargos largos quepan mejor */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;/* Alineamos al final para que el 'piso' sea el mismo */
    align-items: flex-start;
    text-align: left;
    white-space: normal;
}

.text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end; /* Alinea el contenido hacia la base */
    width: 100%;
}

/* --- TIPOGRAFÍA PERSONALIZADA --- */

.full-name {
    display: flex;
    flex-direction: column; /* Apellido debajo del nombre */
    line-height: 1.0; /* Un poco más apretado para elegancia */
    margin-bottom: 5px;
}

/* Nombre */
.btc-name {
    font-family: 'Avenir Next', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: min(2.083vw, 40px);
    color: #353535; /* Color oscuro para cuando está activo/fondo claro */
    letter-spacing: 0.15em; /* 15% */
    text-transform: uppercase;
}

/* Apellido */
.btc-lastname {
    font-family: 'Avenir Next Ultralight', sans-serif;
    font-weight: 275;
    font-style: normal;
    font-size: min(2.083vw, 40px);
    color: #353535;
    letter-spacing: 0.15em; /* 15% */
    text-transform: uppercase;
}

/* Profesión */
.role {
    font-family: 'Utopia Std', serif;
    font-weight: 400;
    font-style: italic;
    font-size: min(1vw, 24px); /* Un pelín más pequeña para que quepa mejor */
    color: #C5B9AC;
    margin: 5px 0 0;
    line-height: 1.2; /* Añadido para legibilidad en multilínea */
    display: block;   /* Asegura que se comporte como bloque */
}

/* Descripción */
.bio {
    font-family: 'Avenir Next', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: min(1.146vw, 22px);
    color: #ffffff; /* Blanco para asegurar legibilidad en overlay oscuro o ajustar según fondo */
    
    max-width: 380px;
    margin-top: 25px;
    line-height: 1.5;
    opacity: 0;
    height: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    white-space: normal; /* Permitir salto de línea en la bio */
}

/* Override de colores cuando NO está activo (fondo negro) */
.member-panel:not(.active) .btc-name,
.member-panel:not(.active) .btc-lastname {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* --- LÓGICA DE ESTADOS Y ANIMACIÓN --- */

/* 1. Hover general */
.member-panel:hover .bg-image {
    filter: grayscale(0%);
}

/* 2. Cuando hay uno activo, los inactivos se giran */
.team-container.has-active .member-panel:not(.active) .member-info {
    transform: translateX(-50%) translateY(-100px) rotate(-90deg);
}

/* 3. Hover sobre inactivo cuando ya hay uno activo */
.team-container.has-active .member-panel:not(.active):hover {
    flex: 1.5; 
}
.team-container.has-active .member-panel:not(.active):hover .member-info {
    transform: translateX(-50%) translateY(0) rotate(0deg);
    width: 100%;
}

/* 4. PANEL ACTIVO (Abierto) */
.member-panel.active {
    flex: 5;
    background-color: var(--bg-accent) !important; /* Forzamos el color beige al abrirse */;
}

.member-panel.active .bg-image {
    filter: grayscale(0%);
    width: 45%; /* Imagen a la izquierda */
    left: 0;
}

.member-panel.active .member-info {
    left: 72.5%; 
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%); /* Centrado vertical y horizontal en el bloque derecho */
    width: 40%;
}

/* =======================================================
   COLORES DE TEXTO PARA EL PANEL ACTIVO (SELECCIONADO)
   ======================================================= */

/* 1. Para cambiar el NOMBRE (Ej: JORGE) */
.member-panel.active .btc-name {
    color: #ffffff;  /* Pon aquí el color que desees */
}

/* 2. Para cambiar el APELLIDO (Ej: SILVA) */
.member-panel.active .btc-lastname {
    color: #ffffff;  /* Pon aquí el color que desees */
}

/* 3. Para cambiar la PROFESIÓN (Ej: Estimation Leader) */
.member-panel.active .role {
    color: #ffffff; /* Pon aquí el color que desees */
}

/* 4. Para cambiar la DESCRIPCIÓN (El párrafo largo) */
.member-panel.active .bio {
    color: #ffffff; /* Pon aquí el color que desees */
}

/* Asegurar colores en el panel activo (fondo claro) */
.member-panel.active .btc-name,
.member-panel.active .btc-lastname {
    color: #353535;
    text-shadow: none;
}

.member-panel.active .bio {
    opacity: 1;
    height: auto;
    visibility: visible;
    color: #ffffff; /* Según tu especificación */
    transition: opacity 0.5s ease 0.5s;
}

/* Esto sobreescribe el fondo blanco/negro solo para el que está abierto */
.team-container.btc-mode-light .member-panel.active,
.team-container.btc-mode-dark .member-panel.active {
    background-color: var(--bg-accent);
}

/* --- RESPONSIVE MOBILE --- */
/* =======================================================
   ADAPTACIÓN EXCLUSIVA PARA MÓVILES (PANTALLAS PEQUEÑAS)
   ======================================================= */
@media (max-width: 768px) {
    .team-container {
        flex-direction: column; /* Cambia de horizontal a vertical */
        height: auto;           /* Permite que el contenedor crezca con el contenido */
        min-height: 100vh;
        gap: 10px;              /* Espaciado entre miembros */
        overflow-y: visible;    /* Permite el scroll natural */
        padding: 10px;
    }

    .member-panel {
        width: 100%;
        min-height: 150px;      /* Altura cuando está cerrado */
        flex: none;             /* Desactiva el comportamiento flex-grow del escritorio */
        transition: min-height 0.6s var(--ease);
        border-radius: 8px;     /* Bordes redondeados para un look más moderno */
    }

    /* Ajuste de la imagen en móvil */
    .member-panel .bg-image {
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        opacity: 0.7;           /* Un poco más clara para ver el nombre */
        filter: grayscale(0%);  /* En móvil mejor mostrar color siempre */
    }

    /* Información del miembro */
    .member-info {
        /* position: relative; */
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        transform: none !important; /* Eliminamos las rotaciones de escritorio */
        width: 100% !important;
        padding: 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
        pointer-events: none;
        box-sizing: border-box;
    }

    /* Tipografías en móvil */
    .btc-name, .btc-lastname {
        font-size: 24px !important; /* Tamaño legible en móvil */
        color: #ffffff !important;
        text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
    }

    .role {
        font-size: 16px !important;
        color: #eee !important;
    }

    /* ESTADO ACTIVO (Cuando el usuario toca un miembro) */
    .member-panel.active {
        min-height: 450px;      /* Se expande para mostrar la biografía */
        background-color: var(--bg-accent) !important;
    }

    .member-panel.active .bg-image {
        width: 100% !important; /* Esto anula el 45% del escritorio */
        left: 0;
        top: 0 !important;      /* Opcional: para que ocupe todo el panel en móvil */
        height: 100% !important; /* Opcional: para cubrir todo el fondo */
    }

    .member-panel.active .member-info {
        /* CAMBIO: De flex-start a flex-end para que la bio también quede abajo */
        justify-content: flex-end !important;
        padding-bottom: 30px; /* Espacio extra al final para que no toque el borde */
        padding-top: 0;      /* Quitamos el padding superior previo */
    }

    .member-panel.active .bio {
        opacity: 1;
        visibility: visible;
        height: auto;
        margin-top: 15px;
        font-size: 14px;
        line-height: 1.4;
        color: #ffffff;
    }

    /* Desactivar efectos de hover de escritorio que ensucian la experiencia táctil */
    .team-container.has-active .member-panel:not(.active) .member-info {
        transform: none !important;
        opacity: 0.6;
    }
    
    .team-container.has-active .member-panel:not(.active):hover {
        flex: none; 
    }
}