/* ===========================================================
   FPORTÁL - Weather icon motion
   Animations activate only inside a .wx-animate ancestor.
   Speed is governed by --wx-speed (1 = normal, 2 = fast, .5 = slow).
   Honors prefers-reduced-motion.
   =========================================================== */
:root{ --wx-speed:1; }

/* every animated primitive rotates / scales about its own centre */
.wx-rays,.wx-sun,.wx-moon,.wx-cloud,.wx-flake,.wx-bolt,.wx-spin,.wx-fog{
  transform-box:fill-box;
  transform-origin:center;
}

@media (prefers-reduced-motion: no-preference){

  /* - sun: rays slowly rotate, disc gently breathes - */
  .wx-animate .wx-rays{ animation:wxSpin calc(16s / var(--wx-speed)) linear infinite; }
  .wx-animate .wx-sun{ animation:wxBreathe calc(4.5s / var(--wx-speed)) ease-in-out infinite; }

  /* - clouds drift sideways - */
  .wx-animate .wx-cloud{ animation:wxDrift calc(6s / var(--wx-speed)) ease-in-out infinite; }
  .wx-animate .wx-cloud:nth-of-type(2){ animation-duration:calc(7.5s / var(--wx-speed)); animation-direction:reverse; }
  /* hatso felho (overcast): lassabban, ellentetes iranyban sodrodik */
  .wx-animate .wx-cloud.wx-cloud-back{ animation-duration:calc(8s / var(--wx-speed)); animation-direction:reverse; }
  /* - cut-out icons (GitHub #297, idojaras-ikonkeszlet.js defKo()): the ROOT svg drifts
     the way the front cloud did (wxDrift: 1.6 units times the cloud's scale, here as a
     share of the 72-unit view box), carrying the cut-out's static mask image with it;
     the .wx-ko-still groups (sun, moon, back cloud, drops) drift back by the same amount,
     so they stand still and only the cloud and its cut-out move. Transform only, so the
     browser composites it instead of repainting the icon. One pair per cloud scale. - */
  .wx-animate .wx-ko{ animation:wxKo100 calc(6s / var(--wx-speed)) ease-in-out infinite; }
  .wx-animate .wx-ko .wx-ko-still{ animation:wxKoBack100 calc(6s / var(--wx-speed)) ease-in-out infinite; }
  .wx-animate .wx-ko94{ animation-name:wxKo94; }
  .wx-animate .wx-ko94 .wx-ko-still{ animation-name:wxKoBack94; }
  .wx-animate .wx-ko105{ animation-name:wxKo105; }
  .wx-animate .wx-ko105 .wx-ko-still{ animation-name:wxKoBack105; }
  .wx-animate .wx-cloud.wx-ko-front{ animation:none; }

  /* - moon: faint breathing glow scale - */
  .wx-animate .wx-moon{ animation:wxBreathe calc(7s / var(--wx-speed)) ease-in-out infinite; }

  /* - rain: drops & strokes fall and fade, staggered - */
  .wx-animate .wx-rain line,
  .wx-animate .wx-rain-line,
  .wx-animate .wx-drop{ animation:wxFall calc(1.15s / var(--wx-speed)) linear infinite; }
  .wx-animate .wx-rain line:nth-child(1),.wx-animate .wx-drop:nth-child(1){ animation-delay:0s; }
  .wx-animate .wx-rain line:nth-child(2),.wx-animate .wx-drop:nth-child(2){ animation-delay:.28s; }
  .wx-animate .wx-rain line:nth-child(3),.wx-animate .wx-drop:nth-child(3){ animation-delay:.56s; }
  .wx-animate .wx-rain line:nth-child(4){ animation-delay:.16s; }
  .wx-animate .wx-rain line:nth-child(5){ animation-delay:.44s; }

  /* - snow: flakes drift down while turning - */
  .wx-animate .wx-flake{ animation:wxFlake calc(5s / var(--wx-speed)) linear infinite; }
  .wx-animate .wx-flake:nth-of-type(2){ animation-delay:.9s; animation-duration:calc(5.8s / var(--wx-speed)); }
  .wx-animate .wx-flake:nth-of-type(3){ animation-delay:1.7s; animation-duration:calc(4.4s / var(--wx-speed)); }
  .wx-animate .wx-flake:nth-of-type(4){ animation-delay:.5s; }
  .wx-animate .wx-flake:nth-of-type(5){ animation-delay:2.2s; }

  /* - lightning: occasional flash - */
  .wx-animate .wx-bolt{ animation:wxFlash calc(3.4s / var(--wx-speed)) steps(1,end) infinite; }

  /* - fog / mist / haze line banks slide gently - */
  .wx-animate .wx-fog{ animation:wxFogDrift calc(4.5s / var(--wx-speed)) ease-in-out infinite; }

  /* - hurricane swirl spins - */
  .wx-animate .wx-spin{ animation:wxSpin calc(3.2s / var(--wx-speed)) linear infinite; }

  /* - generic falling clusters (hail) - */
  .wx-animate .wx-fall{ animation:wxFall calc(1.3s / var(--wx-speed)) linear infinite; }
}

@keyframes wxSpin{ to{ transform:rotate(360deg); } }
@keyframes wxBreathe{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.06); } }
@keyframes wxDrift{ 0%,100%{ transform:translateX(-1.6px); } 50%{ transform:translateX(1.6px); } }
/* the cut-out icons' pairs: 1.6 x scale units of the 72-unit box, as % of the root, and as user units back */
@keyframes wxKo100{ 0%,100%{ transform:translateX(-2.2222%); } 50%{ transform:translateX(2.2222%); } }
@keyframes wxKoBack100{ 0%,100%{ transform:translateX(1.6px); } 50%{ transform:translateX(-1.6px); } }
@keyframes wxKo94{ 0%,100%{ transform:translateX(-2.0889%); } 50%{ transform:translateX(2.0889%); } }
@keyframes wxKoBack94{ 0%,100%{ transform:translateX(1.504px); } 50%{ transform:translateX(-1.504px); } }
@keyframes wxKo105{ 0%,100%{ transform:translateX(-2.3333%); } 50%{ transform:translateX(2.3333%); } }
@keyframes wxKoBack105{ 0%,100%{ transform:translateX(1.68px); } 50%{ transform:translateX(-1.68px); } }
@keyframes wxFogDrift{ 0%,100%{ transform:translateX(-2.4px); } 50%{ transform:translateX(2.4px); } }
@keyframes wxFall{
  0%{ transform:translateY(-4px); opacity:0; }
  22%{ opacity:1; }
  80%{ opacity:1; }
  100%{ transform:translateY(8px); opacity:0; }
}
@keyframes wxFlake{
  0%{ transform:translateY(-3px) rotate(0deg); opacity:0; }
  18%{ opacity:1; }
  82%{ opacity:1; }
  100%{ transform:translateY(8px) rotate(160deg); opacity:0; }
}
@keyframes wxFlash{
  0%,90%,100%{ opacity:1; }
  91%{ opacity:.12; }
  93%{ opacity:1; }
  95%{ opacity:.25; }
  97%{ opacity:1; }
}
