/**
 * Avoid FOUC from Medisch .bg-section <img> tags (functions.js later
 * copies them onto the parent as CSS backgrounds and removes the node).
 */

/* Hide decorative bg images until JS relocates them — prevents giant
   intrinsic-size flashes without breaking section height. */
div.bg-section > img {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* Page heroes / slides: show a real cover image immediately (these are
   the visible banner areas users notice). */
.hero,
.slider .slide {
	position: relative;
	overflow: hidden;
}

.hero > div.bg-section,
.slider .slide > div.bg-section {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
}

.hero > div.bg-section > img,
.slider .slide > div.bg-section > img {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	clip: auto !important;
	opacity: 1 !important;
	object-fit: cover;
	object-position: center center;
	display: block;
}

.hero > .container,
.slider .slide > .container {
	position: relative;
	z-index: 1;
}

/* After JS adds .bg-section to the section itself, neutralize the theme's
   height:100% so sections (cta, services, etc.) don't stretch huge. */
section.bg-section,
.cta.bg-section,
.services.bg-section,
.about.bg-section,
.contact.bg-section {
	height: auto;
}
