/* =====================================================================
   NAVIDAD · Nexo Asociados (todas las páginas)
   Solo se carga del 1 de diciembre al 7 de enero (lo decide pages/htmlcreator.php).
   Para verlo fuera de esas fechas: añade ?navidad a la dirección.
   ===================================================================== */

/* 1. Gorro de Papá Noel sobre el logo (todas las páginas) */
.navbar-brand { position: relative; }
.navbar-brand::before {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  left: 12px; top: -1px; width: 40px; aspect-ratio: 86 / 46;
  background: url("../img/navidad/gorro.svg") no-repeat center / contain;
  transition: width .4s, left .4s, top .4s;
}
.navbar.scrolled .navbar-brand::before { left: 14px; top: 0; width: 30px; }

/* 2. Gorro para Nexi, el bot */
#nexi-btn::before {
  content: ""; position: absolute; z-index: 1; pointer-events: none;
  left: 7px; top: 0; width: 34px; aspect-ratio: 86 / 46;
  background: url("../img/navidad/gorro.svg") no-repeat center / contain;
  transform: rotate(-4deg);
}

/* 3. Cabeceras con foto (portada y páginas de proyectos) */
.nv-cabecera { position: relative; }
.portada-inicio .imagen-inicio { position: relative; z-index: 0; }
.portada-inicio { --nv-arriba: 93px; }          /* la foto empieza debajo del menú */
.hero-banner { --nv-arriba: 0px; }              /* la nieve cae por toda la cabecera */

.nv-nieve {
  position: absolute; left: 0; right: 0; top: var(--nv-arriba, 0px);
  width: 100%; height: calc(100% - var(--nv-arriba, 0px));
  z-index: 1; pointer-events: none;
}

/* Bolas colgando que se balancean */
.nv-bolas {
  position: absolute; top: 93px; z-index: 2; pointer-events: none;
  height: clamp(80px, 13vw, 190px); width: auto; aspect-ratio: 440 / 200;
  overflow: visible;
}
.nv-bolas--izq { left: 1%; }
.nv-bolas--der { right: 1%; }
.nv-bola { animation: nv-balanceo 4.5s ease-in-out infinite alternate; }
.nv-estrella { animation: nv-brillo 2.6s ease-in-out infinite alternate; }

@keyframes nv-balanceo {
  from { transform: rotate(-3.5deg); }
  to   { transform: rotate(3.5deg); }
}
@keyframes nv-brillo {
  from { opacity: .35; transform: scale(.7); }
  to   { opacity: 1;   transform: scale(1.1); }
}

/* Ola de nieve al final de la cabecera */
.nv-cabecera::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: clamp(22px, 3vw, 44px); z-index: 2; pointer-events: none;
  background: url("../img/navidad/ola-nieve.svg") no-repeat center bottom / 100% 100%;
}

/* "¡Felices fiestas!" sobre la nieve (solo portada) */
.nv-saludo {
  position: absolute; left: 50%; bottom: 0; z-index: 3; margin: 0;
  transform: translate(-50%, 50%);
  display: inline-flex; align-items: center; gap: .6em; white-space: nowrap;
  padding: .45em 1.4em;
  font-family: "NotoSerif", Georgia, serif; font-style: italic;
  font-size: clamp(.95rem, 1.6vw, 1.2rem); color: #1e6957;
  background: #fff; border: 1px solid rgba(128, 181, 165, .45); border-radius: 999px;
  box-shadow: 0 8px 22px rgba(30, 105, 87, .16);
}
.nv-saludo i { font-size: .8em; color: #80b5a5; }

/* 4. Páginas sin foto de cabecera: nieve verde suave y bolas bajo el menú */
.nv-cielo {
  position: absolute; left: 0; right: 0; top: 93px; height: 440px;
  z-index: 5; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 45%, transparent);
          mask-image: linear-gradient(#000 45%, transparent);
}
.nv-cielo .nv-nieve { top: 0; height: 100%; }
.nv-cielo .nv-bolas { top: 0; height: clamp(70px, 9vw, 140px); }
@media (max-width: 991px) {
  .nv-cielo .nv-bolas { display: none; }   /* en pantallas pequeñas taparían el texto */
}

/* 5. Copos grandes flotando de fondo en "¿Quiénes somos?" (portada) */
.section-inicio { position: relative; }
.section-inicio .inicio-centro { position: relative; z-index: 1; }
.nv-copos-fondo {
  position: absolute; inset: -60px 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.nv-copo {
  position: absolute; color: #80b5a5;
  animation: nv-flotar var(--dur, 14s) ease-in-out infinite alternate;
  animation-delay: var(--retraso, 0s);
}
.nv-copo svg { display: block; width: 100%; height: 100%; animation: nv-girar var(--giro, 40s) linear infinite; }

@keyframes nv-flotar {
  from { transform: translate(0, -14px); }
  to   { transform: translate(10px, 18px); }
}
@keyframes nv-girar { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .nv-copo:nth-child(n+5) { display: none; }
}

/* Con "reducir movimiento" activado, todo queda quieto */
@media (prefers-reduced-motion: reduce) {
  .nv-bola, .nv-estrella, .nv-copo, .nv-copo svg { animation: none; }
}
