/* --- ESTILOS GENERALES --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700;900&display=swap');

* { box-sizing: border-box; }

body { font-family: 'Roboto', sans-serif; background-color: #f4f7f6; margin: 0; padding: 0; color: #333; }

/* HEADER */
header { background-color: white; padding: 10px 0; border-bottom: 4px solid #6BB5B9; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
nav { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; position: relative; }

/* LOGO */
.logo { 
    color: #3D719A; 
    font-weight: 900; 
    font-size: 1.3rem; 
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px; 
}
.logo img { height: 50px; width: auto; }

/* CARGO CENTRADO (Ahora no chocará con nada) */
.cargo-header {
    position: absolute; 
    left: 50%;
    transform: translateX(-50%); 
    color: #6BB5B9;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 1px;
    text-align: center;
    white-space: nowrap; 
    z-index: 5; /* Aseguramos que esté por encima por si acaso */
}

/* NUEVO CONTENEDOR DERECHO (Agrupa Idioma + Menú) */
.nav-right {
    display: flex;
    align-items: center;
    gap: 25px; /* Espacio entre ES|VA y el menú */
    z-index: 10; /* Accesible siempre */
    background-color: white; /* Fondo blanco para tapar posibles cruces */
}

/* SELECTOR DE IDIOMA */
.lang-switch {
    display: flex;
    gap: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #888;
    cursor: pointer;
}

.lang-switch span {
    transition: color 0.3s;
}

.lang-switch span.activo {
    color: #3D719A; 
    font-weight: 900;
    border-bottom: 2px solid #3D719A;
}

.lang-switch span:hover {
    color: #6BB5B9;
}

nav ul { list-style: none; display: flex; gap: 20px; padding: 0; margin: 0; }
nav a { text-decoration: none; color: #333; font-weight: bold; font-size: 0.9rem; }
nav a:hover { color: #6BB5B9; }

/* HERO IMAGE */
.hero { position: relative; width: 100%; height: 350px; background-color: #3D719A; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }

.hero-texto { 
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); 
    text-align: center; color: white; width: 90%; z-index: 2;
}
.hero-texto h1 { 
    font-size: 2.2rem; text-shadow: 2px 2px 8px rgba(0,0,0,0.8); margin: 0; 
    font-weight: 900; letter-spacing: 1px; font-style: italic;
}

/* INTRODUCCIÓN */
.seccion-intro { background-color: white; padding: 60px 20px; border-bottom: 1px solid #e0e0e0; }
.contenedor-intro { max-width: 900px; margin: 0 auto; }
.texto-intro { font-size: 1.1rem; line-height: 1.8; color: #444; text-align: justify; margin: 0; font-weight: 300; }

/* SECCIÓN: FECHAS IMPORTANTES */
.seccion-fechas {
    background-color: #778899; 
    padding: 50px 20px;
    color: white;
    text-align: center;
}

.seccion-fechas h2 {
    font-size: 2rem;
    text-transform: uppercase;
    margin-bottom: 40px;
    font-weight: 700;
    letter-spacing: 1px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.contenedor-charlas {
    max-width: 1000px;
    margin: 0 auto;
}

.cabecera-charlas {
    background-color: #8FD1D2; 
    color: #000;
    font-weight: 700;
    text-transform: uppercase;
    padding: 15px;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.grid-fechas {
    display: flex;
    gap: 20px;
    margin-top: 0; 
    background-color: transparent;
    justify-content: center;
    padding-top: 20px; 
}

.tarjeta-fecha {
    background-color: white;
    color: #333;
    flex: 1;
    padding: 30px;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tarjeta-fecha h3 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 15px;
    color: #000;
    text-transform: uppercase;
    font-weight: 900;
}

.tarjeta-fecha h4 {
    font-size: 1rem;
    margin: 15px 0 5px 0;
    font-weight: 900; 
    text-transform: uppercase;
}

.tarjeta-fecha p {
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 0 0 10px 0;
    font-weight: 400;
}

.banner-votacion {
    max-width: 1000px;
    margin: 30px auto 0 auto;
    background-color: #3D719A; 
    color: white;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.banner-votacion h3 {
    font-size: 1.3rem;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    font-weight: 700;
}

.banner-votacion p {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 300;
}

/* TÍTULO EQUIPO */
.titulo-seccion-equipo {
    text-align: center;
    color: #3D719A;
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0;
    padding-top: 50px;
    letter-spacing: 1px;
}


/* --- MOSAICO SIMPLIFICADO --- */
.seccion-mosaico { position: relative; padding: 20px 10px 50px 10px; background-color: #f4f7f6; overflow: hidden; }
.bloque-fondo-1 { position: absolute; top: 20px; left: 0; width: 35%; height: 500px; background-color: #8FD1D2; opacity: 0.5; z-index: 0; }
.bloque-fondo-2 { position: absolute; top: 150px; right: 5%; width: 300px; height: 700px; background-color: #3D719A; opacity: 0.05; z-index: 0; border-radius: 5px;}
.bloque-fondo-3 { position: absolute; bottom: 50px; left: 15%; width: 70%; height: 300px; background-color: #9BA5A1; opacity: 0.2; z-index: 0; }

.contenedor-equipo { 
    max-width: 1400px; 
    margin: 30px auto 0 auto; 
    position: relative; 
    z-index: 1; 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 20px; 
}

/* TARJETA (ESTILO BASE) */
.tarjeta { 
    background-color: white; 
    width: 220px; 
    padding: 10px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
    transition: transform 0.3s; 
    cursor: pointer; 
    display: flex; 
    flex-direction: column; 
}
.tarjeta:hover { transform: scale(1.05); z-index: 10; box-shadow: 0 15px 30px rgba(0,0,0,0.2); }

.foto-marco { border: 3px solid #3D719A; height: 220px; overflow: hidden; background-color: #eee; }
.foto-marco img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.pie-tarjeta { 
    background-color: #3D719A; color: white; text-align: center; 
    padding: 8px 4px; margin-top: 10px; 
    min-height: 80px; 
    display: flex; flex-direction: column; justify-content: center; 
}
.pie-tarjeta h3 { margin: 0; font-size: 0.7rem; text-transform: uppercase; line-height: 1.2; font-weight: 900; margin-bottom: 4px; }
.pie-tarjeta p { margin: 0; font-size: 0.55rem; opacity: 0.9; text-transform: uppercase; line-height: 1.2; }

/* ESTILOS DIRECTOR */
.tarjeta.director { 
    border: 3px solid #6BB5B9; 
    transform: scale(1.05); 
    z-index: 5;
}
.tarjeta.director:hover {
    transform: scale(1.15); 
    z-index: 15;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.tarjeta.director .foto-marco { border-color: #6BB5B9; }
.tarjeta.director .pie-tarjeta { background-color: #6BB5B9; }
.tarjeta.director h3 { font-size: 0.9rem; }


/* --- MODAL (POPUP) --- */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.8); backdrop-filter: blur(3px); }
.modal-contenido { background-color: #fff; margin: 0 auto; padding: 30px; width: 90%; max-width: 900px; display: flex; gap: 30px; border-radius: 8px; position: relative; top: 50%; transform: translateY(-50%); height: 550px; overflow: hidden; }
.cerrar-btn { position:absolute; top:15px; right:20px; font-size: 30px; font-weight: bold; cursor: pointer; color: #333; z-index: 10; }
.modal-izq { flex: 0 0 240px; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.modal-izq img { width: 220px; height: 220px; object-fit: cover; object-position: top; border-radius: 15px; border: 6px solid #6BB5B9; margin-bottom: 15px; }
.modal-der { flex: 1; display: flex; flex-direction: column; height: 100%; padding-top: 10px; }
#m-nombre { color: #3D719A; margin-top: 0; border-bottom: 2px solid #eee; padding-bottom: 10px; flex-shrink: 0; }
#m-cv { line-height: 1.6; color: #555; text-align: justify; white-space: pre-line; flex-grow: 1; overflow-y: auto; padding-right: 15px; margin-bottom: 15px; scrollbar-width: thin; scrollbar-color: #6BB5B9 #f0f0f0; }
#m-cv::-webkit-scrollbar { width: 8px; }
#m-cv::-webkit-scrollbar-track { background: #f0f0f0; }
#m-cv::-webkit-scrollbar-thumb { background-color: #6BB5B9; border-radius: 20px; }
.boton-link { display: inline-block; background: #3D719A; color: white; padding: 12px 20px; text-decoration: none; border-radius: 30px; font-weight: bold; font-size: 0.9rem; text-align: center; flex-shrink: 0; align-self: flex-start; }
.boton-link:hover { background: #6BB5B9; }


/* ========================================= */
/* RESPONSIVE: MÓVIL (Pantallas < 768px)    */
/* ========================================= */
@media (max-width: 768px) {
    nav { flex-direction: column; gap: 10px; padding: 10px; }
    
    .logo img { height: 40px; }
    
    /* En móvil, reorganizamos el bloque derecho para que esté todo centrado */
    .nav-right {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }

    .cargo-header { position: static; transform: none; margin: 5px 0; font-size: 0.9rem; }
    .hero { height: 200px; }
    .hero-texto h1 { font-size: 1.2rem; }
    .seccion-intro { padding: 40px 20px; }
    
    .grid-fechas { flex-direction: column; gap: 20px; }
    .seccion-fechas h2 { font-size: 1.5rem; }
    
    .contenedor-equipo {
        gap: 10px; 
        padding: 0 10px;
        justify-content: space-between; 
    }

    .tarjeta {
        width: calc(50% - 10px); 
        margin-bottom: 10px;
    }
    
    .tarjeta.director { transform: none; }
    .tarjeta.director:hover { transform: none; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

    .modal-contenido { 
        flex-direction: column; 
        top: auto; bottom: 0; transform: none;
        height: 85dvh; max-height: 85dvh;
        padding: 20px;
        border-radius: 20px 20px 0 0;
        overflow-y: auto; 
    }
    .modal-izq { flex: 0 0 auto; margin-bottom: 15px; display: block; }
    .modal-izq img { width: 100px; height: 100px; margin: 0 auto 10px auto; display: block; }
    .modal-der { display: block; overflow: visible; height: auto; padding-bottom: 40px; }
    #m-cv { font-size: 0.9rem; overflow: visible; height: auto; }
    .boton-link { width: 100%; margin-top: 20px; margin-bottom: 30px; }
}

/* ESTILOS DE PÁGINAS DE DETALLE (MANTENIDOS) */
.detalle-contenedor { max-width: 900px; margin: 50px auto; padding: 40px; background-color: white; }
.detalle-cabecera { display: flex; justify-content: space-between; align-items: flex-end; position: relative; margin-bottom: 50px; padding-bottom: 0; }
.detalle-cabecera::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 50px; background-color: #3D719A; z-index: 0; }
.detalle-foto-wrapper { position: relative; width: 250px; flex-shrink: 0; z-index: 10; margin-bottom: 0; }
.banda-deco-1 { position: absolute; top: -20px; left: -20px; width: 120%; height: 40px; background-color: #6BB5B9; z-index: -1; }
.detalle-foto-wrapper img { display: block; width: 100%; height: 300px; object-fit: cover; object-position: top; border: 1px solid #ddd; background-color: #eee; }
.detalle-titulos { flex-grow: 1; text-align: right; position: relative; z-index: 5; padding-bottom: 12px; padding-right: 20px; }
.detalle-rol { font-size: 1.8rem; color: #7f8c8d; font-weight: 900; text-transform: uppercase; margin: 0; margin-bottom: 20px; line-height: 1; }
.detalle-nombre { font-size: 1.5rem; color: white; background-color: transparent; font-weight: 400; margin: 0; display: block; }
.detalle-texto { font-size: 1.1rem; line-height: 1.8; color: #444; text-align: justify; margin-bottom: 50px; }
.btn-volver { display: inline-block; margin-bottom: 40px; color: #3D719A; text-decoration: none; font-weight: bold; border: 2px solid #3D719A; padding: 10px 20px; border-radius: 5px; transition: all 0.3s; }
.btn-volver:hover { background-color: #3D719A; color: white; }

@media (max-width: 768px) {
    .detalle-cabecera { flex-direction: column; align-items: center; }
    .detalle-cabecera::after { width: 100vw; left: 50%; transform: translateX(-50%); bottom: -10px; height: 60px; }
    .detalle-foto-wrapper { margin-bottom: 80px; }
    .detalle-titulos { text-align: center; padding-right: 0; width: 100%; margin-top: -60px; }
    .detalle-rol { color: #3D719A; font-size: 1.2rem; margin-bottom: 25px; }
    .detalle-nombre { font-size: 1.2rem; }
}