/**
 * Scroll fade-in states for assets/js/reveal.js.
 *
 * Only content nodes the script marks (.aps-reveal) are affected — never section
 * shells or background layers. `.stagger-entry` / `.stagger-entry-left` hosts are
 * never marked; their children (or inner content when a child paints a background)
 * carry the class. Without JS, content stays fully visible.
 * distancePx 0 (default) → opacity only; a positive --aps-reveal-distance adds a tiny Y move.
 * --aps-reveal-x is set for stagger-entry-left members (e.g. +20px → 0).
 *
 * Duration defaults to the reveal token × 1.5 (reveal-only; shared token unchanged).
 * Easing defaults to the theme in-out token (soft start / soft finish).
 * JS may override both via inline custom properties on marked nodes.
 */

.aps-reveal {
	--aps-reveal-distance: 0px;
	--aps-reveal-x: 0px;
	--aps-reveal-duration: calc( var(--wp--custom--motion--duration--reveal) * 1.5 );
	--aps-reveal-easing: var(--wp--custom--motion--easing--in-out);
}

html.aps-reveal-pending .aps-reveal:not(.is-revealed) {
	opacity: 0;
	transform: translate3d( var(--aps-reveal-x), var(--aps-reveal-distance), 0 );
	transition: none;
}

html.aps-reveal-js .aps-reveal {
	transition:
		opacity var(--aps-reveal-duration) var(--aps-reveal-easing),
		transform var(--aps-reveal-duration) var(--aps-reveal-easing);
}

html.aps-reveal-js .aps-reveal:not(.is-revealed) {
	opacity: 0;
	transform: translate3d( var(--aps-reveal-x), var(--aps-reveal-distance), 0 );
}

html.aps-reveal-js .aps-reveal.is-revealed {
	opacity: 1;
	transform: translate3d( 0, 0, 0 );
}

@media (prefers-reduced-motion: reduce) {
	.aps-reveal,
	html.aps-reveal-pending .aps-reveal:not(.is-revealed),
	html.aps-reveal-js .aps-reveal:not(.is-revealed),
	html.aps-reveal-js .aps-reveal.is-revealed {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}

@media print {
	.aps-reveal,
	html.aps-reveal-pending .aps-reveal:not(.is-revealed),
	html.aps-reveal-js .aps-reveal:not(.is-revealed),
	html.aps-reveal-js .aps-reveal.is-revealed {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}
