/* =====================================================================
   Thème saisonnier « Soir de brume » — Halloween 2026
   ---------------------------------------------------------------------
   Tout le thème vit dans ce fichier et dans halloween.js. Rien ne
   s'applique tant que <html> n'a pas la classe .theme-halloween, que
   halloween.js pose jusqu'au 2 novembre 2026 inclusivement (heure de
   Terrebonne), ou sur demande avec ?halloween=1.

   Pour retirer le thème : supprimer la ligne
     <link rel="stylesheet" href="/halloween.css"><script src="/halloween.js"></script>
   dans chaque page publique, puis ces deux fichiers.

   Règles : uniquement des couleurs et des éléments décoratifs en
   position absolue — aucune taille ni marge de mise en page ne change
   (pas de décalage), et tout s'immobilise avec prefers-reduced-motion.
   ===================================================================== */

html.theme-halloween {
  --hw-night: #160F24;
  --hw-dusk: #2B1F40;
  --hw-violet: #5B4B78;
  --hw-amber: #EFA85E;
  --hw-amber-soft: #F6C98E;
  --hw-moon: #F4ECD8;
  --hw-cream: #F5EFE3;
  --hw-silhouette: #120B1C;
}

/* ---------- En-tête : la nuit commence ici ---------- */
.theme-halloween .site-header {
  background: var(--hw-night);
  border-bottom-color: rgba(199, 184, 217, 0.14);
}
.theme-halloween .brand-text { color: var(--hw-cream); }
/* Le logo est une silhouette noire : on l'inverse en clair sur la nuit. */
.theme-halloween .site-header .brand-mark { filter: invert(0.94) sepia(0.18); }
.theme-halloween .site-nav a { color: rgba(245, 239, 227, 0.72); }
.theme-halloween .site-nav a:hover,
.theme-halloween .subnav a:hover { color: var(--hw-amber-soft); }
.theme-halloween .site-nav a[aria-current="page"],
.theme-halloween .site-nav a.is-active { color: var(--hw-cream); }
.theme-halloween .site-nav a[aria-current="page"]::after,
.theme-halloween .site-nav a.is-active::after { background: var(--hw-amber); }
.theme-halloween .subnav {
  background: var(--hw-night);
  border-color: rgba(199, 184, 217, 0.16);
  box-shadow: 0 24px 40px -22px rgba(0, 0, 0, 0.6);
}
.theme-halloween .subnav a,
.theme-halloween .nav-sub-toggle { color: rgba(245, 239, 227, 0.72); }
.theme-halloween .nav-toggle span { background: var(--hw-cream); }
.theme-halloween .lang-toggle,
.theme-halloween .btn-call {
  color: var(--hw-cream);
  border-color: rgba(245, 239, 227, 0.28);
}
.theme-halloween .lang-toggle:hover,
.theme-halloween .btn-call:hover {
  color: var(--hw-amber-soft);
  border-color: var(--hw-amber);
}
.theme-halloween .site-header :focus-visible,
.theme-halloween main > :is(.hero, .shop-hero):first-child :focus-visible { outline-color: var(--hw-amber); }

@media (max-width: 1300px) {
  .theme-halloween .site-nav {
    background: var(--hw-night);
    border-top-color: rgba(199, 184, 217, 0.14);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.6);
  }
  .theme-halloween .site-nav a,
  .theme-halloween .nav-parent-row { border-bottom-color: rgba(245, 239, 227, 0.08); }
  .theme-halloween .subnav { background: none; box-shadow: none; }
}

