/* ═══════════════════════════════════════════════════════════════
   slidou.me — Thèmes saisonniers (v17) — CSS
   Halloween · Noël · Saint-Valentin
   Tout vit derrière les classes body.season-* ajoutées par season.js
   ═══════════════════════════════════════════════════════════════ */

/* ── 🎃 HALLOWEEN : nuit citrouille ───────────────────────────── */
body.season-halloween {
  --bg-color: #17131f;
  --sidebar-bg: #201829;
  --text-color: #e8e2f2;
  --secondary-text: #a89fc0;
  --author-text: #ffffff;
  --border-color: #3a2f4d;
  --link-color: #ff9a3d;
  --star-color: #ffb347;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --quote-bg: #201829;
  --hm-0: rgba(255, 154, 61, 0.07);
  --hm-1: rgba(255, 154, 61, 0.25);
  --hm-2: rgba(255, 154, 61, 0.45);
  --hm-3: rgba(255, 154, 61, 0.65);
  --hm-4: rgba(255, 154, 61, 0.9);
}
body.season-halloween ::selection { background: rgba(255, 154, 61, 0.4); }

/* ── 🎄 NOËL : nuit glacée, rouge et or ───────────────────────── */
body.season-noel {
  --bg-color: #101823;
  --sidebar-bg: #16222f;
  --text-color: #e6edf5;
  --secondary-text: #9fb2c4;
  --author-text: #ffffff;
  --border-color: #2a3b4e;
  --link-color: #e05555;
  --star-color: #f0c75e;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --quote-bg: #16222f;
  --hm-0: rgba(224, 85, 85, 0.07);
  --hm-1: rgba(224, 85, 85, 0.25);
  --hm-2: rgba(224, 85, 85, 0.45);
  --hm-3: rgba(224, 85, 85, 0.65);
  --hm-4: rgba(224, 85, 85, 0.9);
}
body.season-noel ::selection { background: rgba(224, 85, 85, 0.4); }

/* ── 💝 SAINT-VALENTIN : nuit prune, rose vif ─────────────────── */
body.season-valentin {
  --bg-color: #1d1218;
  --sidebar-bg: #281822;
  --text-color: #f2e6ec;
  --secondary-text: #c0a3b2;
  --author-text: #ffffff;
  --border-color: #46293a;
  --link-color: #ff5b8d;
  --star-color: #ff8fb3;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --quote-bg: #281822;
  --hm-0: rgba(255, 91, 141, 0.07);
  --hm-1: rgba(255, 91, 141, 0.25);
  --hm-2: rgba(255, 91, 141, 0.45);
  --hm-3: rgba(255, 91, 141, 0.65);
  --hm-4: rgba(255, 91, 141, 0.9);
}
body.season-valentin ::selection { background: rgba(255, 91, 141, 0.4); }

/* ═══ PARTICULES : chute régulière ═════════════════════════════ */
#season-particles {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 30; /* au-dessus du contenu, sous la perruche (40) et la palette (3000) */
}
.sp {
  position: absolute;
  top: -7vh;
  left: var(--sp-x);
  opacity: var(--sp-op);
  animation: spFall var(--sp-dur) linear forwards;
  will-change: transform;
}
.sp-sway { animation: spSway var(--sw-dur) ease-in-out infinite alternate; }

/* feuilles */
.sp-halloween .sp-sway { font-size: 19px; }
/* cœurs */
.sp-valentin .sp-sway {
  color: #ff5b8d;
  font-size: 17px;
  text-shadow: 0 0 7px rgba(255, 91, 141, 0.55);
}
/* flocons : dessinés en CSS, rendu identique partout */
.sp-noel .sp-sway::before {
  content: '';
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.28) 58%, transparent 72%);
  filter: blur(0.4px);
}

@keyframes spFall {
  from { transform: translateY(0) scale(var(--sp-scale, 1)); }
  to   { transform: translateY(114vh) scale(var(--sp-scale, 1)); }
}
@keyframes spSway {
  from { transform: translateX(calc(var(--sw-x) * -1)) rotate(-14deg); }
  to   { transform: translateX(var(--sw-x)) rotate(14deg); }
}

/* ═══ PLUIE DE BURST (eggs) ════════════════════════════════════ */
.season-burst {
  position: fixed;
  top: -8vh;
  z-index: 3500; /* au-dessus de la palette de recherche (3000) */
  pointer-events: none;
  font-family: 'Space Grotesk', sans-serif;
  animation: spFall var(--sp-dur) cubic-bezier(0.3, 0.4, 0.6, 1) forwards;
}

/* ═══ BOUTON JOUR/NUIT = EMBLÈME DE LA SAISON ══════════════════ */
body.season-halloween #theme-toggle,
body.season-noel #theme-toggle,
body.season-valentin #theme-toggle { position: relative; overflow: visible; }
#theme-toggle.season-wiggle { animation: tgWiggle 0.45s cubic-bezier(0.36, 1.6, 0.4, 1); }
@keyframes tgWiggle {
  0%   { transform: rotate(0) scale(1); }
  35%  { transform: rotate(-14deg) scale(1.18); }
  70%  { transform: rotate(9deg) scale(1.08); }
  100% { transform: rotate(0) scale(1); }
}
/* ═══ AMBIANCE HALLOWEEN : toile, araignée, chauve-souris ══════
   v17 : toile élargie et fil plus visible (elle était trop discrète) */
