/**
 * Global scroll-animation normalisation.
 *
 * The parent theme ships WOW.js (barsi/assets/js/barsi-core.js) + Animate.css
 * (barsi/assets/css/animate-min.css). The Barsi Core Elementor widgets hardcode
 * a mix of entrance animations into their view templates -- fadeInUp,
 * fadeInRight, fadeIn, flipInX, slideInLeft, slideInRight -- so the same kind of
 * element animates differently from section to section.
 *
 * Rather than editing the parent theme/plugin, every WOW-driven element is
 * forced onto one shared animation (fadeInUp) with one shared duration here.
 * The per-element stagger (data-wow-delay) is deliberately left intact.
 *
 * @package MRB
 */

/* Unify the animation itself. Animate.css sets `animation-name` per class at
   the same specificity, so !important is what makes this win regardless of
   which class the widget printed. */
.wow.animated,
.wow.animated.fadeIn,
.wow.animated.fadeInLeft,
.wow.animated.fadeInRight,
.wow.animated.fadeInDown,
.wow.animated.flipInX,
.wow.animated.slideInLeft,
.wow.animated.slideInRight,
.wow.animated.zoomIn,
.wow.animated.bounceIn {
	animation-name: fadeInUp !important;
}

/* Unify the timing. WOW.js writes `animation-duration` inline from
   data-wow-duration (values in the widgets range from 300ms to 2s), so this
   needs !important to beat the inline style. */
.wow.animated {
	animation-duration: 1000ms !important;
	animation-fill-mode: both !important;
}

/* Bootstrap tab panes in the pricing/service widgets reuse the Animate.css
   classes without WOW -- keep those consistent too. */
.tab-pane.animated {
	animation-name: fadeInUp !important;
	animation-duration: 600ms !important;
}

/* ---------------------------------------------------------------------------
   Unified fade-up for everything the widgets left bare (custom sections) and
   for the ex-SplitText titles. Driven by assets/js/animation.js, which tags
   elements with .mrb-anim and flips .mrb-anim--in when they scroll into view.
   Own keyframes rather than Animate.css's, so this is independent of the
   parent theme's stylesheet.
   --------------------------------------------------------------------------- */
@keyframes mrbFadeInUp {
	from {
		opacity: 0;
		transform: translate3d( 0, 40px, 0 );
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.mrb-anim {
	opacity: 0;
	will-change: opacity, transform;
}

.mrb-anim--in {
	animation-name: mrbFadeInUp;
	animation-duration: 1000ms;
	animation-timing-function: cubic-bezier( 0.215, 0.61, 0.355, 1 );
	animation-fill-mode: both;
}

/* Accessibility: honour the OS "reduce motion" preference. WOW hides elements
   with visibility:hidden until they animate in, so they must be forced back to
   visible rather than simply having the animation cancelled. */
@media ( prefers-reduced-motion: reduce ) {
	.wow,
	.wow.animated,
	.tab-pane.animated,
	.mrb-anim,
	.mrb-anim--in {
		visibility: visible !important;
		animation: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
}