/* ---------- Haut de page : ciel de crépuscule ---------- */
/* Le premier .hero / .shop-hero de la page devient le ciel. */
.theme-halloween main > :is(.hero, .shop-hero):first-child {
  position: relative;
  overflow: hidden;
  overflow: clip;
  color: var(--hw-cream);
  background:
    radial-gradient(ellipse 55% 75% at var(--hw-glow-x, 86%) var(--hw-glow-y, 22%), rgba(244, 236, 216, 0.17), transparent 62%),
    linear-gradient(180deg, var(--hw-night) 0%, var(--hw-dusk) 36%, #45365F 72%, var(--hw-violet) 100%);
}
.theme-halloween main > .hero:first-child { --hw-glow-x: 76%; --hw-glow-y: 48%; }
/* Quelques étoiles, seulement du côté de la lune et seulement sur grand
   écran : derrière le texte, elles se liraient comme des points parasites. */
@media (min-width: 981px) {
  .theme-halloween main > :is(.hero, .shop-hero):first-child::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      radial-gradient(circle at 68% 7%, rgba(255, 246, 226, 0.7) 0 1px, transparent 1.6px),
      radial-gradient(circle at 75% 21%, rgba(255, 246, 226, 0.5) 0 0.8px, transparent 1.4px),
      radial-gradient(circle at 83% 9%, rgba(255, 246, 226, 0.8) 0 1px, transparent 1.6px),
      radial-gradient(circle at 91% 30%, rgba(255, 246, 226, 0.45) 0 0.8px, transparent 1.4px),
      radial-gradient(circle at 97% 12%, rgba(255, 246, 226, 0.65) 0 1px, transparent 1.6px);
  }
  /* Toilettage : les pastilles occupent le coin haut-droit, la lune se
     lève plus bas, à côté de la carte fidélité. */
  .theme-halloween main > .shop-hero:first-child:has(.salon-grid) .hw-moon { top: 47%; }
  .theme-halloween main > .shop-hero:first-child:has(.salon-grid) { --hw-glow-y: 58%; }
}


