/* public/css/style.css */
:root {
    --primary-color: #002B5C; /* Azul Marino Profundo (Institucional) */
    --secondary-color: #D4AF37; /* Dorado (Excelencia/Prestigio) */
    --text-color: #333333;
    --light-bg: #f4f4f4;
    --white: #ffffff;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- HEADER & NAV --- */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--primary-color);
}

.logo-img {
    height: 60px; /* Ajusta según tu logo */
    width: auto;
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.logo-text span {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Enlaces de navegación (Escritorio) */
.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

/* Flechita del menú */
.arrow {
    font-size: 0.7em;
    margin-left: 5px;
}

/* --- BOTÓN HAMBURGUESA (Por defecto oculto) --- */
.menu-toggle {
    display: none;
}

/* --- CONTENEDOR PRINCIPAL --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

footer {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

/* =========================================
   COMPONENTES: BOTONES (NUEVO)
   ========================================= */

/* 1. Clase Base (Estructura) */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: normal; /* Evita herencia extraña */
}

/* 2. Botón Primario (Azul Relleno) */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--white) !important;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--white) !important; /* Mantenemos blanco si está sobre fondo oscuro */
    border-color: var(--white);
}

/* 3. Botón Outline (Borde Blanco - Para Hero) */
.btn-outline {
    background-color: transparent;
    color: var(--white) !important;
    border-color: var(--white);
}

.btn-outline:hover {
    background-color: var(--white);
    color: var(--primary-color) !important;
    border-color: var(--white);
}

/* 4. Botón Intranet */
.btn-intranet {
    background-color: var(--primary-color);
    color: var(--white) !important;
    padding: 10px 20px;
    border-radius: 4px;
    border: 1px solid var(--primary-color);
    text-transform: none;
    font-weight: 600;
}
.btn-intranet:hover {
    background-color: var(--white);
    color: var(--primary-color) !important;
}


/* --- HERO SLIDER (CORREGIDO) --- */
.hero-slider-section {
    position: relative;
    height: 40vh; /* Altura del banner */
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    color: white;
}

/* Contenedor de las imágenes */
.hero-slides {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Nivel más bajo */
}

/* Cada Slide individual */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0; /* Oculto por defecto */
    transition: opacity 1.5s ease-in-out; 
    transform: scale(1);
}

.slide.active {
    opacity: 1; /* Visible */
    animation: zoomEffect 6s infinite alternate; 
}

@keyframes zoomEffect {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

/* Capa Oscura (Overlay) */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 43, 92, 0.6); /* Azul institucional transparente */
    z-index: 2; /* Encima de las fotos */
}

/* Contenido (Texto y botones) */
.hero-content {
    position: relative;
    z-index: 3; /* Encima de todo */
    text-align: left;
    max-width: 800px;
    /* Flexbox para asegurar orden vertical */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Separación explícita */
.hero-content h1 {
    margin-bottom: 20px;
}

.hero-content p {
    margin-bottom: 35px; /* Más espacio antes de los botones */
    font-size: 1.3rem;
    line-height: 1.4;
}

/* Contenedor de los botones */
.hero-buttons {
    display: flex;
    gap: 15px; /* Espacio entre los botones */
    flex-wrap: wrap; /* En móviles evita que se salgan */
}

/* --- ANIMACIONES DE TEXTO --- */
.animate-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s forwards;
}

.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- NOTICIAS GRID --- */
.section-padding { padding: 4rem 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; border-bottom: 2px solid #eee; padding-bottom: 1rem; }
.view-all-link { color: var(--primary-color); text-decoration: none; font-weight: 600; }

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.news-card:hover { transform: translateY(-5px); }

.news-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-body { padding: 1.5rem; }
.news-date { font-size: 0.85rem; color: #888; display: block; margin-bottom: 0.5rem; }
.news-body h3 a { color: var(--primary-color); text-decoration: none; font-size: 1.2rem; }
.news-body p { font-size: 0.95rem; color: #555; margin: 10px 0; }
.read-more { color: var(--secondary-color); text-decoration: none; font-weight: bold; font-size: 0.9rem; }

/* --- ESTILOS INTERNOS --- */
.internal-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.internal-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.internal-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* --- PAGINACIÓN --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 3rem;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--primary-color);
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #f0f0f0;
    border-color: var(--primary-color);
}

.pagination a.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* =========================================
   ESTILOS DE MENÚ DESPLEGABLE (DROPDOWN)
   ========================================= */

/* 1. Elemento padre relativo */
.nav-links li {
    position: relative;
}

/* 2. Submenú oculto y flotante (Versión Escritorio) */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    padding: 0;
    border-radius: 4px;
    list-style: none;
    border-top: 3px solid var(--secondary-color);
}

/* 3. Estilo de enlaces hijos */
.dropdown-menu li a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.85rem;
    text-transform: none; /* No forzar mayúsculas en submenú */
}

.dropdown-menu li a:hover {
    background-color: #f9f9f9;
    color: var(--primary-color);
    padding-left: 20px; /* Efecto movimiento */
}

/* 4. HOVER DESKTOP: Mostrar al pasar el mouse */
@media screen and (min-width: 769px) {
    .dropdown-item:hover .dropdown-menu {
        display: block;
    }
}


/* =========================================
   ESTILOS RESPONSIVOS (MOBILE)
   ========================================= */

@media screen and (max-width: 768px) {
    
    .navbar {
        padding: 1rem;
    }

    /* 1. Botón Hamburguesa Visible */
    .menu-toggle {
        display: block;
        cursor: pointer;
        z-index: 1001;
    }
    
    .menu-toggle .bar {
        width: 25px;
        height: 3px;
        margin: 5px auto;
        transition: all 0.3s ease-in-out;
        background: var(--primary-color);
        display: block;
        border-radius: 2px;
    }

    /* Animación del ícono X */
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* 2. Menú Principal Mobile */
    .nav-links {
        display: none; /* Oculto inicialmente */
        position: absolute;
        top: 70px; /* Altura aprox del header */
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        box-shadow: 0 10px 10px rgba(0,0,0,0.05);
        padding: 0;
        border-top: 1px solid #eee;
    }

    /* Mostrar menú cuando JS agrega clase .active */
    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-links a {
        padding: 15px 20px;
        width: 100%;
        justify-content: space-between; /* Flecha a la derecha */
    }

    .btn-intranet {
        margin: 15px 20px;
        display: inline-block;
        width: auto;
    }

    /* 3. Submenús Mobile (Acordeón) */
    .dropdown-menu {
        position: static; /* Ya no flota */
        box-shadow: none;
        border-top: none;
        background-color: #f8f9fa;
        display: none; /* Oculto */
        width: 100%;
    }

    .dropdown-menu li a {
        padding-left: 35px; /* Indentación */
        font-weight: normal;
        border-bottom: 1px solid #eee;
    }

    /* Mostrar submenú cuando JS agrega clase .active-dropdown */
    .dropdown-item.active-dropdown .dropdown-menu {
        display: block;
    }

    /* Desactivar hover en móvil para no interferir con el touch */
    .dropdown-item:hover .dropdown-menu {
        display: none;
    }
    
    /* Regla específica para forzar display block si tiene la clase activa */
    .dropdown-item.active-dropdown:hover .dropdown-menu {
        display: block;
    }
    
    /* Ajustes visuales generales */
    .hero-content h1 { font-size: 2rem; }
    .hero-content p { font-size: 1.1rem; }
    .hero-slider-section { height: 40vh; }
}