/**
 * Scroll-scrubbed text fill. See assets/js/text-scrub.js for the contract.
 *
 * The characters only exist once the script has split the text, so there is
 * no hidden start state to strand: without JS, in the editor or with reduced
 * motion the sentence renders whole and fully opaque. The media query also
 * covers a visitor switching reduced motion on after the split.
 */

/* The whole sentence for screen readers; same off-screen clip as .testimonial__announcer. */
.text-scrub__label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.text-scrub__word {
	white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {

	/* Each character fills over WINDOW characters as the front passes its index. */
	.text-scrub__char {
		opacity: calc(var(--wp--custom--text-scrub--start-opacity) + (1 - var(--wp--custom--text-scrub--start-opacity)) * clamp(0, (var(--text-scrub-head, 0) - var(--i)) / var(--text-scrub-window, 1), 1));
	}
}
