/* Ambiances des intérieurs (direction du 28/09/2026) : raccord léger sur les couches DÉCORATIVES de l'ouverture.
   Jamais le texte, jamais les cartes originales, jamais la surface météo du module climat. Sans l'attribut
   data-tc-atmosphere (module absent), aucune règle ne s'applique et la page reste celle d'aujourd'hui.
   Contraste renforcé et couleurs forcées : rien n'est appliqué. `:not(#tc-ambiance)` passe au-dessus de la couche
   palazzo (0,7,1) sans !important. Aucune animation : de simples fondus de 6 s aux changements d'état. */
@property --tc-air-warmth { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --tc-air-mist { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --tc-air-drift { syntax: '<number>'; inherits: true; initial-value: 0; }

@media not ((prefers-contrast: more) or (forced-colors: active)) {
  body.tc-direction-20260928[data-tc-atmosphere]:not(#tc-ambiance) {
    transition: --tc-air-warmth 6s ease, --tc-air-mist 6s ease, --tc-air-drift 6s ease;
  }
  /* Teinte de la lumière d'atmosphère : nacre froide, blanc sculpté, ivoire-or, halo d'encre. */
  body.tc-direction-20260928[data-tc-atmosphere="aube"]:not(#tc-ambiance) { --tc-air-lumiere: 214 224 226; --tc-season-light-factor: .8; }
  body.tc-direction-20260928[data-tc-atmosphere="jour"]:not(#tc-ambiance) { --tc-air-lumiere: 244 240 232; --tc-season-light-factor: 1; }
  body.tc-direction-20260928[data-tc-atmosphere="doree"]:not(#tc-ambiance) { --tc-air-lumiere: 236 196 132; --tc-season-light-factor: 1; }
  body.tc-direction-20260928[data-tc-atmosphere="nuit"]:not(#tc-ambiance) { --tc-air-lumiere: 150 172 190; --tc-season-light-factor: .45; }

  /* Fond de l'ouverture : une lumière d'atmosphère DERRIÈRE toutes les couches (sous le texte et les images).
     Dernier plan conservé : la matière propre à chaque page (--dv-material, direction-visuelle.css de Codex),
     pour ne pas uniformiser les six climats. */
  body.tc-direction-20260928[data-tc-atmosphere]:not(#tc-ambiance) .tc-scene {
    background-image:
      radial-gradient(ellipse 60% 55% at 82% 6%, rgb(var(--tc-air-lumiere) / calc(.04 + var(--tc-air-mist) * .12 + max(0, var(--tc-air-warmth)) * .07)), transparent 72%),
      radial-gradient(ellipse 85% 40% at 28% 100%, rgb(var(--tc-air-lumiere) / calc(var(--tc-air-mist) * .07)), transparent 70%),
      radial-gradient(ellipse at 82% 40%, var(--dv-material, #143b31), #000 73%);
  }
  /* Ciel et carte de fond existants : plus d'étoiles la nuit, un relief plus lisible le jour. */
  body.tc-direction-20260928[data-tc-atmosphere]:not(#tc-ambiance) .tc-scene > :is(.tc-universe, .tc-cartography) { transition: opacity 6s ease; }
  body.tc-direction-20260928[data-tc-atmosphere="aube"]:not(#tc-ambiance) .tc-scene > .tc-universe { opacity: .75; }
  body.tc-direction-20260928[data-tc-atmosphere="jour"]:not(#tc-ambiance) .tc-scene > .tc-universe { opacity: .6; }
  body.tc-direction-20260928[data-tc-atmosphere="doree"]:not(#tc-ambiance) .tc-scene > .tc-universe { opacity: .8; }
  body.tc-direction-20260928[data-tc-atmosphere="nuit"]:not(#tc-ambiance) .tc-scene > .tc-universe { opacity: 1; }
  body.tc-direction-20260928[data-tc-atmosphere="aube"]:not(#tc-ambiance) .tc-scene > .tc-cartography { opacity: .18; }
  body.tc-direction-20260928[data-tc-atmosphere="jour"]:not(#tc-ambiance) .tc-scene > .tc-cartography { opacity: .24; }
  body.tc-direction-20260928[data-tc-atmosphere="doree"]:not(#tc-ambiance) .tc-scene > .tc-cartography { opacity: .2; }
  body.tc-direction-20260928[data-tc-atmosphere="nuit"]:not(#tc-ambiance) .tc-scene > .tc-cartography { opacity: .13; }
  /* Voiles du calque d'air existant : présence d'un voile selon la densité (au repos, sans animation). Le calque
     reste masqué en mouvement réduit et en contraste renforcé par sa propre règle (entracte.css). */
  body.tc-direction-20260928[data-tc-atmosphere]:not(#tc-ambiance) .tc-air-veils { opacity: calc(var(--tc-air-mist) * .75); transition: opacity 6s ease; }
}

/* Pause de la scène ou effets météo suspendus par le visiteur : aucun fondu, même en cours (les valeurs se posent). */
body.tc-direction-20260928[data-tc-atmosphere]:not(#tc-ambiance):has(.tc-scene[data-motion="paused"], .tc-climate .cl-settings [aria-pressed="true"]),
body.tc-direction-20260928[data-tc-atmosphere]:not(#tc-ambiance):has(.tc-scene[data-motion="paused"], .tc-climate .cl-settings [aria-pressed="true"]) .tc-scene > :is(.tc-universe, .tc-cartography),
body.tc-direction-20260928[data-tc-atmosphere]:not(#tc-ambiance):has(.tc-scene[data-motion="paused"], .tc-climate .cl-settings [aria-pressed="true"]) .tc-air-veils { transition: none; }

@media (prefers-reduced-motion: reduce) {
  body.tc-direction-20260928[data-tc-atmosphere]:not(#tc-ambiance),
  body.tc-direction-20260928[data-tc-atmosphere]:not(#tc-ambiance) .tc-scene > :is(.tc-universe, .tc-cartography),
  body.tc-direction-20260928[data-tc-atmosphere]:not(#tc-ambiance) .tc-air-veils { transition: none; }
}