.season-web {
  position: fixed;
  top: 0;
  right: 0;
  width: 230px;
  height: 230px;
  pointer-events: none;
  z-index: 25;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='190' viewBox='0 0 190 190'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.22' stroke-width='1.3'%3E%3Ccircle cx='190' cy='0' r='48'/%3E%3Ccircle cx='190' cy='0' r='96'/%3E%3Ccircle cx='190' cy='0' r='144'/%3E%3Ccircle cx='190' cy='0' r='188'/%3E%3Cpath d='M190 0 L0 0 M190 0 L0 66 M190 0 L0 132 M190 0 L0 190 M190 0 L62 190 M190 0 L126 190 M190 0 L190 190'/%3E%3C/g%3E%3C/svg%3E") no-repeat;
  background-size: 100% 100%;
}
.season-spider {
  position: fixed;
  top: 0;
  right: 66px;
  z-index: 29;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.season-spider .spt {
  width: 2px;
  height: 30px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.4));
  animation: spThread 9.5s ease-in-out infinite;
}
.season-spider .spb {
  font-size: 21px;
  line-height: 1;
  margin-top: -3px;
  animation: spBob 9.5s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
@keyframes spThread {
  0%, 100% { height: 30px; }
  42%, 58% { height: 118px; }
}
@keyframes spBob {
  0%, 100% { transform: rotate(-4deg); }
  42%, 58% { transform: rotate(5deg); }
}
.season-bat {
  position: fixed;
  top: 9vh;
  right: -46px;
  z-index: 60;
  font-size: 22px;
  line-height: 1;
  pointer-events: none;
  animation: batFly 11s linear forwards;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}
@keyframes batFly {
  0%   { transform: translate(0, 0); opacity: 0; }
  6%   { opacity: 1; }
  25%  { transform: translate(-26vw, 52px); }
  50%  { transform: translate(-52vw, -26px); }
  75%  { transform: translate(-80vw, 38px); }
  94%  { opacity: 1; }
  100% { transform: translate(-108vw, -10px); opacity: 0; }
}

/* ═══ GUIRLANDE (Noël) ═════════════════════════════════════════ */
.season-garland {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 45;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 0 10px;
  pointer-events: none;
}
.season-garland::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(150, 118, 84, 0), rgba(150, 118, 84, 0.55) 8%, rgba(150, 118, 84, 0.55) 92%, rgba(150, 118, 84, 0));
}
.season-garland span {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.16);
  animation: garlandTwinkle 1.7s ease-in-out infinite alternate;
}
@keyframes garlandTwinkle {
  from { opacity: 0.5; filter: brightness(0.65); }
  to   { opacity: 1;   filter: brightness(1.4); }
}

/* ═══ COSTUMES DES PERRUCHES (dessinés dans leurs SVG) ═════════ */
.season-cst-anim { transform-box: fill-box; transform-origin: 50% 92%; }
body.season-halloween .season-cst-anim { animation: hatSway 5.6s ease-in-out infinite; }
@keyframes hatSway {
  0%, 100% { transform: rotate(0deg); }
  30%      { transform: rotate(-5deg); }
  65%      { transform: rotate(4deg); }
}
body.season-valentin .season-cst-float { transform-origin: 50% 50%; animation: cstFloat 2.6s ease-in-out infinite alternate; }
@keyframes cstFloat {
  from { transform: translateY(0); }
  to   { transform: translateY(-3.5px); }
}

/* ═══ PANCARTE DES JOURS SPÉCIAUX ══════════════════════════════ */
.season-chip {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12.5px;
  color: var(--text-color);
  background: rgba(8, 6, 12, 0.72);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.season-chip .sc-emoji { font-size: 15px; }
body.season-special .season-chip { animation: chipPulse 2.4s ease-in-out infinite; }
@keyframes chipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 170, 80, 0); }
  50%      { box-shadow: 0 0 14px 2px rgba(255, 170, 80, 0.3); }
}

/* ═══ ACCESSIBILITÉ & MOBILE ═══════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  #season-particles,
  .season-burst,
  .season-spider,
  .season-bat { display: none; }
  .season-garland span { animation: none; }
  .season-cst-anim,
  .season-cst-float { animation: none !important; }
  #theme-toggle.season-wiggle { animation: none; }
}

@media (max-width: 720px) {
  .season-web { width: 150px; height: 150px; }
  .season-spider { right: 40px; }
  .season-spider .spt { height: 20px; }
  .season-garland span { width: 7px; height: 7px; margin-top: 6px; }
  .season-chip { left: 10px; bottom: 10px; font-size: 11.5px; padding: 6px 11px; }
  .sp-halloween .sp-sway { font-size: 16px; }
  .sp-noel .sp-sway::before { width: 7px; height: 7px; }
  .sp-valentin .sp-sway { font-size: 14px; }
}
