/* ==========================================================================
   PROCESO ELECTORAL ESTUDIANTIL UNAH 2026 - LANDING PAGE
   1. VARIABLES Y COLORES (ESCALA DE GRISES ALTO CONTRASTE WCAG AA/AAA)
   ========================================================================== */
   :root {
    --primary-blue: #1A1A1A; /* Gris casi negro puro */
    --accent-yellow: #595959; /* Gris medio-oscuro para hovers y acentos */
    --unah-red: #4A4A4A; 
    
    /* Textos ajustados para pasar la validación de WAVE */
    --text-dark: #222222; /* Contraste altísimo (Ratio 15.5:1) */
    --text-muted: #545454; /* Gris oscuro seguro para párrafos (Ratio 5.5:1) */
    
    --bg-light: #FFFFFF;
    --bg-light-alt: #F0F0F0; /* Gris de fondo un poco más notorio */
    --border-color: #CCCCCC; /* Bordes más definidos */
    
    --transition: 0.3s ease;
}

/* ==========================================================================
   2. RESET Y ESTILOS BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Desplazamiento suave */
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    font-family: 'Helvetica Neue', Helvetica, Arial, 'Open Sans', sans-serif;
}

h1, h2, h3, h4 {
    font-family: 'Futura', 'Montserrat', sans-serif;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-padding { padding: 60px 0; }
.bg-light-alt { background-color: var(--bg-light-alt); }
.text-center { text-align: center; }
.mt-2 { margin-top: 15px; }

/* Títulos */
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { color: var(--primary-blue); font-size: 2.2rem; font-weight: 700; margin-bottom: 10px; }
.subtitle { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

.underline-title h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    color: var(--primary-blue);
}

.underline-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-yellow);
}

/* ==========================================================================
   3. NAVEGACIÓN Y HEADER (DINÁMICO Y LOGO UNIFICADO)
   ========================================================================== */
.main-header {
    background-color: var(--bg-light); 
    color: var(--primary-blue);
    padding: 20px 0; /* Padding inicial amplio */
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 4px solid var(--accent-yellow); 
    box-shadow: none; 
    transition: padding 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease; 
}

.main-header.scrolled {
    padding: 8px 0; /* Se hace más delgado suavemente */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); 
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Estructura de los Logos */
.logo { display: flex; align-items: center; gap: 15px; }
.logo-item { display: flex; align-items: center; position: relative; }

/* Altura del nuevo logo unificado */
.logo-item img.logo-normal,
.logo-item img.logo-hc { 
    max-height: 70px; 
    width: auto;
    display: block;
    object-fit: contain;
    transition: max-height 0.4s ease, filter 0.4s ease;
}

/* Altura al hacer scroll */
.main-header.scrolled .logo-item img.logo-normal,
.main-header.scrolled .logo-item img.logo-hc { 
    max-height: 50px; 
}

/* Enlaces de Navegación */
.nav-links { list-style: none; display: flex; gap: 30px; }
.nav-links a { color: var(--primary-blue); text-decoration: none; font-weight: 600; font-size: 1rem; transition: var(--transition); }
.nav-links a:hover { color: var(--accent-yellow); }

/* Menú Hamburguesa Móvil */
.menu-toggle { display: none; background: transparent; border: none; cursor: pointer; padding: 10px; }
.hamburger { display: block; width: 25px; height: 3px; background: var(--primary-blue); position: relative; transition: var(--transition); }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 25px; height: 3px; background: var(--primary-blue); left: 0; transition: var(--transition); }
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }
.menu-toggle.active .hamburger { background: transparent; }
.menu-toggle.active .hamburger::before { transform: rotate(45deg); top: 0; }
.menu-toggle.active .hamburger::after { transform: rotate(-45deg); top: 0; }

/* ==========================================================================
   4. HERO, BOTONES Y COMPONENTES PRINCIPALES
   ========================================================================== */
.hero {
    padding: 50px 0 20px 0;
    background: linear-gradient(to right, #ffffff, #f0f0f0);
}

.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.hero-text h1 { font-size: 3rem; color: var(--primary-blue); line-height: 1.2; margin-bottom: 20px; font-weight: 700; }
.hero-text p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 30px; }

.img-fluid { width: 100%; height: auto; display: block; }
.rounded-shadow {
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    transition: transform var(--transition), box-shadow var(--transition);
}
.rounded-shadow:hover { transform: translateY(-5px); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2); }

