/* Slide 04 (market opportunity) entrance motion. Runs only while #market.market-run is present (set by
   market-motion.js when the slide is in view and the intro is closed). Opacity and transform only.
   Country highlights use backwards fill, so after each country's short glow it returns to its normal
   state and hover/selection keep working. */

@keyframes market-title-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes market-country-glow {
  0% { filter: drop-shadow(0 0 0 rgba(142, 219, 200, 0)); }
  45% { filter: drop-shadow(0 0 10px rgba(142, 219, 200, 0.8)); }
  100% { filter: drop-shadow(0 0 0 rgba(142, 219, 200, 0)); }
}

/* Title */
#market.market-run .market-opportunity-copy > h2 {
  animation: market-title-in 0.6s cubic-bezier(0.22, 0.8, 0.26, 1) both;
}

/* Eyebrow and the 7,93 indicator (its number is counted by market-motion.js). */
#market.market-run .market-opportunity-copy > .eyebrow {
  animation: market-fade 0.5s ease-out 0.1s both;
}

#market.market-run .market-opportunity-copy > .market-total-caption {
  animation: market-fade 0.6s ease-out 1.35s both;
}

#market.market-run .market-opportunity-copy > .market-source-visible {
  animation: market-fade 0.5s ease-out 0.2s both;
}

/* Map column: a soft fade-in, then the six target countries highlight one after another. */
#market.market-run .market-map-column {
  animation: market-fade 0.6s ease-out 0.25s both;
}

#market.market-run .market-map-neighbors .market-country-shape.is-target {
  animation: market-country-glow 0.72s ease-out backwards;
}
#market.market-run .market-map-neighbors .market-country-shape.is-target[data-market-country="BIH"] { animation-delay: 0.6s; }
#market.market-run .market-map-neighbors .market-country-shape.is-target[data-market-country="HRV"] { animation-delay: 0.8s; }
#market.market-run .market-map-neighbors .market-country-shape.is-target[data-market-country="SRB"] { animation-delay: 1s; }
#market.market-run .market-map-neighbors .market-country-shape.is-target[data-market-country="MNE"] { animation-delay: 1.2s; }
#market.market-run .market-map-neighbors .market-country-shape.is-target[data-market-country="SVN"] { animation-delay: 1.4s; }
#market.market-run .market-map-neighbors .market-country-shape.is-target[data-market-country="MKD"] { animation-delay: 1.6s; }

/* BiH statistics block, then the regional business message. */
#market.market-run .market-opportunity-copy > .market-bih-context {
  animation: market-fade 0.6s ease-out 0.9s both;
}

#market.market-run .market-opportunity-copy > .market-opportunity-close,
#market.market-run .market-opportunity-copy > .market-opportunity-description {
  animation: market-fade 0.6s ease-out 1.5s both;
}

/* A user who selects, hovers or taps a country takes precedence: decorative motion stops at once. */
#market.market-interacted .market-map-neighbors .market-country-shape {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  #market.market-run,
  #market.market-run * {
    animation: none !important;
  }
}
