/* ============================================
   RESET Y CONFIGURACIÓN BASE GENERAL
   (estas reglas SÍ se mantienen)
============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: #e8e8e8;
  line-height: 1.6;
}

/* ============================================
   HEADER PRINCIPAL
============================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 20px;
  background: #fff; /* <— aquí podrás cambiar a degradado más adelante */
  z-index: 1000;
  transition: padding 0.3s ease, background-color 0.3s ease;
}

/* Sticky al hacer scroll */
.sticky-header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Cuando la clase .active está presente (header reducido) */
.sticky-header.active {
  padding: 8px 20px;
}

/* ============================================
   LOGO
============================================ */
.header-logo {
  width: auto;
  height: 120px;
  object-fit: contain;
  transition: height 0.3s ease;
}

/* Reduce altura del logo cuando hace scroll */
.sticky-header.active .header-logo {
  height: 60px;
}


.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 25px;      
  margin: 0;
  padding: 0;
}

/* .nav-item {
  position: relative;
} */

/* Estilo genérico de cada enlace en desktop */
.nav-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #092a5a;
  font-weight: 200;
  font-size: 16px;
  text-transform: uppercase;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
  padding: 8px 16px;    /* espacio interior para forma de “píldora” */
  border-radius: 20px;  /* esquinas redondeadas */
}

.nav-link:hover {
  background: #ebf3fe;  /* subrayado leve en hover */
  color: #0a1f44;
}


/* ============================================
   ICONOS PEQUEÑOS DE LAS INSTITUCIONES
   (sólo defino tamaño, se utilizan en la lista de CUETMX, INAFAM…)
============================================ */
.iconcuetmx-small,
.iconinafam-small,
.iconmaquiavelo-small,
.iconantares-small {
  width: 60px;
  height: 60px;
  object-fit: contain;
   margin-right: 8px;
}



/* ============================================
   EFECTO ARCOIRIS ICONOS
============================================ */


/* 1) Definimos la animación del degradado */
@keyframes rainbow {
  0%   { background-position: 0% 0; }
  50%  { background-position: 100% 0; }
  100% { background-position: 0% 0; }
}

/* 2) Sobre el enlace, colocamos el contenedor necesario */
.nav-link.rainbow-underline {
  position: relative; /* para posicionar ::after */
  overflow: hidden;
}

/* 3) El underline (pseudo-elemento) */
.nav-link.rainbow-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px; /* grosor de la línea */
  background: linear-gradient(
    90deg,
    #2F4899,  /* Azul RAVSOJA */
    #A21A5D,  /* Magenta RAVSOJA */
    #EB7118,  /* Naranja RAVSOJA */
    #23A19A,  /* Verde azulado RAVSOJA */
    #2F4899   /* Azul RAVSOJA para cerrar el loop */
  );
  background-size: 200% 100%;   /* doblamos el ancho para poder animar */
  transform: translateX(-100%); /* comenzamos totalmente a la izquierda */
  animation: rainbow 4s linear infinite; /* animación continua */
}

/* 4) Al pasar el ratón, revelamos la línea */
.nav-link.rainbow-underline:hover::after {
  transform: translateX(0);
  transition: transform 0.3s ease-out;
}




/* ============================================
   EFECTO ARCOIRIS ICONOS
============================================ */

.nav-list li a{
  text-decoration: none;
}


/* Oculto por defecto (escritorio) */
.nav-toggle,
.cerrar-menu{
  display: none;
}

/* ====== Móvil ====== */
@media (max-width: 550px) {
  .nav-toggle,
  .cerrar-menu{
    display: block;
    border: 0;
    font-size: 2.25rem;
    background: transparent;
    cursor: pointer;
  }

  /* PANEL de menú: ocupa TODA la pantalla */
  .nav{
    position: fixed;          /* ← antes era absolute */
    inset: 0;                 /* top:0; right:0; bottom:0; left:0 */
    background: #fbfbfb;
    z-index: 2000;            /* por encima del header (que está en 1000) */

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    padding: 2rem;

    /* estado cerrado (desliza desde la derecha) */
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform .35s ease, opacity .25s ease, visibility 0s .35s;
  }

  /* estado abierto */
  .nav.visible{
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform .35s ease, opacity .25s ease, visibility 0s;
  }

  .nav-list{
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
}

/* Overlay y bloqueo de scroll cuando el menú está abierto */
body.nav-open { overflow: hidden; }
body.nav-open::before{
  content: "";
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1990;            /* debajo del panel (2000), encima del resto */
}


/* ====== tablets ====== */
@media (max-width: 1024px) {
  .nav-toggle,
  .cerrar-menu{
    display: block;
    border: 0;
    font-size: 2.25rem;
    background: transparent;
    cursor: pointer;
  }

  /* PANEL de menú: ocupa TODA la pantalla */
  .nav{
    position: fixed;          /* ← antes era absolute */
    inset: 0;                 /* top:0; right:0; bottom:0; left:0 */
    background: #fbfbfb;
    z-index: 2000;            /* por encima del header (que está en 1000) */

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    padding: 2rem;

    /* estado cerrado (desliza desde la derecha) */
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform .35s ease, opacity .25s ease, visibility 0s .35s;
  }

  /* estado abierto */
  .nav.visible{
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform .35s ease, opacity .25s ease, visibility 0s;
  }

  .nav-list{
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
}

/* Overlay y bloqueo de scroll cuando el menú está abierto */
body.nav-open { overflow: hidden; }
body.nav-open::before{
  content: "";
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1990;            /* debajo del panel (2000), encima del resto */
}

/* Logo grande en desktop, se reduce automático en pantallas pequeñas */
.header-logo{
  height: clamp(68px, 12vw, 120px);            /* entre 48px y 120px */
}
.sticky-header.active .header-logo{
  height: clamp(40px, 9vw, 60px);              /* entre 40px y 60px */
}
