/*
 * TB — animation + parallax helpers.
 *
 * Works together with:
 *   - assets/css/animate.min.css          (Animate.css 4.1.1, animate__* classes)
 *   - assets/js/frontend-animations.js    (IntersectionObserver + rAF parallax)
 *   - assets/js/editor-animations.js      (Inspector controls)
 */

:root {
	--tb-anim-duration: 0.9s;
	--tb-anim-easing: cubic-bezier(.2,.7,.2,1);
}

/* Hide elements that are waiting to animate in. Exits (fadeOut…) stay visible. */
[data-tb-animation]:not([data-tb-animation^="fadeOut"])
:not([data-tb-animation^="zoomOut"])
:not([data-tb-animation^="slideOut"])
:not([data-tb-animation^="bounceOut"])
:not([data-tb-animation^="rotateOut"])
:not([data-tb-animation^="flipOut"])
:not([data-tb-animation^="lightSpeedOut"])
:not(.tb-animated) {
	opacity: 0;
}

/* Once triggered, use a consistent duration + easing. */
.tb-animated {
	animation-duration: var(--tb-anim-duration);
	animation-fill-mode: both;
	animation-timing-function: var(--tb-anim-easing);
}
.animate__animated {
	animation-duration: var(--tb-anim-duration);
}

/* When the user prefers reduced motion, don't animate at all — just reveal. */
@media (prefers-reduced-motion: reduce) {
	[data-tb-animation] {
		opacity: 1 !important;
		animation: none !important;
		transform: none !important;
	}
	[data-tb-parallax] {
		transform: none !important;
	}
}

/* Parallax: GPU-friendly and kill layout jank. */
[data-tb-parallax] {
	will-change: transform;
	transform: translate3d(0, 0, 0);
	transition: none;
}

/* Editor — show every block in place even before the trigger fires so
   authors can still select and edit. */
.block-editor-block-list__block[data-tb-animation] {
	opacity: 1;
}
