/* The picture replaces the CSS-only mobile LCP background, keeping its crop. */
body.home .elementor .elementor-element.cemacon-home-hero {
	background-image: none !important;
}

body.home .cemacon-home-hero > .cemacon-home-hero__poster {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: block;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

body.home .cemacon-home-hero__poster > img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
}

/* The homepage video keeps Elementor's geometry without its JS-owned class. */
body.home .cemacon-home-hero .cemacon-home-video-hosted {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	transform: translate(-50%, -50%);
	object-fit: cover;
}

/* Overlay the shared header on the homepage hero in every language. */
body.home .elementor-location-header {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 999;
}

body.home
	.elementor-location-header
	.cemacon-header:not(.is-compact) {
	--cemacon-header-bg: transparent !important;
	background: transparent !important;
}

@media (min-width: 1025px) and (prefers-reduced-motion: no-preference) {
	/* Paint the first video frame while scroll motion prepares the foreground.
	 * The original pending/fallback behavior is retained for every other panel. */
	body.home.cemacon-scroll-motion-pending:not(.elementor-editor-active)
		.elementor[data-elementor-type="wp-page"] > .cemacon-home-hero {
		visibility: visible !important;
	}

	body.home.cemacon-scroll-motion-pending:not(.elementor-editor-active)
		.cemacon-home-hero > .e-con-inner {
		visibility: hidden;
		animation: cemacon-home-media-foreground-fallback 0s 3s forwards;
	}
}

/* Preserve readable content if scroll-motion JavaScript fails to initialize. */
@keyframes cemacon-home-media-foreground-fallback {
	to { visibility: visible; }
}

/* The homepage switches to its static composition below the scrub breakpoint. */
@media (max-width: 1024px) {
	body.home .elementor-location-header {
		position: relative !important;
		top: auto !important;
		right: auto !important;
		left: auto !important;
	}

	body.home
		.elementor-location-header
		.cemacon-header:not(.is-compact) {
		--cemacon-header-bg: #fff !important;
		--cemacon-header-text: #1a1a1a !important;
		background: #fff !important;
		color: #1a1a1a;
	}

	body.home .cemacon-header:not(.is-compact) .cemacon-header__logo--full {
		display: inline-flex !important;
	}

	body.home .cemacon-header:not(.is-compact) .cemacon-header__logo--full-compact,
	body.home .cemacon-header:not(.is-compact) .cemacon-header__logo--mark {
		display: none !important;
	}

	body.home .cemacon-home-hero .elementor-background-video-container {
		display: none !important;
	}
}
