/* AJK Keski-Suomi — animations.css
   Hienovaraiset latautumisanimaatiot.
   Kunnioitetaan prefers-reduced-motion -asetusta. */

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

  @keyframes ajk-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }

  @keyframes ajk-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  @keyframes ajk-fade-down {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: none; }
  }

  /* =====================================================
     HERO — porrastettu teksti & napit
     ===================================================== */
  .ajk-hero__teksti > * {
    animation: ajk-fade-up 0.55s ease-out backwards;
  }
  .ajk-hero__teksti > *:nth-child(1) { animation-delay: 0.10s; }
  .ajk-hero__teksti > *:nth-child(2) { animation-delay: 0.20s; }
  .ajk-hero__teksti > *:nth-child(3) { animation-delay: 0.30s; }
  .ajk-hero__teksti > *:nth-child(4) { animation-delay: 0.40s; }
  .ajk-hero__teksti > *:nth-child(5) { animation-delay: 0.50s; }

  /* Karusellin nuolet ja pisteet hieman myöhässä */
  .ajk-karuselli-nuolet,
  .ajk-karuselli-nav {
    animation: ajk-fade-in 0.6s ease-out backwards;
    animation-delay: 0.6s;
  }

  /* Karusellin ensimmäinen taustakuva */
  .ajk-hero-dia:first-of-type {
    animation: ajk-fade-in 0.7s ease-out backwards;
  }

  /* =====================================================
     SEKTIO-OTSIKOT
     ===================================================== */
  .ajk-etusivu-uutiset__otsikkorivi,
  .ajk-arkisto__otsikkoalue,
  .ajk-sivu__otsikkoalue,
  .ajk-tietoa-hero > .ajk-container > *,
  .ajk-tietoa-sisalto__prose,
  .ajk-tapahtumat-sisalto__prose,
  .ajk-yhteys-lomake h2,
  .ajk-tietoa-toiminta > h2,
  .ajk-tietoa-jasenyys {
    animation: ajk-fade-up 0.5s ease-out backwards;
    animation-delay: 0.08s;
  }

  /* Tietoa-heron otsikot porrastettuna */
  .ajk-tietoa-hero > .ajk-container > *:nth-child(2) { animation-delay: 0.16s; }
  .ajk-tietoa-hero > .ajk-container > *:nth-child(3) { animation-delay: 0.24s; }

  /* =====================================================
     KORTIT — porrastettu fade-up
     ===================================================== */
  .ajk-grid-3 > *,
  .ajk-etusivu-info__ruudukko > *,
  .ajk-arkisto__ruudukko > *,
  .ajk-tietoa-tilastot > *,
  .ajk-yhteys-tiedot > *,
  .ajk-kk-tapahtumat > * {
    animation: ajk-fade-up 0.5s ease-out backwards;
  }

  /* Yleinen stagger gridin lapsille — kattaa 6 ensimmäistä */
  .ajk-grid-3 > *:nth-child(1),
  .ajk-etusivu-info__ruudukko > *:nth-child(1),
  .ajk-arkisto__ruudukko > *:nth-child(1),
  .ajk-tietoa-tilastot > *:nth-child(1),
  .ajk-yhteys-tiedot > *:nth-child(1),
  .ajk-kk-tapahtumat > *:nth-child(1) { animation-delay: 0.10s; }

  .ajk-grid-3 > *:nth-child(2),
  .ajk-etusivu-info__ruudukko > *:nth-child(2),
  .ajk-arkisto__ruudukko > *:nth-child(2),
  .ajk-tietoa-tilastot > *:nth-child(2),
  .ajk-yhteys-tiedot > *:nth-child(2),
  .ajk-kk-tapahtumat > *:nth-child(2) { animation-delay: 0.18s; }

  .ajk-grid-3 > *:nth-child(3),
  .ajk-etusivu-info__ruudukko > *:nth-child(3),
  .ajk-arkisto__ruudukko > *:nth-child(3),
  .ajk-tietoa-tilastot > *:nth-child(3),
  .ajk-yhteys-tiedot > *:nth-child(3),
  .ajk-kk-tapahtumat > *:nth-child(3) { animation-delay: 0.26s; }

  .ajk-grid-3 > *:nth-child(4),
  .ajk-arkisto__ruudukko > *:nth-child(4),
  .ajk-tietoa-tilastot > *:nth-child(4),
  .ajk-kk-tapahtumat > *:nth-child(4) { animation-delay: 0.34s; }

  .ajk-arkisto__ruudukko > *:nth-child(5),
  .ajk-kk-tapahtumat > *:nth-child(5) { animation-delay: 0.42s; }

  .ajk-arkisto__ruudukko > *:nth-child(6),
  .ajk-kk-tapahtumat > *:nth-child(6) { animation-delay: 0.50s; }

  /* =====================================================
     GALLERIA — tiukempi stagger (enemmän kuvia)
     ===================================================== */
  .ajk-galleria-ruudukko > * {
    animation: ajk-fade-up 0.45s ease-out backwards;
  }
  .ajk-galleria-ruudukko > *:nth-child(1)  { animation-delay: 0.04s; }
  .ajk-galleria-ruudukko > *:nth-child(2)  { animation-delay: 0.08s; }
  .ajk-galleria-ruudukko > *:nth-child(3)  { animation-delay: 0.12s; }
  .ajk-galleria-ruudukko > *:nth-child(4)  { animation-delay: 0.16s; }
  .ajk-galleria-ruudukko > *:nth-child(5)  { animation-delay: 0.20s; }
  .ajk-galleria-ruudukko > *:nth-child(6)  { animation-delay: 0.24s; }
  .ajk-galleria-ruudukko > *:nth-child(7)  { animation-delay: 0.28s; }
  .ajk-galleria-ruudukko > *:nth-child(8)  { animation-delay: 0.32s; }
  .ajk-galleria-ruudukko > *:nth-child(9)  { animation-delay: 0.36s; }
  .ajk-galleria-ruudukko > *:nth-child(10) { animation-delay: 0.40s; }
  .ajk-galleria-ruudukko > *:nth-child(11) { animation-delay: 0.44s; }
  .ajk-galleria-ruudukko > *:nth-child(12) { animation-delay: 0.48s; }
  .ajk-galleria-ruudukko > *:nth-child(n+13) { animation-delay: 0.52s; }

  /* =====================================================
     ARTIKKELI (single.php) — header + runko porrastettu
     ===================================================== */
  .ajk-artikkeli__murupolku { animation: ajk-fade-up 0.5s 0.05s ease-out backwards; }
  .ajk-artikkeli__otsikko   { animation: ajk-fade-up 0.55s 0.15s ease-out backwards; }
  .ajk-artikkeli__meta      { animation: ajk-fade-up 0.5s 0.25s ease-out backwards; }
  .ajk-artikkeli__kuva-alue { animation: ajk-fade-in 0.6s 0.30s ease-out backwards; }
  .ajk-artikkeli__runko     { animation: ajk-fade-up 0.55s 0.35s ease-out backwards; }
  .ajk-artikkeli__navigointi { animation: ajk-fade-up 0.5s 0.45s ease-out backwards; }

  /* =====================================================
     LOMAKE — kentät porrastettuna
     ===================================================== */
  .ajk-lomake > * {
    animation: ajk-fade-up 0.5s ease-out backwards;
  }
  .ajk-lomake > *:nth-child(1) { animation-delay: 0.10s; }
  .ajk-lomake > *:nth-child(2) { animation-delay: 0.16s; }
  .ajk-lomake > *:nth-child(3) { animation-delay: 0.22s; }
  .ajk-lomake > *:nth-child(4) { animation-delay: 0.28s; }
  .ajk-lomake > *:nth-child(5) { animation-delay: 0.34s; }
  .ajk-lomake > *:nth-child(6) { animation-delay: 0.40s; }

  /* =====================================================
     FOOTER — kevyt fade-in
     ===================================================== */
  .ajk-footer {
    animation: ajk-fade-in 0.7s 0.25s ease-out backwards;
  }

  /* =====================================================
     404-sivu
     ===================================================== */
  .ajk-ei-loytynyt > * {
    animation: ajk-fade-up 0.55s ease-out backwards;
  }
  .ajk-ei-loytynyt > *:nth-child(1) { animation-delay: 0.10s; }
  .ajk-ei-loytynyt > *:nth-child(2) { animation-delay: 0.20s; }
  .ajk-ei-loytynyt > *:nth-child(3) { animation-delay: 0.30s; }
  .ajk-ei-loytynyt > *:nth-child(4) { animation-delay: 0.40s; }

}
