/* Featured Video Preview — Fusion Builder Background Video Styles */

/* ------------------------------------------------------------------ */
/* Common: all injected video/placeholder elements                     */
/* ------------------------------------------------------------------ */

/*
 * Videos are injected as position:absolute children.
 * We use top/right/bottom/left: 0 instead of height:100% so the video
 * fills its container even when the container has height:auto (content-
 * driven height). object-fit:cover is set inline by JS; repeated here
 * as a fallback.
 */
.fvp-bg-video {
	position: absolute !important;
	top:    0 !important;
	right:  0 !important;
	bottom: 0 !important;
	left:   0 !important;
	width:  100% !important;
	height: 100% !important;
	z-index: 0;
	pointer-events: none;   /* clicks pass through to content above  */
	overflow: hidden;
	object-fit: cover;      /* <video> elements: cover the box        */
}

/* ------------------------------------------------------------------ */
/* Path A containers: ensure content stays above the video            */
/* ------------------------------------------------------------------ */

/* The column wrapper (content) is a sibling of .fusion-column-inner-bg
 * (where the video lives). Give it z-index:1 so it floats above. */
.fusion-column-inner-bg-wrapper > .fusion-column-wrapper {
	position: relative;
	z-index: 1;
}

/* Belt-and-suspenders for other Avada container types */
.fusion-builder-row > *:not(.fvp-bg-video),
.fusion-layout-column > *:not(.fvp-bg-video),
.fusion-section > *:not(.fvp-bg-video) {
	position: relative;
	z-index: 1;
}

/* ------------------------------------------------------------------ */
/* Path B: Avada Image element replacement                             */
/* ------------------------------------------------------------------ */

/*
 * The .fusion-imageframe (or nearest ancestor) becomes position:relative
 * + overflow:hidden (set by JS). The video fills it edge-to-edge.
 * The hidden placeholder <img> keeps its slot but takes no space.
 */
.fusion-imageframe.has-fvp-video,
.fusion-image-element.has-fvp-video {
	position: relative;
	overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Self-hosted <video>                                                  */
/* ------------------------------------------------------------------ */

.fvp-bg-video.fvp-self-hosted {
	object-fit: cover;
}

/* ------------------------------------------------------------------ */
/* YouTube placeholder div → YT replaces it with an <iframe>          */
/* ------------------------------------------------------------------ */

.fvp-bg-youtube {
	background: #000;
}

/* The YouTube IFrame API replaces the placeholder <div> with an
 * <iframe>. That iframe needs to scale like object-fit:cover. */
.fvp-bg-youtube iframe {
	position: absolute !important;
	top:  50% !important;
	left: 50% !important;
	/* Minimum dimension trick replicates object-fit:cover for iframes */
	min-width:  100% !important;
	min-height: 100% !important;
	width:  auto !important;
	height: auto !important;
	transform: translate(-50%, -50%) scale(1.05);
	border: 0;
	pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Vimeo placeholder div → Vimeo SDK wraps with a <div> + <iframe>    */
/* ------------------------------------------------------------------ */

.fvp-bg-vimeo {
	background: #000;
}

/* Vimeo Player SDK wraps the iframe in an inner <div>; cover both. */
.fvp-bg-vimeo > div {
	position: absolute !important;
	top:    0 !important;
	right:  0 !important;
	bottom: 0 !important;
	left:   0 !important;
	width:  100% !important;
	height: 100% !important;
}

.fvp-bg-vimeo iframe {
	position: absolute !important;
	top:  50% !important;
	left: 50% !important;
	min-width:  100% !important;
	min-height: 100% !important;
	width:  auto !important;
	height: auto !important;
	transform: translate(-50%, -50%) scale(1.05);
	border: 0;
	pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Avada: mark tagged containers as stacking contexts                  */
/* ------------------------------------------------------------------ */

.fusion-layout-column.has-fvp-bg,
.fusion-column-wrapper.has-fvp-bg,
.fusion-builder-row.has-fvp-bg,
.fusion-fullwidth.has-fvp-bg {
	position: relative;
	overflow: hidden;
}