/* Botón Principal (Arriba) */
.cta-button {
    background-color: var(--primary-blue);
    color: #FFFFFF;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    background-color: var(--accent-yellow);
    color: #FFFFFF;
    transform: translateY(-4px); 
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

/* Animación de Pulso (Gris) */
@keyframes pulse-gray {
    0% { box-shadow: 0 0 0 0 rgba(89, 89, 89, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(89, 89, 89, 0); }
    100% { box-shadow: 0 0 0 0 rgba(89, 89, 89, 0); }
}
.pulse-effect { animation: pulse-gray 2s infinite; }

/* Botón Flotante Independiente (Abajo) */
.floating-btn {
    position: fixed;
    bottom: -100px; /* Oculto inicialmente */
    right: 30px;
    z-index: 9998; 
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    animation: pulse-gray 2s infinite; 
}
.floating-btn.is-visible { bottom: 30px; }

/* ==========================================================================
   5. TARJETAS INFORMATIVAS Y COMPONENTES
   ========================================================================== */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }

.card {
    background: white;
    padding: 50px 40px; /* Respiración / Whitespace */
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    text-align: center;
    transition: var(--transition);
    border: none;
}

.card:hover {
    transform: translateY(-8px); /* Levantamiento sutil */
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
}

.card-icon { font-size: 3.5rem; color: var(--primary-blue); margin-bottom: 20px; transition: color var(--transition); }
.card-icon-small { font-size: 2.5rem; color: var(--primary-blue); margin-bottom: 15px; transition: color var(--transition); }

.card:hover .card-icon, .card:hover .card-icon-small { color: var(--accent-yellow); }
.card h3 { color: var(--primary-blue); margin-bottom: 15px; font-weight: 600; }
.card p { color: var(--text-muted); font-size: 0.95rem; }

.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 900px; margin: 0 auto; background-color: var(--primary-blue); border-radius: 16px; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
.site-footer { background-color: #1A1A1A; color: #FFFFFF; padding: 60px 0 20px 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { font-size: 1.1rem; margin-bottom: 20px; font-weight: 600; }
.brand-col h3 { font-size: 1.2rem; margin: 10px 0 5px 0; }
.brand-col p { font-size: 0.9rem; color: #A0AEC0; }

.footer-logo {
    max-height: 85px; 
    width: auto;
    display: block;
    margin-bottom: 15px;
    
    /* TRUCO: Lo vuelve gris, invierte los colores (fondo negro, logo blanco), sube el brillo, 
       y 'mix-blend-mode: screen' hace que el fondo negro se vuelva 100% invisible */
    filter: grayscale(100%) invert(1) brightness(200%);
    mix-blend-mode: screen;
}
.links-col ul, .contact-list { list-style: none; padding: 0; }
.links-col ul li { margin-bottom: 10px; }

.links-col ul li a, .contact-list li a { color: #E2E8F0; text-decoration: none; font-size: 0.95rem; transition: color var(--transition); }
.links-col ul li a:hover, .contact-list li a:hover { color: var(--accent-yellow); }
.contact-list li { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; font-size: 0.95rem; color: #E2E8F0; }
.contact-list i { color: var(--accent-yellow); }

.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid #2D3748; font-size: 0.85rem; color: #718096; }

/* ==========================================================================
   7. ANIMACIONES Y WIDGET DE ACCESIBILIDAD
   ========================================================================== */
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.2s; }

.a11y-widget { position: fixed; bottom: 25px; left: 25px; z-index: 9999; }
.a11y-toggle-btn { background-color: var(--primary-blue); color: white; border: none; border-radius: 50%; width: 60px; height: 60px; font-size: 1.8rem; cursor: pointer; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); transition: transform var(--transition); }
.a11y-toggle-btn:hover { transform: scale(1.05); }

.a11y-menu { position: absolute; bottom: 75px; left: 0; background: white; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); width: 220px; border: 1px solid var(--border-color); opacity: 1; visibility: visible; transition: opacity 0.3s, visibility 0.3s, transform 0.3s; transform: translateY(0); }
.a11y-menu.hidden { opacity: 0; visibility: hidden; transform: translateY(10px); }

.a11y-menu button { background: transparent; border: none; padding: 10px 15px; text-align: left; cursor: pointer; width: 100%; font-size: 0.95rem; color: var(--text-dark); border-radius: 8px; transition: background 0.2s; display: flex; align-items: center; gap: 12px; }
.a11y-menu button:hover { background: #f0f4f8; color: var(--primary-blue); }
.a11y-menu button.btn-reset { border-top: 1px solid var(--border-color); border-radius: 0 0 8px 8px; margin-top: 5px; color: #A6192E; }

/* ==========================================================================
   8. CLASES DINÁMICAS JS - LOGOS Y ACCESIBILIDAD 
   ========================================================================== */

/* Filtro Escala de Grises para Imágenes a Color */
.rounded-shadow, 
.logo-normal {
    filter: grayscale(100%);
    transition: filter 0.5s ease;
}

/* Solo la imagen principal recupera color al pasar el mouse, el logo se queda gris */
.rounded-shadow:hover {
    filter: grayscale(0%);
}

/* Ocultar las versiones de Alto Contraste por defecto */
.logo-hc { display: none !important; }

/* Fuente Legible (Excluye iconos FontAwesome) */
body.readable-font, body.readable-font h1, body.readable-font h2, body.readable-font h3, 
body.readable-font h4, body.readable-font p, body.readable-font a, body.readable-font button, 
body.readable-font input {
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
}

/* ALTO CONTRASTE */
body.high-contrast {
    --primary-blue: #000000;
    --accent-yellow: #FFFF00;
    --bg-light: #000000;
    --bg-light-alt: #111111;
    --text-dark: #FFFFFF;
    --text-muted: #FFFFFF;
    --border-color: #FFFF00;
}

body.high-contrast .hero { background: #000000; border-bottom: 1px solid #333333; }
body.high-contrast .site-footer { border-top: 1px solid #333333; }

body.high-contrast .card { background-color: #111111; border: 1px solid #222222; box-shadow: 0 10px 30px rgba(255, 255, 0, 0.05); }
body.high-contrast .card:hover { border-color: #FFFF00; box-shadow: 0 15px 40px rgba(255, 255, 0, 0.15); }
body.high-contrast .card-icon, body.high-contrast .card-icon-small { color: #FFFF00; }

body.high-contrast .a11y-menu { background-color: #000; border: 2px solid #FFFF00; }
body.high-contrast .a11y-menu button { color: #FFF; }
body.high-contrast .a11y-menu button:hover { background-color: #333; color: #FFFF00; }

body.high-contrast h1, body.high-contrast h2, body.high-contrast h3,
body.high-contrast .section-header h2, body.high-contrast .card h3,
body.high-contrast .underline-title h2 { color: #FFFF00 !important; }

body.high-contrast p, body.high-contrast label, body.high-contrast li,
body.high-contrast .subtitle { color: #FFFFFF !important; }

body.high-contrast .cta-button, body.high-contrast .floating-btn { background-color: #FFFF00 !important; color: #000000 !important; border: 2px solid #FFFF00; box-shadow: none; animation: none; }

body.high-contrast .nav-links a { color: #FFFFFF !important; }
body.high-contrast .nav-links a:hover { color: #FFFF00 !important; }
body.high-contrast .hamburger, body.high-contrast .hamburger::before, body.high-contrast .hamburger::after { background: #FFFFFF !important; }

/* Lógica de Logos en Alto Contraste */
body.high-contrast .logo-normal,
body.high-contrast .logo-separator {
    display: none !important;
}

body.high-contrast .logo-hc {
    display: block !important;
}

/* ==========================================================================
   9. MEDIA QUERIES (RESPONSIVE MÓVIL)
   ========================================================================== */
@media (max-width: 768px) {
    
    /* Fijar Header para evitar temblores */
    .main-header { padding: 12px 0 !important; }
    
    /* Logo unificado en móviles */
    .logo { gap: 10px; }
    .logo-item img.logo-normal,
    .logo-item img.logo-hc { max-height: 55px !important; }
    
    .footer-logo { margin: 0 auto 15px auto; } /* Centra el logo en el footer móvil */
    .logo-separator { display: none; } /* Ocultamos el separador por si quedó alguno */

    /* Centrar botón flotante sin transforms */
    .floating-btn {
        left: 5%; 
        right: auto;
        width: 90%; 
        transform: none !important; 
    }
    .floating-btn.is-visible { bottom: 25px; }

    /* Menú Móvil */
    .menu-toggle { display: block; }
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-light); 
        opacity: 0;
        visibility: hidden;
        transform: translateY(-15px); 
        transition: all 0.3s ease-in-out;
        z-index: -1;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-bottom: 3px solid var(--accent-yellow);
    }

    body.high-contrast .nav-menu { background-color: #000; border-bottom: 3px solid #FFFF00; }
    .nav-menu.active { opacity: 1; visibility: visible; transform: translateY(0); }
    .nav-links { flex-direction: column; align-items: center; gap: 20px; }

    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-text h1 { font-size: 2.2rem; }
    .hero { padding: 40px 0; }
    
    .footer-grid { text-align: center; }
    .contact-list li { justify-content: center; }
}