/* =====================================================================
   Dualis ENR — Schémas animés « types de climatisation » (svg.ac-diag)
   Autonome : fonctionne avec ou sans theme-sombre.css (valeurs de repli).
   Animations : uniquement transform, opacity et stroke-dashoffset.
   Toutes les animations d'un schéma partent ensemble : elles restent
   synchronisées (bascule réversible, pièces du multi-split).
   anim-climatisation.js met en pause les schémas hors écran (.is-paused).
   prefers-reduced-motion : filets en trait plein, sans mouvement.
   ===================================================================== */

.ac-diag{
  --ac-cold:var(--blue-l,#74B8F8);--ac-warm:var(--orange-l,#FFB26E);--ac-hot:var(--orange-brand,#F28B2E);
  --ac-ink:var(--ink,#F3F7FD);--ac-soft:var(--ink-soft,#D5DFEE);--ac-muted:var(--muted,#A6B7CF);--ac-page:var(--page,#0A1628);
  display:block;width:100%;height:auto;aspect-ratio:5/3;border-radius:18px;
  background:var(--ac-bg,radial-gradient(80% 90% at 40% 25%,#2B8BE824,transparent 70%),#0A1628a6);
  box-shadow:inset 0 0 0 1px var(--ac-ring,var(--line,#ffffff1f));
  contain:layout paint;overflow:hidden;font-family:var(--font,system-ui,sans-serif);
  stroke-linecap:round;stroke-linejoin:round
}
/* Fonds au choix : classe sur un conteneur (page, section ou panneau). Sans classe = A.
   Tous gardent les filets bleu clair / orange et les traits du dessin lisibles. */
.anim-fond--a{--ac-bg:radial-gradient(80% 90% at 40% 25%,#2B8BE824,transparent 70%),#0A1628a6;--ac-ring:#ffffff1f}
.anim-fond--b{--ac-bg:radial-gradient(70% 60% at 50% 0%,#2B8BE814,transparent 70%),#050C18;--ac-ring:#ffffff14}
.anim-fond--c{--ac-bg:radial-gradient(60% 70% at 85% 100%,#1FA3A31f,transparent 70%),linear-gradient(160deg,#0B1A33 0%,#0B2A3D 60%,#0D3846 100%);--ac-ring:#7FD4D429}
.anim-fond--d{--ac-bg:radial-gradient(80% 90% at 40% 20%,#ffffff0d,transparent 70%),linear-gradient(180deg,#1B2028,#11151B);--ac-ring:#ffffff1a}
.anim-fond--e{--ac-bg:radial-gradient(90% 80% at 30% 0%,#74B8F826,transparent 65%),linear-gradient(180deg,#ffffff14,#ffffff05),#1A355Cb3;--ac-ring:#ffffff33}

/* Dans un panneau du modèle Q : schéma au-dessus du texte sur mobile, comme .q-diag */
@media (max-width:699px){.q-panel .ac-diag,.q-panel .ac-fig{order:-1}}
/* Schéma + légende (multi-split) */
.ac-fig{margin:0;min-width:0}
.ac-cap{margin-top:10px;color:var(--muted,#A6B7CF);font-size:.92rem;line-height:1.55;text-wrap:pretty}

/* ---------- Décor ---------- */
.ac-ground{fill:none;stroke:#D5DFEE40;stroke-width:2}
.ac-house{fill:#ffffff05;stroke:#D5DFEE73;stroke-width:2}
.ac-roof{fill:none;stroke:var(--ac-soft);stroke-opacity:.8;stroke-width:3.2}
.ac-floor{fill:none;stroke:#D5DFEE59;stroke-width:2}
.ac-wall{fill:none;stroke:#D5DFEE3d;stroke-width:1.6}
.ac-deco{fill:none;stroke:#D5DFEE33;stroke-width:1.5}
.ac-sleeve{fill:#D5DFEE40}

/* ---------- Unité intérieure ---------- */
.ac-iu{fill:var(--ac-ink)}
.ac-iu-shade{fill:var(--ac-soft)}
.ac-iu-line{fill:none;stroke:var(--ac-muted);stroke-opacity:.55;stroke-width:1.4}
.ac-slot{fill:var(--ac-page);fill-opacity:.9}
.ac-louvers{fill:none;stroke:var(--ac-muted);stroke-width:1.3}
.ac-led{fill:currentColor}

/* ---------- Télécommande (multi-split) ---------- */
.ac-rc{fill:#ffffff0d;stroke:var(--ac-soft);stroke-opacity:.75;stroke-width:1.2}
.ac-rc-screen{fill:var(--ac-muted);fill-opacity:.6}
.ac-rc-btn{fill:var(--ac-soft);fill-opacity:.75}
.ac-rc-keys{fill:none;stroke:var(--ac-soft);stroke-opacity:.6;stroke-width:1.2}
.ac-rc-sig{fill:none;stroke:var(--ac-soft);stroke-width:1.1;opacity:.4}

/* ---------- Unité extérieure / caisson gainable ---------- */
.ac-ou{fill:var(--ac-soft)}
.ac-ou-top{fill:var(--ac-ink)}
.ac-ou-vent{fill:none;stroke:var(--ac-muted);stroke-width:1.6}
.ac-ou-well{fill:var(--ac-page)}
.ac-blade{fill:var(--ac-muted)}
.ac-fan-ghost{fill:var(--ac-muted);fill-opacity:.1}
.ac-hub{fill:var(--ac-soft)}
.ac-grille{fill:none;stroke:var(--ac-soft);stroke-opacity:.32;stroke-width:1}
.ac-feet{fill:var(--ac-muted)}
.ac-valve{fill:var(--ac-muted)}

/* ---------- Liaisons frigorifiques ---------- */
.ac-sheath{fill:none;stroke:var(--ac-soft);stroke-opacity:.2;stroke-width:5}
.ac-sheath--thin{stroke-width:4}
.ac-flow{fill:none;stroke-width:2.8;stroke-dasharray:1 8}
.ac-flow--cold{stroke:var(--ac-cold)}
.ac-flow--warm{stroke:var(--ac-hot)}
.ac-flow--b{stroke-dashoffset:4.5} /* multi-split : aller et retour sur la même liaison, points décalés */

/* ---------- Gaines (gainable) ---------- */
.ac-duct{fill:none;stroke:var(--ac-soft);stroke-opacity:.26;stroke-width:13;stroke-linecap:butt}
.ac-duct-in{fill:none;stroke:var(--ac-page);stroke-width:9;stroke-linecap:butt}
.ac-duct-flow{fill:none;stroke:var(--ac-cold);stroke-width:2.6;stroke-dasharray:5 9}
.ac-duct-flow--warm{stroke:var(--ac-warm)}
.ac-vent{fill:var(--ac-ink)}
.ac-vent-slot{fill:none;stroke:var(--ac-page);stroke-width:1.2}

/* ---------- Air soufflé ---------- */
.ac-air--cold{color:var(--ac-cold)}
.ac-air--warm{color:var(--ac-warm)}
/* filets ondulés : traînée qui sort de la bouche et s'estompe ; statiques (trait plein) si mouvement réduit */
.ac-stream{fill:none;stroke:currentColor;stroke-width:1.9;opacity:.6}
.ac-diag--multi .ac-stream{stroke-width:3}

/* ---------- Bascule mode froid / mode chaud : libellé ---------- */
.ac-pill-bg{fill:#0A1628cc;stroke:currentColor;stroke-opacity:.55;stroke-width:1.2}
.ac-pill-dot{fill:currentColor}
.ac-pill-txt{fill:var(--ac-ink);font-size:12.5px;font-weight:620;letter-spacing:-.01em}
.ac-pill-still{display:none}
.ac-m-hot{opacity:0}

/* Éléments transformés : origine = (0,0) local, posé par un <g transform="translate()"> parent */
.ac-fan,.ac-sweep,.ac-louvers{transform-box:view-box;transform-origin:0 0}

/* =====================================================================
   Animations (seulement si l'utilisateur n'a pas demandé moins de mouvement)
   ===================================================================== */
@media (prefers-reduced-motion:no-preference){
  .ac-fan{animation:ac-spin 1.15s linear infinite}
  .ac-fan--blower{animation-duration:.7s}

  .ac-flow--fwd{animation:ac-dash-f 1.05s linear infinite}
  .ac-flow--rev{animation:ac-dash-r 1.05s linear infinite}
  .ac-duct-flow{animation:ac-dash-d .95s linear infinite}

  .ac-sweep{animation:ac-sweep 6s ease-in-out infinite alternate}
  .ac-louvers{animation:ac-louver 6s ease-in-out infinite alternate}
  .ac-led{animation:ac-pulse 2.4s ease-in-out infinite alternate}
  .ac-rc-sig{animation:ac-sig 3.2s ease-in-out infinite alternate}

  .ac-stream{stroke-dasharray:56 100;stroke-dashoffset:56;opacity:0;animation:ac-stream 2.6s cubic-bezier(.4,.4,.6,1) infinite}
  .ac-stream:nth-of-type(2){animation-delay:-1.7s}
  .ac-stream:nth-of-type(3){animation-delay:-.85s}

  .ac-flow--b.ac-flow--fwd{animation-name:ac-dash-f2}

  /* Toutes les climatisations sont réversibles : mode froid puis mode chaud, cycle 12 s, fondu bleu ↔ orange */
  .ac-m-cold{animation:ac-mode-a 12s ease-in-out infinite}
  .ac-m-hot{animation:ac-mode-b 12s ease-in-out infinite}
  .ac-pill.ac-m-cold{animation-name:ac-pill-a}
  .ac-pill.ac-m-hot{animation-name:ac-pill-b}
}

@keyframes ac-spin{to{transform:rotate(360deg)}}
@keyframes ac-dash-f{from{stroke-dashoffset:0}to{stroke-dashoffset:-18}}
@keyframes ac-dash-r{from{stroke-dashoffset:0}to{stroke-dashoffset:18}}
@keyframes ac-dash-f2{from{stroke-dashoffset:4.5}to{stroke-dashoffset:-13.5}}
@keyframes ac-dash-d{from{stroke-dashoffset:0}to{stroke-dashoffset:-28}}
@keyframes ac-sweep{from{transform:rotate(-12deg)}to{transform:rotate(12deg)}}
@keyframes ac-louver{from{transform:skewX(14deg)}to{transform:skewX(-14deg)}}
@keyframes ac-pulse{from{opacity:.5}to{opacity:1}}
@keyframes ac-sig{from{opacity:.12}to{opacity:.55}}
@keyframes ac-stream{0%{stroke-dashoffset:56;opacity:0}22%{opacity:.9}68%{opacity:.7}100%{stroke-dashoffset:-100;opacity:0}}
@keyframes ac-mode-a{0%,42%{opacity:1}50%,92%{opacity:0}100%{opacity:1}}
@keyframes ac-mode-b{0%,42%{opacity:0}50%,92%{opacity:1}100%{opacity:0}}
@keyframes ac-pill-a{0%,42%{opacity:1;transform:none}48%,94%{opacity:0;transform:translate(0,-6px)}100%{opacity:1;transform:none}}
@keyframes ac-pill-b{0%,44%{opacity:0;transform:translate(0,6px)}50%,92%{opacity:1;transform:none}98%,100%{opacity:0;transform:translate(0,-6px)}}

/* Hors écran ou onglet masqué : tout est figé (anim-climatisation.js) */
.ac-diag.is-paused *{animation-play-state:paused!important}

/* =====================================================================
   Mouvement réduit : état statique lisible
   ===================================================================== */
@media (prefers-reduced-motion:reduce){
  /* les deux modes à la fois : filets bleus et orange alternés, libellé « Froid ou chaud » */
  .ac-m-hot{opacity:1}
  .ac-m-hot .ac-led,.ac-m-hot .ac-flow,.ac-m-hot .ac-duct-flow{display:none}
  .ac-m-hot .ac-stream:nth-of-type(odd),.ac-m-cold .ac-stream:nth-of-type(even){display:none}
  .ac-pill{display:none}
  .ac-pill-still{display:inline}
}
