/* ============================================================
   VARIABLES INSTITUCIONALES
============================================================ */
:root {
    --azul-principal: #001F3F;
    --azul-secundario: #003366;
    --gris-fondo: #e6ecf3;
    --gris-texto: #444;
    --blanco: #ffffff;

    --radio-caja: 14px;
    --sombra-suave: 0 6px 16px rgba(0,0,0,0.08);
    --sombra-media: 0 10px 28px rgba(0,0,0,0.15);
    --transicion-base: all .25s ease;
}

/* ============================================================
   RESET GLOBAL
============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================
   ESTILOS GENERALES
============================================================ */
body {
    font-family: 'Inter', Arial, sans-serif;
    line-height: 1.6;
    background-color: #001f3f;
    color: #333;
}


/* ============================================================
   HEADER Y PORTADA
============================================================ */
header {
    background-color: #001F3F;
    color: white;
}

#portada {
    max-height: 500px;
    padding: .5rem 0;
    overflow: hidden;
    transition: opacity .5s ease, max-height .5s ease, padding .5s ease;
}

#portada img {
    width: 100%;
    display: block;
}

/* ============================================================
   NAVEGACIÓN PRINCIPAL
============================================================ */
nav#main-nav {
    background-color: #001F3F;
    color: white;
    position: sticky;
    top: 0;
    z-index: 5000;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
}

.logo-container {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

#logo-scroll {
    height: 60px;
    opacity: 0;
    transition: opacity .4s ease;
}

nav#main-nav.show-logo #logo-scroll {
    opacity: 1;
}

#menu-toggle {
    display: none;
    font-size: 2rem;
    cursor: pointer;
}

nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    flex-grow: 1;
    justify-content: center;
    transition: all .3s ease;
    overflow: visible;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
}

/* ============================================================
   SUBMENÚ UNIFICADO
============================================================ */
.has-submenu {
    position: relative;
}

.has-submenu > a {
    cursor: pointer;
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #001f3f;
    min-width: 220px;
    list-style: none;
    padding: 0.5rem 0;
    z-index: 9999;
    border-radius: 0 0 6px 6px;
}

.submenu li a {
    display: block;
    padding: 0.6rem 1rem;
    color: white;
    font-weight: normal;
}

.submenu li a:hover {
    background-color: #003366;
}

/* Escritorio */
@media (min-width: 769px) {
    .has-submenu:hover > .submenu {
        display: block;
    }
}

/* ============================================================
   SLIDER BASE
============================================================ */
.slider-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 2rem auto;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--sombra-suave);
}

.slider {
    display: flex;
    width: 300%;
    transition: transform .6s ease;
}

.slide img {
    width: 100%;
    display: block;
}

/* ============================================================
   FOOTER
============================================================ */
footer {
    text-align: center;
    padding: 1rem;
    background-color: #001F3F;
    color: white;
    margin-top: 2rem;
}

/* ============================================================
   RESPONSIVE – MÓVIL
============================================================ */
@media (max-width: 768px) {

    nav#main-nav {
        flex-direction: column;
        align-items: flex-end;
        padding: .6rem 1rem;
    }

    #menu-toggle {
        display: block;
        width: 100%;
        text-align: right;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        background: #001f3f;
        padding: 1rem 1.5rem;
        align-items: flex-end;
    }

    nav ul.show {
        display: flex !important;
    }

    .submenu {
        position: static;
        width: 100%;
    }

    .submenu.show {
        display: block;
    }
}

/* ============================================================
   JERARQUÍA DE TÍTULOS
============================================================ */
h1, h2, h3 {
    color: var(--azul-principal);
    font-weight: 800;
}

h1 { font-size: 2.3rem; margin-bottom: 1rem; }
h2 { font-size: 1.8rem; margin-bottom: .8rem; }
h3 { font-size: 1.2rem; margin-bottom: .4rem; }

/* ============================================================
   ACCESIBILIDAD
============================================================ */
a:focus,
button:focus {
    outline-offset: 3px;
}

/* =====================================================
   SOPORTE TÁCTIL PARA SUBMENÚS
   (NO afecta escritorio)
===================================================== */
@media (hover: none) {
    .has-submenu.touch-open > .submenu {
        display: block;
    }
}