.theme-halloween main > :is(.hero, .shop-hero):first-child .eyebrow { color: #CDBFE3; }
.theme-halloween main > :is(.hero, .shop-hero):first-child .hero-title,
.theme-halloween main > :is(.hero, .shop-hero):first-child .shop-hero-title { color: var(--hw-cream); }
.theme-halloween main > :is(.hero, .shop-hero):first-child .hero-title em { color: var(--hw-amber); }
.theme-halloween main > :is(.hero, .shop-hero):first-child .hero-lede,
.theme-halloween main > :is(.hero, .shop-hero):first-child .shop-hero-inner .hero-lede { color: rgba(245, 239, 227, 0.84); }
.theme-halloween main > :is(.hero, .shop-hero):first-child .btn-primary { background: var(--hw-amber); color: var(--hw-night); }
.theme-halloween main > :is(.hero, .shop-hero):first-child .btn-primary:hover { background: var(--hw-amber-soft); }
.theme-halloween main > :is(.hero, .shop-hero):first-child .btn-ghost { color: var(--hw-cream); border-color: rgba(245, 239, 227, 0.4); }
.theme-halloween main > :is(.hero, .shop-hero):first-child .btn-ghost:hover { color: var(--hw-amber-soft); border-color: var(--hw-amber); }

/* Le contenu passe devant le décor ; sur l'accueil, la lune (le logo)
   reste derrière les chauves-souris. */
.theme-halloween main > :is(.hero, .shop-hero):first-child .shop-hero-inner,
.theme-halloween main > :is(.hero, .shop-hero):first-child .hero-copy { position: relative; z-index: 2; }
.theme-halloween main > :is(.hero, .shop-hero):first-child .hero-visual { z-index: 0; }

/* Petites cartes crème du haut de page : bord ambre de saison. */
.theme-halloween main > :is(.hero, .shop-hero):first-child .stamp-badge { border-color: rgba(239, 168, 94, 0.75); }
.theme-halloween main > :is(.hero, .shop-hero):first-child .permit-card,
.theme-halloween main > :is(.hero, .shop-hero):first-child .loyalty-card { border-color: rgba(239, 168, 94, 0.55); }

/* ---------- Signature : la lune des Petits Poilus ----------
   Sur l'accueil, le médaillon du logo devient la pleine lune : la
   silhouette du chien, du chat, du lapin et de l'oiseau s'y découpe
   comme sur une affiche d'Halloween. */
.theme-halloween main > :is(.hero, .shop-hero):first-child .glow-orb {
  background:
    radial-gradient(circle at 30% 70%, rgba(196, 180, 150, 0.32) 0 7%, transparent 7.6%),
    radial-gradient(circle at 74% 30%, rgba(196, 180, 150, 0.26) 0 5%, transparent 5.6%),
    radial-gradient(circle at 64% 78%, rgba(196, 180, 150, 0.22) 0 4%, transparent 4.6%),
    radial-gradient(circle at 22% 34%, rgba(196, 180, 150, 0.18) 0 3.4%, transparent 4%),
    radial-gradient(circle at 42% 38%, #FFF9EC 0%, var(--hw-moon) 48%, #E3D5B6 100%);
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 249, 236, 0.5), 0 0 50px 8px rgba(244, 236, 216, 0.26);
}
/* Halo qui respire : seule l'opacité d'un calque est animée (léger). */
.theme-halloween main > .hero:first-child .glow-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 70px 18px rgba(244, 236, 216, 0.22), 0 0 170px 54px rgba(239, 168, 94, 0.16);
  opacity: 0.55;
  animation: hw-moon-breathe 7s ease-in-out infinite;
}
.theme-halloween main > :is(.hero, .shop-hero):first-child .ribbon {
  background: radial-gradient(circle at 35% 30%, var(--card), #EBDDC4 80%);
  border-color: var(--hw-amber-soft);
  box-shadow: 0 16px 30px -12px rgba(0, 0, 0, 0.55);
}
@keyframes hw-moon-breathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* ---------- Décor du ciel (injecté par halloween.js) ---------- */
.hw-sky {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hw-sky svg { display: block; max-width: none; }

/* Lune des pages intérieures */
.hw-moon {
  position: absolute;
  top: clamp(14px, 5vw, 46px);
  right: clamp(16px, 6vw, 110px);
  width: clamp(44px, 8vw, 118px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 66%, rgba(196, 180, 150, 0.34) 0 9%, transparent 10%),
    radial-gradient(circle at 70% 34%, rgba(196, 180, 150, 0.28) 0 7%, transparent 8%),
    radial-gradient(circle at 60% 76%, rgba(196, 180, 150, 0.22) 0 5%, transparent 6%),
    radial-gradient(circle at 40% 36%, #FFF9EC 0%, var(--hw-moon) 52%, #E3D5B6 100%);
  box-shadow: 0 0 34px 6px rgba(244, 236, 216, 0.3), 0 0 110px 30px rgba(239, 168, 94, 0.12);
}

/* Chauves-souris : trois, qui traversent lentement le haut du ciel. */
.hw-bat {
  position: absolute;
  left: 0;
  top: var(--y, 20%);
  width: var(--s, 34px);
  color: var(--hw-silhouette);
  opacity: 0;
  animation: hw-bat-cross var(--d, 26s) linear var(--delay, 0s) infinite;
  will-change: transform;
}
.hw-bat svg {
  width: 100%;
  height: auto;
  transform-origin: 50% 40%;
  animation: hw-bat-flap 0.32s ease-in-out infinite alternate;
}
.hw-bat:nth-child(2) svg { animation-duration: 0.27s; }
.hw-bat:nth-child(3) svg { animation-duration: 0.36s; }
@keyframes hw-bat-cross {
  0% { transform: translate3d(-80px, 0, 0); opacity: 0; }
  4% { opacity: 1; }
  30% { transform: translate3d(32vw, -16px, 0); }
  62% { transform: translate3d(66vw, 12px, 0); }
  70% { opacity: 1; }
  74%, 100% { transform: translate3d(calc(100vw + 80px), -10px, 0); opacity: 0; }
}
@keyframes hw-bat-flap {
  from { transform: scaleY(1); }
  to { transform: scaleY(0.5); }
}

/* Brume : deux voiles qui dérivent au pied du ciel. */
.hw-mist {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 200%;
  height: 46%;
  background:
    radial-gradient(ellipse 18% 46% at 8% 82%, rgba(205, 191, 227, 0.26), transparent 70%),
    radial-gradient(ellipse 22% 40% at 30% 90%, rgba(245, 239, 227, 0.14), transparent 70%),
    radial-gradient(ellipse 16% 50% at 46% 80%, rgba(205, 191, 227, 0.22), transparent 70%),
    radial-gradient(ellipse 18% 46% at 58% 82%, rgba(205, 191, 227, 0.26), transparent 70%),
    radial-gradient(ellipse 22% 40% at 80% 90%, rgba(245, 239, 227, 0.14), transparent 70%),
    radial-gradient(ellipse 16% 50% at 96% 80%, rgba(205, 191, 227, 0.22), transparent 70%);
  animation: hw-mist-drift 70s linear infinite;
  will-change: transform;
}
.hw-mist + .hw-mist {
  height: 30%;
  opacity: 0.8;
  animation-duration: 46s;
  animation-direction: reverse;
}
@keyframes hw-mist-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* Chat sur le rebord du ciel : il ouvre les yeux quand on arrive,
   cligne de temps en temps et suit la souris du regard. */
.hw-cat {
  position: absolute;
  right: clamp(14px, 5vw, 96px);
  bottom: -2px;
  width: clamp(44px, 5vw, 66px);
  color: var(--hw-silhouette);
}
.hw-cat svg { width: 100%; height: auto; overflow: visible; }
.hw-cat .hw-eye {
  fill: var(--hw-amber);
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleY(0.12);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), fill 0.4s ease;
}
.hw-cat .hw-pupil {
  fill: var(--hw-silhouette);
  transform: translate(var(--px, 0px), var(--py, 0px));
  transition: transform 0.25s ease-out;
  opacity: 0;
}
.hw-cat .hw-eyes { filter: drop-shadow(0 0 2px rgba(239, 168, 94, 0.0)); transition: filter 0.6s ease; }
.hw-cat.is-awake .hw-eye { transform: scaleY(1); }
.hw-cat.is-awake .hw-pupil { opacity: 1; }
.hw-cat.is-awake .hw-eyes {
  filter: drop-shadow(0 0 2.5px rgba(246, 201, 142, 0.95));
  animation: hw-blink 6.5s ease-in-out 2.5s infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.hw-cat.is-near .hw-eye { fill: #FFD9A0; }
@keyframes hw-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.08); }
}

/* Souhait de l'équipe, dans la marge du haut du ciel. */
.hw-greeting {
  position: absolute;
  z-index: 3;
  top: clamp(8px, 1.6vw, 18px);
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--wrap));
  margin: 0;
  padding: 0 0 0 1.75rem;
  pointer-events: none;
}
.hw-greeting > span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.18rem 0.85rem 0.18rem 0.4rem;
  border-radius: 999px;
  background: rgba(22, 15, 36, 0.55);
  border: 1px solid rgba(239, 168, 94, 0.35);
  font-family: var(--font-script);
  font-size: 1.08rem;
  line-height: 1.5;
  color: var(--hw-amber-soft);
  white-space: nowrap;
}
.hw-greeting svg { width: 22px; height: 22px; flex-shrink: 0; overflow: visible; }
.hw-pumpkin-glow { animation: hw-flicker 3.2s ease-in-out infinite; }
@keyframes hw-flicker {
  0%, 100% { opacity: 0.55; }
  38% { opacity: 0.9; }
  44% { opacity: 0.62; }
  70% { opacity: 1; }
}

