/* MerchSpine Banner Engine — HTML banner styles.
   Loaded only on pages that actually contain an HTML banner.
   Everything lives under .msbe-hb; nothing targets h1-h6, p, button or img globally.
   Geometry, colours and typography come from the per-banner <style> block
   (see MSBE_HTML_Renderer); this file is only the fixed base.
   --u is 1cqw: 1% of the banner's own width. */

.msbe-hb {
	--u: 1cqw;
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	box-sizing: border-box;
	container-type: inline-size;
	line-height: normal;
	text-align: left;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	isolation: isolate;
	/* Themes and Elementor set these on body / .elementor and they inherit into the banner. */
	font-style: normal;
	font-variant: normal;
	font-feature-settings: normal;
	word-spacing: normal;
	text-indent: 0;
	text-transform: none;
	hyphens: manual;
	direction: ltr;
	-webkit-text-size-adjust: 100%;
}

/* Browsers without container query units: approximate with the viewport; banner.js refines it. */
@supports not (container-type: inline-size) {
	.msbe-hb { --u: 1vw; }
}

.msbe-slot .msbe-media--html { line-height: normal; min-width: 0; }

/* Give the banner a width to fill even when its parent sizes to its content (Elementor containers, flex rows,
   inline-block wrappers). Without this a banner made only of absolutely positioned parts, inside a size-containing
   stage, has no intrinsic width and collapses. The spacer is capped by max-width:100%, so in a normal block it does
   nothing, and in a shrink-to-fit parent it makes the banner as wide as the space available. */
.msbe-media--html::before {
	content: "";
	display: block;
	width: 100vw;
	max-width: 100%;
	height: 0;
}

.msbe-hb *,
.msbe-hb *::before,
.msbe-hb *::after { box-sizing: border-box; }

.msbe-hb__bg,
.msbe-hb__l {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
	pointer-events: none;
}

.msbe-hb__l--image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--hb-ov, transparent);
	opacity: var(--hb-ovo, 0);
}

.msbe-hb__bg .msbe-hb__limg {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: var(--hb-fit, cover);
	object-position: var(--hb-pos, 50% 50%);
}

/* Whole-banner link sits under every element, so empty areas are clickable. */
.msbe-hb__bglink {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: block;
	text-decoration: none;
}
.msbe-hb__bglink:focus-visible { outline: 3px solid #2f5fd0; outline-offset: -3px; }
.msbe-hb--has-link .msbe-hb__e:not(a) { pointer-events: none; }

.msbe-hb .msbe-hb__e {
	position: absolute;
	margin: 0;
	padding: 0;
	max-width: none;
	border: 0;
	text-decoration: none;
	transform-origin: 50% 50%;
	box-sizing: border-box;
	min-width: 0;
}

.msbe-hb__e--text,
.msbe-hb__e--heading,
.msbe-hb__e--button { display: flex; }

.msbe-hb__e--image,
.msbe-hb__e--book { overflow: hidden; }

.msbe-hb .msbe-hb__t {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	min-width: 0;
	overflow: inherit;
	text-overflow: inherit;
	overflow-wrap: break-word;
}

.msbe-hb__e--button { cursor: default; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.msbe-hb__e--button.msbe-link { cursor: pointer; }

.msbe-hb__e.msbe-link:focus-visible { outline: 3px solid #2f5fd0; outline-offset: 2px; }

.msbe-hb .msbe-hb__img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	float: none !important;
	object-fit: var(--hb-fit, contain) !important;
	object-position: var(--hb-pos, 50% 50%) !important;
}

.msbe-hb .msbe-hb__svg {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	overflow: visible;
	fill: var(--hb-fill, none);
	stroke: var(--hb-stroke, none);
	stroke-width: var(--hb-sw, 0);
	stroke-linejoin: round;
	stroke-linecap: round;
}
.msbe-hb__svg path,
.msbe-hb__svg line { vector-effect: non-scaling-stroke; }
.msbe-hb__svg--line line {
	stroke-dasharray: var(--hb-dash, none);
	stroke-linecap: var(--hb-cap, round);
}
.msbe-hb__svg--line { fill: none; }

/* Pattern drawn inside a shape. Image, size, opacity and (for vector shapes) the clipping mask come from
   per-element custom properties set in the banner's own <style>. */
.msbe-hb__pat {
	position: absolute;
	inset: 0;
	display: block;
	pointer-events: none;
	border-radius: inherit;
	background-image: var(--hb-pat-img, none);
	background-size: var(--hb-pat-size, auto);
	background-position: var(--hb-pat-pos, 0 0);
	background-repeat: repeat;
	opacity: var(--hb-pat-op, 1);
	-webkit-mask: var(--hb-pat-mask, none) center / 100% 100% no-repeat;
	mask: var(--hb-pat-mask, none) center / 100% 100% no-repeat;
}

@media (prefers-reduced-motion: reduce) {
	.msbe-hb__e--button { transition: none; }
}
