/**
 * Bricksify: Blur Reveal.
 *
 * Loads only with the companion plugin, together with blur-reveal.js. Every
 * rule targets markup the script creates, so an element carrying
 * `bxc-blur-reveal` without the plugin is simply normal text.
 */

.bxc-blur-reveal .bxbr__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/*
 * SplitType's markup in the reference: words and characters are inline
 * blocks, so the stretch and skew transforms apply and a word never breaks
 * between its letters. Nothing is clipped: the blur spills out, as it does
 * on the demo.
 */
.bxc-blur-reveal .bxbr__word,
.bxc-blur-reveal .bxbr__char {
	display: inline-block;
}

.bxc-blur-reveal .bxbr__word {
	white-space: nowrap;
}

/*
 * Before the script runs, the text is hidden so it cannot flash sharp and
 * then blur out. `bx-js` is printed in <head> by the companion only on pages
 * that use the effect, so a visitor without JavaScript always sees the text.
 * If the script never arrives, the failsafe shows it after 3 seconds.
 */
html.bx-js body.bricks-is-frontend .bxc-blur-reveal:not(.is-ready) {
	visibility: hidden;
	animation: bxbr-failsafe 0s 3s forwards;
}

@keyframes bxbr-failsafe {
	to {
		visibility: visible;
	}
}

@media (prefers-reduced-motion: reduce) {
	html.bx-js body.bricks-is-frontend .bxc-blur-reveal:not(.is-ready) {
		visibility: visible;
		animation: none;
	}
}

/*
 * The visual copy stays an inline run of words. Bricks styles every span inside
 * a Text Link as inline-flex (`.brxe-text-link span`), which drops the spaces
 * between the word boxes of a multi-word link.
 */
.bxc-blur-reveal .bxbr__vis {
	display: inline;
}

/*
 * Liquid focus: the script moves the content into one inner wrapper (fade +
 * CSS blur); the element itself carries the SVG filter while it animates.
 * The filter definitions live in a zero-size svg at the end of <body>.
 */
.bxc-blur-reveal .bxbr__goo {
	display: block;
	will-change: filter, opacity;
}

.bxc-blur-reveal.is-goo {
	will-change: filter;
}

.bxc-blur-reveal .bxbr__goo > :first-child {
	margin-top: 0;
}

.bxc-blur-reveal .bxbr__goo > :last-child {
	margin-bottom: 0;
}

svg.bxbr__defs {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
	pointer-events: none;
}
