/* Shared entrance animations — see assets/js/scroll-reanimate.js. Literal values only:
   a var() in keyframes keeps Chromium from running them on the compositor. */
@keyframes scale-in {
	from {
		opacity: 0;
		transform: scale(0.8);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes card-scale-in {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* Columns of a ptsussis/row with "Animate" on — see includes/scroll-reanimate.php. */
.wp-block-column[data-scroll-animate] {
	opacity: 0;
}

.wp-block-column.is-reanimating {
	animation: card-scale-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) var(--column-delay, 0s) forwards;
}

.wp-block-column.is-out-of-view {
	animation: card-scale-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) var(--column-delay, 0s) reverse
		forwards;
}

.wp-block-column[data-scroll-animate]:nth-child(2) {
	--column-stagger: 0.5s;
}

.wp-block-column[data-scroll-animate]:nth-child(3) {
	--column-stagger: 1s;
}

.wp-block-column[data-scroll-animate]:nth-child(4) {
	--column-stagger: 1.5s;
}

.wp-block-column[data-scroll-animate]:nth-child(5) {
	--column-stagger: 2s;
}

.wp-block-column[data-scroll-animate]:nth-child(n + 6) {
	--column-stagger: 2.5s;
}

/* Stagger only while the columns sit side by side: from core's 782px breakpoint, or when not stacked on mobile. */
@media (min-width: 782px) {
	.wp-block-column[data-scroll-animate] {
		--column-delay: var(--column-stagger, 0s);
	}
}

.wp-block-columns.is-not-stacked-on-mobile > .wp-block-column[data-scroll-animate] {
	--column-delay: var(--column-stagger, 0s);
}

@media (prefers-reduced-motion: reduce), (scripting: none) {
	.wp-block-column[data-scroll-animate] {
		animation: none;
		opacity: 1;
		transform: none;
	}
}
