/* ============================================
   BLIPBLURB — EFFECTS MODULE
   ============================================ */

/*
 * The blur/opacity base layer for the whole bar — one static layer,
 * shared by every blip, that never gets a transform/clip-path/opacity
 * change of its own in any Background Animation mode (unlike the color
 * fill in .blip-message::before, which animates per-blip during a
 * crossfade). backdrop-filter combined with an animated property on the
 * SAME element is a known cross-browser compositor bug (the newly-
 * exposed region isn't always fully resampled against the blurred
 * backdrop each frame — this plugin hit it via a transform-based slide,
 * then a clip-path-based one, both fixed by moving blur off the animated
 * layer entirely). Putting it here instead of on each .blip-message
 * closes a second gap the per-message version had: only one blur layer
 * ever exists, so two messages briefly overlapping mid-crossfade can't
 * stack two blurs into a visibly-over-blurred result — there's nothing
 * to double.
 *
 * --blip-base-opacity is this layer's half of the Opacity split (see
 * class-blip-effects.php's layer_alpha()) — a plain white tint, since
 * this layer has no per-blip color of its own; each blip's own color
 * fill (its own alpha) then washes over this already-blurred base.
 */
.blip::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background-color: rgba(255, 255, 255, var(--blip-base-opacity, 0));
    backdrop-filter: blur(var(--blip-blur, 0px));
    -webkit-backdrop-filter: blur(var(--blip-blur, 0px));
}

/*
 * Fade and the Slide-* Background Animation modes deliberately keep the
 * outgoing message's ::before fully rendered underneath the incoming one
 * for the whole crossfade — for Slide, it's the fallback showing through
 * the part of the box the incoming layer hasn't reveal-covered yet; for
 * Fade, it's what's visible while the incoming layer's own opacity is
 * still ramping up from 0. With a translucent fill (Opacity < 100%) that
 * outgoing layer stacks its own alpha under the incoming one, compounding
 * toward opaque over the course of the crossfade.
 *
 * Simply hiding the outgoing layer instead (tried first) fixes the
 * compounding but breaks the exact thing it was there for: a Slide reveal
 * shows a hard gap down to the page in the not-yet-covered region, and
 * Fade starts from nothing instead of the outgoing color. Fading the
 * outgoing layer's own opacity out over the same 1s the incoming layer
 * takes to fully arrive keeps roughly one layer's worth of alpha visible
 * at any instant — never doubled, never a gap — without needing to touch
 * each mode's own reveal mechanics individually.
 *
 * "None" has no reveal at all (background swaps instantly), so its own
 * opacity:1 !important in blip.css is left as the exemption — nothing to
 * crossfade there.
 */
.blip[data-translucent="1"] .blip-message.is-exiting::before {
    transition: opacity 1s ease-out;
    opacity: 0;
}
