/*
 * Film grain over photos. See modules/grain/grain.php.
 *
 *   .foundry-grain        an Elementor container (grain over its background,
 *                         under its content) or Image widget (over the image)
 *   .foundry-grain-under  any other element with a background photo and
 *                         content on it: the grain goes under the content
 *   .foundry-grain-cover  a wrapper around an image: the grain covers it
 */

.foundry-grain,
.foundry-grain-under,
.foundry-grain-cover {
	--foundry-grain-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
	--foundry-grain-opacity: 0.75;
}

/* The grain layer itself. Clicks pass through it. */
.foundry-grain.e-con::after,
.foundry-grain.elementor-widget-image > .elementor-widget-container::after,
.foundry-grain-under::after,
.foundry-grain-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background-image: var(--foundry-grain-texture);
	background-size: 240px 240px;
	opacity: var(--foundry-grain-opacity);
	mix-blend-mode: overlay;
}

/* Over a background, under the content, which is lifted above the grain.
 * Elementor's background layers (slideshow, video, motion effects) stay
 * below it; shape dividers, already positioned, go above. */
.foundry-grain.e-con,
.foundry-grain-under {
	isolation: isolate;
}
.foundry-grain-under {
	position: relative;
}
.foundry-grain.e-con > :not(.elementor-background-slideshow):not(.elementor-background-video-container):not(.elementor-motion-effects-container):not(.elementor-shape),
.foundry-grain-under > * {
	position: relative;
	z-index: 2;
}
.foundry-grain.e-con > .elementor-shape {
	z-index: 2;
}

/* Over an image. */
.foundry-grain.elementor-widget-image > .elementor-widget-container,
.foundry-grain-cover {
	position: relative;
}
.foundry-grain.elementor-widget-image > .elementor-widget-container {
	line-height: 0;
}
