/* ========================================
   1. RESET Y GLOBALES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base focus styles for accessibility */
*:focus-visible {
    outline: 3px solid #004E8E;
    outline-offset: 3px;
    border-radius: 4px;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-image: url('../img/fondo_tuff.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
}

/* Mobile Background Optimization */
@media (max-width: 768px) {
    body {
        background-attachment: scroll; /* Fixed backgrounds cause white gaps on mobile scroll */
        background-size: auto 100%; /* Better for vertical wave patterns on narrow screens */
        background-repeat: repeat-y;
    }
}

/* ========================================
   2. HEADER / NAVBAR
   ======================================== */
.encabezado {
    z-index: 1000;
    top: 0;
    position: fixed; /* Fixed is more reliable for 'always visible' */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 80px;
    padding: 0 5%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.contenido-principal {
    margin-top: 80px; /* Offset for fixed header */
}

.encabezado__logo-contenedor {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: inherit;
    text-decoration: none;
    flex-shrink: 0;
}

.encabezado__logo-imagen {
    width: 110px; /* Slightly larger */
    height: 110px;
    background-image: url('../img/logoet29.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: translateY(15px); /* Makes it 'overflow' the header */
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.15));
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: transparent;
}

.encabezado__logo-contenedor:hover .encabezado__logo-imagen {
    transform: translateY(18px) scale(1.08);
}

.encabezado__logo-texto {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    color: #333;
    font-weight: 600;
    font-size: 1.15rem; /* Reduced from 1.3rem for more space */
}

/* Navegación Principal */
.encabezado__navegacion {
    flex: 1;
    margin-left: 2rem;
    margin-right: 2rem; /* Added to separate from social media */
}

.encabezado__lista-enlaces {
    display: flex;
    gap: 1.2rem;
    /* Ajustado para que entren los enlaces cómodamente */
    list-style: none;
    justify-content: flex-end;
}

.encabezado__lista-enlaces a {
    color: #444;
    font-weight: 500;
    font-size: 1.3rem;
    text-align: center;
    text-decoration: none;
    transition: color 0.3s ease;
}

.encabezado__lista-enlaces a:hover {
    color: #004E8E;
}

.nav-branding-movil {
    display: none; /* Oculto por defecto en escritorio */
}

.nav-movil {
    display: none;
}

/* Dropdown Especialidades */
.nav-desplegable {
    position: relative;
}

.nav-desplegable__menu {
    position: absolute;
    top: calc(100% + 0.8rem);
    left: 50%;
    z-index: 200;
    min-width: 200px;
    padding: 0.5rem 0;
    list-style: none;
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.nav-desplegable__menu::before,
.nav-desplegable__menu::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-style: solid;
}

.nav-desplegable__menu::before {
    top: -7px;
    border-width: 0 7px 7px 7px;
    border-color: transparent transparent rgba(0, 0, 0, 0.1) transparent;
}

.nav-desplegable__menu::after {
    top: -6px;
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent #ffffff transparent;
}

.nav-desplegable:hover .nav-desplegable__menu,
.nav-desplegable:focus-within .nav-desplegable__menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-desplegable__menu li a {
    display: block;
    margin: 2px 6px;
    padding: 0.7rem 1.3rem;
    color: #444;
    font-weight: 500;
    font-size: 1rem !important;
    text-decoration: none;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.nav-desplegable__menu li a:hover {
    color: #004E8E;
    background-color: #e8f4ff;
}

.encabezado__redes-sociales-movil {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding: 1.5rem 0;
    margin-top: 0.5rem;
    border-top: 1px solid #ececec;
}

.encabezado__redes-sociales-movil a {
    color: #333;
    font-size: 2rem;
    text-decoration: none;
}

.encabezado__redes-sociales {
    display: flex;
    gap: 1rem;
    padding-right: 25px; /* Slightly adjusted */
    margin-left: 1rem; /* Added margin for more separation */
}

.encabezado__redes-sociales a {
    padding-left: 8px;
    color: #333;
    font-size: 1.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.encabezado__redes-sociales a:hover {
    color: #004E8E;
    transform: scale(1.1);
}

/* ========================================
   RESPONSIVIDAD DEL ENCABEZADO
   ======================================== */

.encabezado__menu-hamburger {
    display: none; /* Hidden by default on desktop */
    background: transparent;
    border: none;
    font-size: 2.2rem;
    color: #333;
    cursor: pointer;
    margin-left: auto;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    z-index: 1100;
    flex-shrink: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    align-items: center;
    justify-content: center;
}

.encabezado__menu-hamburger:hover {
    background-color: #f5f5f5;
}

.encabezado__menu-hamburger.activo {
    color: #004E8E;
}


/* ── Tablet Grande ── */
@media (max-width: 1024px) {
    .encabezado {
        padding: 0.8rem 1.5rem;
    }

    .encabezado__navegacion {
        margin-left: 1.5rem;
    }

    .encabezado__lista-enlaces {
        gap: 0.8rem; /* Reduced gap on mid-screens */
    }

    .encabezado__lista-enlaces a {
        font-size: 1.05rem;
    }

    .encabezado__redes-sociales a {
        font-size: 1.8rem;
    }
}

/* ── Tablet Chica / Móvil ── */
@media (max-width: 768px) {
    .encabezado {
        padding: 0.8rem 1rem;
        position: fixed;
        top: 0;
        z-index: 10000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .nav-branding-movil {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1.5rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-branding-movil__logo {
        width: 60px;
        height: 60px;
        background-image: url('../img/logoet29.png');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

    .nav-branding-movil__texto {
        display: flex;
        flex-direction: column;
        color: #333;
    }

    .nav-branding-movil__texto span:first-child {
        font-weight: 800;
        font-size: 1.1rem;
    }

    .nav-branding-movil__texto span:last-child {
        font-size: 0.85rem;
        opacity: 0.7;
    }

    .encabezado__logo-imagen {
        width: 60px;
        height: 60px;
        transform: translateY(0); /* Reset for mobile */
    }

    .encabezado__logo-texto {
        font-size: 1rem;
    }

    .encabezado__menu-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .encabezado {
        align-items: flex-start;
        padding-bottom: 0.4rem;
    }

    .encabezado__navegacion {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: block;
        /* Always block but hidden by max-height/opacity for transition */
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        width: 100%;
        margin: 0;
        border-top: 1px solid #e8e8e8;
        background-color: #ffffff;
        transition: max-height 0.4s ease, opacity 0.3s ease, visibility 0.3s ease, padding 0.3s ease;
        z-index: 999;
    }

    .encabezado__navegacion.activo {
        max-height: 1000px;
        /* Incrementado para el menú expandido */
        opacity: 1;
        visibility: visible;
        padding-top: 0.8rem;
        padding-bottom: 1rem;
    }

    .nav-escritorio {
        display: none;
    }

    .nav-movil {
        display: block;
    }

    .encabezado__redes-sociales-movil {
        display: flex;
    }

    .encabezado__lista-enlaces {
        flex-direction: column;
        gap: 0;
        background-color: #f9f9f9;
        border-radius: 10px;
        text-align: center;
        padding: 0.5rem;
    }

    .encabezado__lista-enlaces li {
        border-bottom: 1px solid #ececec;
    }

    .encabezado__lista-enlaces li:last-child {
        border-bottom: none;
    }

    .encabezado__lista-enlaces a:hover {
        /* No background change to keep it static if needed, or just remove transition */
        background-color: #e8f4ff;
    }

    .encabezado__lista-enlaces a {
        display: block;
        padding: 0.8rem 1rem;
        font-size: 1.05rem;
        border-radius: 7px;
        transition: none !important;
    }

    .encabezado__redes-sociales {
        display: none;
    }

    /* Configuración Dropdown Móvil */
    .nav-desplegable__menu {
        position: static;
        transform: none;
        opacity: 0;
        visibility: hidden;
        box-shadow: none;
        border: none;
        background-color: transparent;
        padding: 0;
        min-width: 100%;
        display: none;
    }

    .nav-desplegable.activo .nav-desplegable__menu {
        display: block;
        opacity: 1;
        visibility: visible;
        padding: 0.3rem 0.5rem 0.5rem;
    }

    .nav-desplegable__menu::before,
    .nav-desplegable__menu::after {
        display: none;
    }

    .nav-desplegable__menu li a {
        text-align: center;
        width: 90%;
        max-width: 300px;
        background-color: #ffffff;
        margin: 0 auto 6px;
        border: 1px solid #eee;
        border-radius: 6px;
        font-size: 0.95rem !important;
        padding: 0.6rem 1rem;
    }
}

/* ── Móvil Pequeño ── */
@media (max-width: 480px) {
    .encabezado {
        padding: 0.7rem 0.8rem;
    }

    .encabezado__logo-imagen {
        width: 45px;
        height: 45px;
    }

    .encabezado__logo-texto {
        font-size: 0.85rem;
    }

    .encabezado__menu-hamburger {
        font-size: 1.7rem;
    }
}

/* ========================================
   3. HERO SECTION
   ======================================== */
.contenido-principal {
    flex-grow: 1;
}

.seccion-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 85vh;
    min-height: 600px;
    padding-left: 1.5rem;
    overflow: hidden;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .seccion-hero { padding-left: 5%; }
}

@media (max-width: 768px) {
    .seccion-hero {
        justify-content: center;
        height: 60vh;
        min-height: 480px;
        padding: 4rem 1.5rem;
    }
}

.hero-contenido {
    position: relative;
    z-index: 10;
    max-width: 800px;
    text-align: left;
    color: white;
}

.hero-contenido h1 {
    font-size: clamp(2rem, 5.5vw, 3.2rem); /* Further reduced for better fit */
    font-weight: 900;
    margin-bottom: 0.8rem;
    line-height: 1.1;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    text-transform: uppercase;
}

.hero-contenido h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
    color: #e0f4ff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-contenido p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 600px;
    opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    .seccion-hero {
        justify-content: center;
        height: auto;
        min-height: 550px; /* Increased to accommodate longer text */
        padding: 120px 1.5rem 3rem; /* 120px top padding to safely clear 90px navbar */
    }
    
    .hero-contenido {
        text-align: center;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .hero-contenido h1 { 
        font-size: clamp(1.6rem, 9vw, 2.4rem); 
        margin-bottom: 0.5rem; /* Reduced margin */
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .hero-contenido h2 { font-size: 0.95rem; letter-spacing: 2px; margin-bottom: 0.8rem; } /* Reduced margin */
    .hero-contenido p { 
        font-size: 0.9rem; 
        line-height: 1.4; 
        margin-bottom: 1.2rem; /* Reduced margin */
    }
    
    .hero-botones {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    .hero-botones .boton-llamada-accion { 
        width: 100%; 
        padding: 0.8rem 1.2rem; /* Reduced padding */
        font-size: 0.9rem; /* Reduced font size */
    }

    /* Centering and balancing elipses on mobile */
    .hero-elipse {
        height: 100%;
        object-fit: contain;
        transform: scale(1.5) translateX(-100%); /* Adjusted scale for better mobile look */
    }

    .hero-elipse:nth-child(1) { left: -150px; top: 0; }
    .hero-elipse:nth-child(2) { left: -100px; top: 20px; }
    .hero-elipse:nth-child(3) { left: -50px; top: 40px; }
}


.hero-imagen-fondo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-image: url('../img/frenteCole.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-imagen-fondo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
    z-index: 2;
}

.hero-images-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.hero-elipse {
    position: absolute;
    top: 0;
    width: 100%;
    height: 110%;
    object-fit: cover;
    transform: translateX(-110%);
    animation: slideIn 0.3s ease-out forwards;
}

/* las 3 imagenes, cada una con un poco de delay*/
.hero-elipse:nth-child(1) {
    left: -420px;
    top: -85px;
    z-index: 5;
    width: 105%;
    opacity: 0.5;
    animation-delay: 0s;
}

.hero-elipse:nth-child(2) {
    left: -320px;
    z-index: 4;
    top: -30px;
    width: 105%;
    opacity: 0.35;
    animation-delay: 0.1s;
}

.hero-elipse:nth-child(3) {
    left: -220px;
    z-index: 3;
    top: -10px;
    width: 105%;
    opacity: 0.2;
    animation-delay: 0.2s;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

/* Global Responsive Safety */
@media (max-width: 768px) {
    h1, h2, h3 {
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .seccion-hero h1 {
        hyphens: none; /* Hero titles should not hyphenate */
    }
}

html,
body {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}


/* Redundant Hero Section Removed to Fix Mobile Bugs */


.hero-botones {
    display: flex;
    gap: 2.5rem;
}

.boton-llamada-accion {
    display: inline-block;
    padding: 1.1rem 2.8rem;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid transparent;
    text-align: center;
}

.boton-llamada-accion--primario {
    background-color: #004E8E;
    color: #ffffff;
    border-color: #004E8E;
    box-shadow: 0 6px 20px rgba(0, 78, 142, 0.3);
}

.boton-llamada-accion--primario:hover {
    background-color: #003a6b;
    border-color: #003a6b;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 78, 142, 0.5);
}

.boton-llamada-accion--secundario {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: #ffffff;
    backdrop-filter: blur(5px);
}

.boton-llamada-accion--secundario:hover {
    background-color: #ffffff;
    color: #004E8E;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .hero-contenido {
        padding-left: 5%;
        padding-right: 5%;
        text-align: center;
        max-width: 100%;
    }

    .hero-contenido h1 {
        font-size: clamp(1.5rem, 8vw, 2.2rem);
        margin: 0 auto 0.8rem;
    }

    .hero-contenido h2 {
        font-size: clamp(0.9rem, 4vw, 1.2rem);
        letter-spacing: 2px;
        margin-bottom: 1.2rem;
    }

    .hero-contenido p {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    .hero-imagen-fondo::after {
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 100%);
    }

    .hero-botones {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }

    .boton-llamada-accion {
        width: 100%; /* Full width buttons on mobile for easier tapping */
        max-width: 280px;
        padding: 1rem 2rem;
    }

    /* Ajuste de olas en móvil */
    .hero-images-container {
        display: none;
    }
}

/* ========================================
   6. FOOTER
   ======================================== */
.pie-pagina-nuevo {
    background-color: #0085C8;
    color: #ffffff;
    padding: 4rem 8%;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 6rem;
    margin-top: 0;
    border-top: 4px solid #005682;
    align-items: center;
}

.pie-pagina__seccion {
    display: flex;
    flex-direction: column;
}

/* Secondary Headers */
.pie-pagina__seccion h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Primary Header (Ubicación) */
.pie-pagina__ubicacion h3 {
    font-size: 2.2rem; /* Much larger */
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    position: relative;
    width: fit-content;
}

.pie-pagina__ubicacion h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #ffffff;
    margin-top: 0.8rem;
    border-radius: 2px;
}

.pie-pagina__contactos p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.5;
}

.pie-pagina__contactos a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: opacity 0.3s;
}

.pie-pagina__contactos a:hover {
    opacity: 0.7;
}

.pie-pagina__titulo-redes {
    margin-top: 3rem;
    margin-bottom: 1.2rem !important;
}

.pie-pagina__ubicacion {
    flex-grow: 0;
    max-width: none;
    padding-left: 3rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.footer__mapa-contenedor {
    position: relative;
    width: 100%;
    padding-bottom: 45%; /* Slightly flatter for the wider layout */
    height: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
    margin-top: 1.5rem;
    border: 3px solid rgba(255, 255, 255, 0.15);
}

.footer__mapa-contenedor iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   7. RESPONSIVIDAD (MEDIA QUERIES)
   ======================================== */

@media (max-width: 1024px) {
    .pie-pagina-nuevo {
        padding: 2.5rem 2rem;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 2rem;
    }
}

/* Footer Adaptación */
    /* Hero-related overrides removed to use global base.css styles */

    /* Specialty hero override removed */


@media (max-width: 768px) {
    .inst-gallery-item img {
        height: 500px; /* Even taller for a better view of the school */
        object-fit: cover;
        object-position: center;
    }
    
    .inst-gallery-caption {
        padding: 2rem 1.5rem;
        font-size: 1.15rem;
        text-align: center;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 80%); /* Lightened overlay */
    }

    .pie-pagina__seccion {
        width: 100%;
        align-items: center;
    }

    .pie-pagina-nuevo {
        grid-template-columns: 1fr;
        padding: 3rem 1.5rem;
        gap: 4rem;
        text-align: center;
    }

    .pie-pagina__seccion {
        width: 100%;
        align-items: center;
    }

    .pie-pagina__ubicacion {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-top: 3rem;
        order: -1; /* Puts location first on mobile too */
    }

    .pie-pagina__ubicacion h3 {
        margin: 0 auto 1.5rem;
    }

    .pie-pagina__ubicacion h3::after {
        margin: 0.8rem auto 0;
    }
}

/* Curriculum grid logic (keeping common structure) */
.cb-curriculum-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem 1.5rem;
    margin: 4rem 0;
}
/* --- Bot�n Gmail Footer --- */
.btn-gmail {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: #ea4335 !important;
    color: #fff !important;
    padding: 0.8rem 1.4rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.3);
    border: none;
}

.btn-gmail:hover {
    background: #d33828 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(234, 67, 53, 0.4);
}

.btn-gmail i {
    font-size: 1.2rem;
}
