/* ==========================================================================
   ENCABEZADO NAVIDEÑO — 18 de Marzo Team (prototipo v1)
   Capa decorativa que se coloca DETRÁS del contenido del encabezado.
   - No cambia la altura (63 px y sus variantes 49 / 83 / 91 px).
   - No intercepta clics (pointer-events: none).
   - No toca el logotipo, los avatares, el botón Menú ni el globo rojo.
   Se activa con la clase .tm-header--navidad (la pone encabezado-navidad.js).
   ========================================================================== */

.tm-header.tm-header--navidad {
  /* Color de respaldo mientras se dibuja la escena */
  background: linear-gradient(180deg, #4673b4 0%, #79a5d9 40%, #b6d1ee 72%, #e6f0fa 100%);
  border-bottom-color: #c9dbee;
}

/* El contenido real queda SIEMPRE por encima de la escena */
.tm-header--navidad .tm-header__inner {
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------------- Escena */
.tmn-escena {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;              /* nada se sale del encabezado */
  pointer-events: none;          /* nunca recibe clics ni toques */
  user-select: none;
  contain: strict;               /* el navegador no recalcula nada fuera de aquí */
  background:
    radial-gradient(120px 60px at var(--tmn-luna-x, 30%) var(--tmn-luna-y, 30%), rgba(255, 246, 220, .38), rgba(255, 246, 220, 0) 70%),
    linear-gradient(180deg, #3c69ab 0%, #6f9bd3 40%, #aac9ec 70%, #dbe8f6 100%);
}

.tmn-escena > *,
.tmn-luz,
.tmn-estrella { position: absolute; left: 0; top: 0; }
.tmn-escena svg { display: block; overflow: visible; }

/* Estrellas que titilan (pocas, solo opacidad: trabajo del compositor) */
.tmn-estrella {
  width: 2px;
  height: 2px;
  margin: -1px 0 0 -1px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 3px 1px rgba(255, 255, 255, .55);
  opacity: .35;
  animation: tmn-titilar 5s ease-in-out infinite;
}
@keyframes tmn-titilar {
  0%, 100% { opacity: .25; }
  50%      { opacity: .95; }
}

/* ------------------------------------------------- Luces de las ventanas
   Cada luz es un <span> diminuto encima de la ventana dibujada en el SVG.
   Solo se anima la opacidad, muy despacio (7 a 16 s por ciclo). */
.tmn-luz {
  border-radius: .5px;
  background: #ffd877;
  box-shadow: 0 0 2px .5px rgba(255, 214, 120, .9), 0 0 6px 2px rgba(255, 170, 60, .45);
  opacity: .92;
}
.tmn-luz--atras {
  background: #ffe19a;
  box-shadow: 0 0 2px .5px rgba(255, 214, 120, .7), 0 0 4px 1px rgba(255, 170, 60, .3);
}
.tmn-anim .tmn-luz--a { animation: tmn-luz-a 11s ease-in-out infinite; }
.tmn-anim .tmn-luz--b { animation: tmn-luz-b 14s ease-in-out infinite; }
.tmn-anim .tmn-luz--c { animation: tmn-luz-c 9s ease-in-out infinite; }

/* Respiración cálida */
@keyframes tmn-luz-a {
  0%, 100% { opacity: .95; }
  45%      { opacity: .62; }
  60%      { opacity: .88; }
  78%      { opacity: .7; }
}
/* Alguien sale del cuarto: se atenúa despacio y vuelve */
@keyframes tmn-luz-b {
  0%, 30%  { opacity: .95; }
  48%, 62% { opacity: .18; }
  80%, 100%{ opacity: .95; }
}
/* Chimenea/vela: vaivén suave */
@keyframes tmn-luz-c {
  0%, 100% { opacity: .78; }
  50%      { opacity: 1; }
}

/* --------------------------------------------- Sombra clara del contenido
   Sin recuadros ni círculos: solo un resplandor claro y fino alrededor de
   letras, iconos, logotipo y avatar para que se distingan sobre el cielo.
   No cambia colores, tamaños ni posiciones de los recursos originales. */
.tm-header--navidad .tm-brand__name,
.tm-header--navidad .tm-menu-btn__label,
.tm-header--navidad .account-badge__name,
.tm-header--navidad .account-badge__role {
  text-shadow:
    0 0 1px rgba(255, 255, 255, .95),
    0 0 3px rgba(255, 255, 255, .9),
    0 0 7px rgba(255, 255, 255, .65);
}
.tm-header--navidad .tm-menu-btn__icon,
.tm-header--navidad .tm-brand__logo,
.tm-header--navidad .tm-header__actions .account-badge__avatar img {
  filter:
    drop-shadow(0 0 1px rgba(255, 255, 255, .95))
    drop-shadow(0 0 3px rgba(255, 255, 255, .8));
}

/* ---------------------------------------------------------------- Trineo */
.tmn-trineo {
  display: none;
  will-change: transform;
  filter: drop-shadow(0 0 1.5px rgba(255, 248, 225, .55));
}
.tmn-trineo.tmn-vuela { display: block; }

.tmn-trineo .tmn-pata {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: tmn-galope .44s ease-in-out infinite alternate;
}
.tmn-trineo .tmn-pata--tras { animation-name: tmn-galope-tras; }
.tmn-trineo .tmn-reno {
  animation: tmn-reno .88s ease-in-out infinite;
}
@keyframes tmn-galope      { from { transform: rotate(-16deg); } to { transform: rotate(14deg); } }
@keyframes tmn-galope-tras { from { transform: rotate(14deg); }  to { transform: rotate(-16deg); } }
@keyframes tmn-reno {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-.9px); }
}

/* --------------------------------------------------------------- Pausas */
.tmn-pausa .tmn-luz,
.tmn-pausa .tmn-estrella,
.tmn-pausa .tmn-trineo * { animation-play-state: paused !important; }

/* Movimiento reducido: escena fija, sin titileos ni galope */
@media (prefers-reduced-motion: reduce) {
  .tmn-luz, .tmn-estrella, .tmn-trineo * { animation: none !important; }
}

/* Impresión: el encabezado vuelve a su fondo habitual */
@media print {
  .tmn-escena { display: none !important; }
  .tm-header.tm-header--navidad { background: #fff; }
}
