/*! Decoración navideña · Atenas Playa
   Uso: añadir el atributo data-navidad a la <section> que se quiere decorar.
   Variables opcionales: --navidad-cable, --navidad-foco, --navidad-fondo-boton, --navidad-texto-boton, --navidad-borde-boton.
   Nota: la guirnalda ocupa unos 60 px por arriba de la sección; conviene que el padding superior sea de 64 px o más. */

[data-navidad].navidad-activa {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* ---------- Guirnalda ---------- */
.navidad-luces {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
}
.navidad-luces svg { display: block; }

.navidad-cable {
  fill: none;
  stroke: var(--navidad-cable, #2f3d3a);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.navidad-casquillo { fill: var(--navidad-cable, #2f3d3a); }

.navidad-halo  { fill: var(--c); opacity: .13; }
.navidad-halo2 { fill: var(--c); opacity: .22; }
.navidad-bulbo {
  fill: var(--c);
  stroke: rgb(0 0 0 / .22);
  stroke-width: .6;
}
.navidad-reflejo { fill: #fff; opacity: .7; }

/* Parpadeo suave (nunca más de 3 destellos por segundo) en 3 fases */
@media (prefers-reduced-motion: no-preference) {
  .navidad-luz {
    animation: navidad-brillo 3.6s ease-in-out infinite;
    animation-delay: calc(var(--fase) * -1.2s);
  }
}
@keyframes navidad-brillo {
  0%, 100% { opacity: .5; }
  50%      { opacity: 1; }
}
[data-navidad-pausado] .navidad-luz { animation-play-state: paused; }

/* Encendido: apagadas mientras esperan; después se encienden una a una (de izquierda a derecha) */
@media (prefers-reduced-motion: no-preference) {
  [data-navidad-encendido="espera"] .navidad-enc { opacity: .08; }
  [data-navidad-encendido="on"] .navidad-enc {
    animation: navidad-encender .7s ease-out both;
    animation-delay: calc(var(--i) * 70ms);
  }
}
@keyframes navidad-encender {
  from { opacity: .08; }
  to   { opacity: 1; }
}

/* ---------- Nieve (canvas de three.js) ---------- */
.navidad-nieve {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Cinta hacia los menús ---------- */
.navidad-cinta {
  position: relative;
  isolation: isolate;
  display: block;
  width: fit-content;
  max-width: calc(100% - 3.5rem);
  margin: 0 auto 2.5rem;
  color: #fff6e0;
  text-decoration: none;
  font-family: inherit;   /* usa la tipografía de la web */
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}
.navidad-cinta::before,
.navidad-cinta::after {
  content: "";
  position: absolute;
  top: .55rem;
  bottom: -.55rem;
  width: 2.2rem;
  background: #0d221e;
  z-index: -1;
}
.navidad-cinta::before {
  left: -1.6rem;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, .9rem 50%);
}
.navidad-cinta::after {
  right: -1.6rem;
  clip-path: polygon(0 0, 100% 0, calc(100% - .9rem) 50%, 100% 100%, 0 100%);
}
.navidad-cinta-cuerpo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;   /* texto y botón comparten la misma línea base */
  justify-content: center;
  gap: .85rem 1.1rem;
  padding: 1.1rem 2.1rem;
  background: #15352f;
  box-shadow: 0 8px 16px -8px rgb(0 0 0 / .5);
  outline: 1px dashed rgb(255 200 97 / .8);
  outline-offset: -6px;
  transition: background-color .2s;
}
.navidad-cinta:hover .navidad-cinta-cuerpo { background: #1d453d; }
.navidad-cinta-cuerpo > span {
  margin: 0;
  font: inherit;
  line-height: 1;
}
.navidad-cinta-cuerpo > span:not(.navidad-cinta-boton) {
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}
.navidad-cinta-cuerpo > .navidad-cinta-boton {
  padding: .4rem .9rem;
  border-radius: 999px;
  background: #ffc861;
  color: #15352f;
  font-size: .85rem;
}
.navidad-cinta:focus-visible {
  outline: 2px solid var(--navidad-foco, #15352f);
  outline-offset: 6px;
}

@media (max-width: 600px) {
  .navidad-cinta-cuerpo { padding: 1.3rem 1.6rem 1.4rem; }
}

/* ---------- Botón de pausa (WCAG 2.2.2) ---------- */
.navidad-pausa {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  padding: .55rem .85rem;
  border: 1px solid var(--navidad-borde-boton, rgb(118 195 178 / .9));
  border-radius: 999px;
  background: var(--navidad-fondo-boton, rgb(255 255 255 / .92));
  color: var(--navidad-texto-boton, #2f3d3a);
  font: 500 .75rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
}
.navidad-pausa:hover { border-color: var(--navidad-texto-boton, #2f3d3a); }
.navidad-pausa:focus-visible {
  outline: 2px solid var(--navidad-texto-boton, #2f3d3a);
  outline-offset: 2px;
}