/* ---------- Toiles et araignée sur une carte par page ---------- */
.theme-halloween .carte-ticket,
.theme-halloween .hours-feature,
.theme-halloween .elevage-card { position: relative; }
.hw-web {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(64px, 9vw, 92px);
  height: 150px;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  color: rgba(91, 75, 120, 0.42);
}
.hw-web--left { right: auto; left: 0; }
.hw-web--left .hw-web-lines { transform: scaleX(-1); }
.hw-web--photo { color: rgba(255, 255, 255, 0.8); }
.hw-web--photo .hw-web-lines { filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.45)); }
.hw-web-lines { width: 100%; height: auto; }
/* Les cartes produits sont petites sur mobile : toile plus discrète. */
.product-card .hw-web { width: clamp(44px, 6vw, 72px); }
.hw-spider {
  position: absolute;
  top: -40px;
  right: var(--sx, 22%);
  width: 14px;
  height: calc(var(--drop, 86px) + 40px);
  animation: hw-spider-bob 5.5s ease-in-out infinite;
}
.hw-web--left .hw-spider { right: auto; left: var(--sx, 22%); }
.hw-spider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 12px;
  left: 50%;
  width: 1px;
  margin-left: -0.5px;
  background: currentColor;
}
.hw-spider svg { position: absolute; left: 0; bottom: 0; width: 14px; height: 16px; }
@keyframes hw-spider-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-22px); }
}

/* Hors de l'écran, le décor se met en pause (classe posée par le script). */
.hw-idle .hw-sky *,
.hw-idle .hw-pumpkin-glow,
.hw-idle .glow-orb::after,
.hw-web.hw-idle .hw-spider { animation-play-state: paused; }

/* ---------- Mouvement réduit : tout s'immobilise ---------- */
@media (prefers-reduced-motion: reduce) {
  .theme-halloween main > .hero:first-child .glow-orb::after,
  .hw-mist,
  .hw-pumpkin-glow,
  .hw-spider,
  .hw-cat.is-awake .hw-eyes { animation: none; }
  .hw-bat { display: none; }
  .hw-cat .hw-eye,
  .hw-cat .hw-pupil { transition: none; }
}

/* Petits écrans : le décor se fait plus discret. */
@media (max-width: 560px) {
  .hw-greeting { padding-left: 1.75rem; }
  .hw-greeting > span { font-size: 0.98rem; }
  .hw-bat:nth-child(3) { display: none; }
  .hw-mist { height: 34%; }
}
