/* ============================================================
   THÈMES SAISONNIERS — danslateteetdanslassiette.fr
   Activation automatique par dates (gérée par saisons.js) :
   - Halloween  : du 25 octobre au 2 novembre
   - Noël        : du 1er au 26 décembre
   Test manuel : ajouter ?theme=halloween ou ?theme=noel à l'URL
   ============================================================ */

/* ---------- ACCENTS ET COULEURS ---------- */

html.theme-halloween {
  --saison-primaire: #E8641C;        /* orange citrouille */
  --saison-secondaire: #7B3FA0;      /* violet nuit */
  --saison-fonce: #1A1124;           /* noir-violet */
}

html.theme-noel {
  --saison-primaire: #B01E2F;        /* rouge Noël */
  --saison-secondaire: #1E6B4F;      /* vert sapin */
  --saison-fonce: #14251D;
}

/* Recoloration des accents (avec prudence : fond général inchangé) */
html.theme-halloween h1,
html.theme-halloween h2,
html.theme-halloween .promo-band .promo-label,
html.theme-noel h1,
html.theme-noel h2,
html.theme-noel .promo-band .promo-label {
  color: var(--saison-primaire) !important;
}

html.theme-halloween a:not(.btn):not(.bouton):hover,
html.theme-noel a:not(.btn):not(.bouton):hover {
  color: var(--saison-primaire) !important;
}

html.theme-halloween .btn,
html.theme-halloween .bouton,
html.theme-halloween button,
html.theme-noel .btn,
html.theme-noel .bouton,
html.theme-noel button {
  background-color: var(--saison-primaire) !important;
  border-color: var(--saison-fonce) !important;
}

html.theme-halloween .promo-band,
html.theme-noel .promo-band {
  background: linear-gradient(135deg, var(--saison-secondaire), var(--saison-primaire)) !important;
}

/* Bandeau saison discret en haut de page */
#saison-bandeau {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  text-align: center;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #FAF6EA;
  background: var(--saison-secondaire);
}
html.theme-halloween #saison-bandeau::after { content: " 🎃 Happy Halloween !"; }
html.theme-noel #saison-bandeau::after { content: " 🎄 Joyeuses Fêtes !"; }
body { padding-top: 0; }
html.theme-halloween body,
html.theme-noel body { padding-top: 32px; }

/* ---------- DÉCORS COMMUNS ---------- */
#saison-decor { position: fixed; inset: 0; pointer-events: none; z-index: 9980; overflow: hidden; }
.saison-anim { position: absolute; will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  .saison-anim { display: none !important; }
}

/* ---------- HALLOWEEN ---------- */

/* Araignée qui descend le long d'un fil */
@keyframes saison-descente {
  0%   { transform: translateY(-80px); }
  35%  { transform: translateY(28vh); }
  55%  { transform: translateY(14vh); }
  75%  { transform: translateY(40vh); }
  100% { transform: translateY(120vh); }
}
.saison-fil {
  top: 0; width: 1px; height: 55px;
  background: rgba(20, 15, 30, 0.55);
}
.saison-araignee {
  top: 0; width: 34px; height: 38px;
  animation: saison-descente 14s ease-in-out infinite;
}
.saison-araignee svg { animation: saison-balancement 3s ease-in-out infinite alternate; }
@keyframes saison-balancement {
  from { transform: rotate(-12deg); }
  to   { transform: rotate(12deg); }
}

/* Crâne clignotant en coin */
@keyframes saison-clignote {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 0.25; }
}
.saison-crane {
  width: 40px; opacity: 0.75;
  animation: saison-balancement 4s ease-in-out infinite alternate, saison-clignote 6s ease-in-out infinite;
}

/* Chauve-souris qui traverse l'écran */
@keyframes saison-vol {
  0%   { transform: translate(-10vw, 12vh) scaleX(1); }
  48%  { transform: translate(105vw, 4vh) scaleX(1); }
  50%  { transform: translate(105vw, 4vh) scaleX(-1); }
  98%  { transform: translate(-10vw, 20vh) scaleX(-1); }
  100% { transform: translate(-10vw, 20vh) scaleX(-1); }
}
.saison-chauvesouris {
  top: 8vh; width: 46px;
  animation: saison-vol 26s linear infinite;
}
/* Battements d'ailes : chaque aile pivote à sa racine, léger envol du corps */
.saison-chauvesouris svg { animation: saison-envol 2.2s ease-in-out infinite; }
@keyframes saison-envol {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
.saison-aile { transform-box: fill-box; }
.aile-gauche { transform-origin: 100% 55%; animation: saison-aile-g 0.42s ease-in-out infinite alternate; }
.aile-droite { transform-origin: 0% 55%;   animation: saison-aile-d 0.42s ease-in-out infinite alternate; }
@keyframes saison-aile-g { from { transform: rotate(0deg); } to { transform: rotate(34deg); } }
@keyframes saison-aile-d { from { transform: rotate(0deg); } to { transform: rotate(-34deg); } }

/* Toile d'araignée discrète dans un coin */
.saison-toile { top: 0; right: 0; width: 110px; opacity: 0.35; }

/* ---------- NOËL ---------- */

/* Flocons qui tombent */
@keyframes saison-flocon {
  0%   { transform: translateY(-6vh) translateX(0) rotate(0deg); opacity: 0.9; }
  100% { transform: translateY(106vh) translateX(6vw) rotate(360deg); opacity: 0.5; }
}
.saison-flocon {
  top: -5vh; width: 18px;
  animation: saison-flocon linear infinite;
}

/* Guirlande lumineuse scintillante en haut */
@keyframes saison-ampoule {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 6px currentColor); }
  50%      { opacity: 0.35; filter: none; }
}
.saison-ampoule { animation: saison-ampoule 1.6s ease-in-out infinite; }
.saison-ampoule:nth-child(2n) { animation-delay: 0.8s; }

/* Sapin ou cadeau en coin */
.saison-cadeau {
  bottom: 12px; right: 12px; width: 54px; opacity: 0.85;
  animation: saison-balancement 5s ease-in-out infinite alternate;
}
