/* --- Variables y Estilos Globales --- */
:root {
    --primary-color: #21618c;
    --secondary-color: #154360;
    --text-color-light: #fdfefe;
    --text-color-dark: #2c3e50;
    --background-light: #ecf0f1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--text-color-dark);
    background-color: #fff;
}

/* --- Encabezado --- */
.main-header {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.logos {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 50px;
    width: auto;
}

.main-title {
    font-size: 2rem;
    font-weight: 700;
}

/* --- Navegación --- */
.main-nav {
    background-color: var(--secondary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-menu-item {
    position: relative;
}

.nav-menu-link {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-color-light);
    text-decoration: none;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.nav-menu-link:hover {
    background-color: var(--primary-color);
}

/* --- Submenú Desplegable --- */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    list-style: none;
    min-width: 280px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 0 0 5px 5px;
    border-top: 3px solid var(--primary-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.has-dropdown:hover .dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li a {
    display: block;
    padding: 0.8rem 1.2rem;
    color: var(--text-color-dark);
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown li a:hover {
    background-color: var(--background-light);
    color: var(--primary-color);
}

.nav-toggle {
    display: none; /* Oculto por defecto */
}

/* --- Banner --- */
.banner {
    width: 100%;
    height: 50vh;
    background-image: linear-gradient(rgba(33, 97, 140, 0.7), rgba(21, 67, 96, 0.7)), url('https://images.unsplash.com/photo-1596495578065-450743944907?q=80&w=2070&auto=format&fit=crop'); /* Imagen de fondo matemática */
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-color-light);
}

.banner-content h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.banner-content p {
    font-size: 1.2rem;
}

.content-placeholder {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
    min-height: 200px;
}

/* --- Pie de Página --- */
.main-footer {
    background-color: var(--text-color-dark);
    color: var(--background-light);
    padding: 2rem;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-color-light);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}


/* --- Diseño Responsivo (Mobile First Approach) --- */

/* Tabletas y Móviles Grandes */
@media (max-width: 992px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--secondary-color);
    }
    
    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        padding: 0.5rem 1rem;
        cursor: pointer;
        width: 100%;
        text-align: left;
    }

    .hamburger {
        float: right;
    }

    .dropdown {
        position: static;
        display: block; /* Siempre visible en móvil, pero dentro del toggle */
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-top: none;
        min-width: 100%;
        background-color: var(--primary-color);
    }

    .dropdown li a {
        color: var(--text-color-light);
        padding-left: 3rem; /* Indentación para sub-items */
    }
    
    .has-dropdown:hover .dropdown { /* Desactiva hover en móvil */
        display: block;
    }

    .has-dropdown > a::after { /* Indicador de desplegable */
        content: ' ▼';
        font-size: 0.8em;
    }
}

@media (max-width: 576px) {
    .main-header {
        padding: 1rem;
    }

    .logos {
        flex-direction: column;
        gap: 10px;
    }
    
    .main-title {
        font-size: 1.5rem;
    }

    .banner-content h2 {
        font-size: 1.8rem;
    }
    .banner-content p {
        font-size: 1rem;
    }
}