/* ==========================================================================
   Saisons & promos (inc/saisons.php) — chargé seulement si une ambiance ou la
   fenêtre promo est active. Les couleurs du site restent : la saison ajoute
   une lueur, un accent et ses décors (chauves-souris ou neige).
   ========================================================================== */

body.saison-halloween { --saison: #ff7a1a; --saison-2: #ffb547; --saison-lueur: rgba(255, 122, 26, .42); }
body.saison-noel { --saison: #ff4d6d; --saison-2: #f6c96b; --saison-lueur: rgba(255, 77, 109, .36); }

/* lueur de saison en haut de l'écran */
body.saison-halloween .wp-site-blocks::before,
body.saison-noel .wp-site-blocks::before {
  content: ""; position: fixed; z-index: 50; left: 0; right: 0; top: 0; height: 75vh; pointer-events: none;
  background: radial-gradient(ellipse 75% 60% at 50% -12%, var(--saison-lueur), transparent 72%);
  mix-blend-mode: screen; opacity: .8;
}
body.saison-noel .wp-site-blocks::before {
  background: radial-gradient(ellipse 45% 55% at 20% -12%, var(--saison-lueur), transparent 70%),
              radial-gradient(ellipse 45% 55% at 80% -12%, rgba(246, 201, 107, .28), transparent 70%);
}

/* accents : barre de progression de l'en-tête, points des étiquettes, mentions promo */
body.saison-halloween .entete-barre::after, body.saison-noel .entete-barre::after {
  background: linear-gradient(90deg, var(--saison), var(--saison-2)); box-shadow: 0 0 12px var(--saison);
}
body.saison-halloween .etiquette::before, body.saison-noel .etiquette::before { background: var(--saison); box-shadow: 0 0 10px var(--saison); }
body.saison-halloween .promo, body.saison-noel .promo { color: var(--saison-2); }
body.saison-halloween .wp-block-button__link:hover, body.saison-noel .wp-block-button__link:hover { box-shadow: 0 8px 30px -8px var(--saison-lueur); }
/* le vase en fil de fer de l'accueil prend la couleur de la saison (orange / rouge) */
body.saison-halloween .hero-scene { filter: hue-rotate(125deg) saturate(1.35); }
body.saison-noel .hero-scene { filter: hue-rotate(97deg) saturate(1.15); }

/* Halloween : chauves-souris */
.saison-chauves-souris { position: fixed; inset: 0; z-index: 60; overflow: hidden; pointer-events: none; }
.saison-chauve-souris {
  position: absolute; left: 0; width: var(--taille, 30px); color: #2a1538;
  filter: drop-shadow(0 0 1.5px rgba(255, 170, 70, .95)) drop-shadow(0 0 10px rgba(255, 122, 26, .65)); animation: vol-droite var(--duree, 12s) linear forwards;
}
.saison-chauve-souris.vers-gauche { animation-name: vol-gauche; }
.saison-chauve-souris svg { display: block; width: 100%; transform-origin: 50% 35%; animation: battement .2s ease-in-out infinite alternate; }
.saison-chauve-souris.vers-gauche svg { scale: -1 1; }
@keyframes vol-droite {
  0% { transform: translate(-70px, 0); } 25% { transform: translate(25vw, -5vh); } 50% { transform: translate(50vw, 3vh); }
  75% { transform: translate(75vw, -4vh); } 100% { transform: translate(calc(100vw + 70px), 2vh); }
}
@keyframes vol-gauche {
  0% { transform: translate(calc(100vw + 70px), 0); } 25% { transform: translate(75vw, 4vh); } 50% { transform: translate(50vw, -3vh); }
  75% { transform: translate(25vw, 4vh); } 100% { transform: translate(-70px, -2vh); }
}
@keyframes battement { from { transform: scaleY(1); } to { transform: scaleY(.4); } }

/* Noël : neige */
.saison-neige { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; pointer-events: none; opacity: .85; }

/* ---------- Fenêtre promo ---------- */
.saison-popup-carte.saison-halloween, .saison-pastille.saison-halloween { --accent: rgba(255, 122, 26, .55); --accent-plein: #ff7a1a; --accent-2: #ffb547; }
.saison-popup-carte.saison-noel, .saison-pastille.saison-noel { --accent: rgba(255, 77, 109, .5); --accent-plein: #ff4d6d; --accent-2: #f6c96b; }
.saison-popup-carte.saison-aucune, .saison-pastille.saison-aucune { --accent: rgba(112, 42, 254, .6); --accent-plein: #8a4ef9; --accent-2: #c19ef8; }

html.saison-popup-ouverte { overflow: hidden; }
.saison-popup[hidden], .saison-pastille[hidden] { display: none; }
.saison-popup { position: fixed; inset: 0; z-index: 100001; display: grid; place-items: center; padding: 16px; }
.saison-popup-fond {
  position: absolute; inset: 0; background: rgba(1, 3, 21, .72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .35s;
}
.saison-popup-carte {
  position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 34px 28px 26px; border-radius: 22px; text-align: center; color: var(--blanc);
  border: 1px solid rgba(193, 158, 248, .28);
  background: radial-gradient(ellipse 90% 55% at 50% 0%, var(--accent), transparent 70%), linear-gradient(180deg, #120c33, #070520);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .85), 0 0 70px -12px var(--accent);
  opacity: 0; transform: translateY(18px) scale(.97); transition: opacity .35s, transform .45s var(--sortie);
}
.saison-popup.est-ouvert .saison-popup-fond, .saison-popup.est-ouvert .saison-popup-carte { opacity: 1; transform: none; }
.saison-popup-fermer {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
  border-radius: 50%; border: 1px solid var(--ligne-forte); background: rgba(255, 255, 255, .06); color: var(--blanc); cursor: pointer;
}
.saison-popup-fermer:hover { background: rgba(255, 255, 255, .14); }
.saison-popup-fermer svg { width: 16px; height: 16px; }
.saison-popup-icone {
  width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 18px; color: var(--blanc);
  background: linear-gradient(160deg, var(--accent-plein), #1a1350 82%); border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 0 40px -4px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.saison-popup-icone svg { width: 32px; height: 32px; }
.saison-popup .etiquette { margin: 0 auto 12px; }
.saison-popup .etiquette::before { background: var(--accent-plein); box-shadow: 0 0 10px var(--accent-plein); }
.saison-popup-titre { margin: 0 0 10px; font-size: clamp(24px, 6.4vw, 30px); line-height: 1.15; font-weight: 500; color: var(--blanc); }
.saison-popup-texte { margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: var(--texte-2); }
.saison-popup-code {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 8px 8px 8px 14px; border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .04);
}
.saison-popup-remise { font-weight: 700; color: var(--accent-2); white-space: nowrap; }
.saison-popup-code code { flex: 1; min-width: 0; padding: 0; background: none; color: var(--blanc); text-align: left; font: 400 14px/1.2 var(--affiche); letter-spacing: .06em; overflow-wrap: anywhere; }
.saison-popup-code button {
  flex: none; height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08); color: var(--blanc); font: 600 12px var(--texte); cursor: pointer;
}
.saison-popup-code button:hover { background: rgba(255, 255, 255, .16); }
.saison-popup-note { margin: 0 0 18px; font-size: 11.5px; line-height: 1.5; color: var(--texte-3); }
.saison-popup-lettre { text-align: left; }
.saison-popup-lettre .lettre-note { text-align: center; }
.saison-popup-lettre .lettre-message { text-align: center; }
.saison-popup-actions { justify-content: center; }
.saison-popup-actions .wp-block-button, .saison-popup-actions .wp-block-button__link { width: 100%; }

/* pastille pour rouvrir la fenêtre */
.saison-pastille {
  position: fixed; left: 16px; bottom: 16px; z-index: 900; display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px 0 12px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .2); cursor: pointer;
  background: linear-gradient(160deg, var(--accent-plein), #1a1350 85%); color: var(--blanc); font: 700 13px var(--texte);
  box-shadow: 0 10px 30px -8px var(--accent); animation: pastille-entree .5s var(--sortie) both;
}
.saison-pastille svg { width: 20px; height: 20px; }
.saison-pastille:hover { transform: translateY(-2px); }
@keyframes pastille-entree { from { opacity: 0; transform: translateY(12px); } }

/* mobile : la fenêtre devient un panneau en bas de l'écran */
@media (max-width: 600px) {
  .saison-popup { place-items: end center; padding: 0; }
  .saison-popup-carte { width: 100%; max-height: 88dvh; border-radius: 22px 22px 0 0; padding: 30px 20px calc(22px + env(safe-area-inset-bottom)); transform: translateY(40px); }
  .saison-pastille { left: 12px; bottom: 12px; height: 40px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .saison-chauves-souris, .saison-neige { display: none; }
  .saison-popup-carte, .saison-popup-fond { transition: none; }
  .saison-pastille { animation: none; }
}
