/*
 * en2x Teaser Text mit Bild – module styles.
 *
 * Desktop: a (semi-transparent) text box on the left over a full-bleed
 * background image; the block height follows the text content. Mobile: the image
 * layer is hidden and the configured fallback colour shows; the box goes full
 * width. Brand colours / transparency come from the configuration as inline
 * styles; font is inherited (Rubik from Salient).
 */

.en2x-teaser {
	position: relative;
	/* Vertical gap so the box floats with the image above/below it. */
	padding: 56px 0;
	/* Fallback / mobile surface; the image layer covers it on desktop. */
	background-color: var(--en2x-teaser-mobile-bg, #250F51);
	overflow: hidden;
}

/* Background image as its own layer so it can be hidden on mobile. */
.en2x-teaser__media {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-repeat: no-repeat;
	background-size: cover;
}

/* Content-width container (matches footer/header): aligns the box to the site
 * content width instead of the full-bleed edge. The full-width image stays
 * behind; on wide screens the centered container reveals the image left/right. */
.en2x-teaser__inner {
	position: relative;
	z-index: 1;
	padding: 0 var(--en2x-side-gutter);
}

/* Text box – overlaps the image; height follows its content.
 *
 * align-items: stretch (statt flex-start) ist hier entscheidend: flex-start
 * bemisst die Flex-Kinder auf ihre MAX-CONTENT-Breite. Die Headline wurde
 * dadurch so breit wie ihr laengstes Wort und ragte aus der Box heraus - und
 * weil ihre eigene Zeilenbox dabei nie zu schmal war, griff auch keine
 * Umbruchregel. Der Button holt sich die alte Ausrichtung unten per align-self
 * zurueck, damit die Pille nicht auf Boxbreite gezogen wird.
 *
 * Breite fluid statt fester 50%: die einzige Media Query der Datei endet bei
 * 768px, ab 769px sprang die Box schlagartig auf die halbe Breite zurueck - der
 * Ueberlauf war bei 800px groesser als bei 768px. min(100%, max(50%, 460px))
 * haelt sie in schmalen Containern bei voller Breite und gibt ihr im Tablet-
 * Bereich genug Platz, ohne auf Desktop breiter zu werden als zuvor.
 * ------------------------------------------------------------------------- */
.en2x-teaser__box {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: min( 100%, max( 50%, 460px ) );
	padding: clamp( 24px, 4vw, 56px );
	font-family: inherit;
}

.en2x-teaser__headline {
	margin: 0 0 20px;
	/* Fluid: skaliert zwischen schmalen Viewports und Desktop. ACHTUNG - in
	 * clamp()/calc() brauchen + und - Leerzeichen auf BEIDEN Seiten, sonst
	 * verwirft der Browser die Deklaration stillschweigend komplett. */
	font-size: clamp( 22px, 1rem + 1.9vw, 30px );
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	color: inherit;
}

.en2x-teaser__text {
	/* Inherit Salient's body font size (follows the theme typography setting). */
	font-size: inherit;
	line-height: 1.6;
	color: inherit;
}

.en2x-teaser__text :first-child {
	margin-top: 0;
}

.en2x-teaser__text :last-child {
	margin-bottom: 0;
}

.en2x-teaser__text a {
	color: inherit;
	text-decoration: underline;
}

/* Button – background colour set inline; white label, project pill radius. */
.en2x-teaser__button {
	/* Die Box streckt ihre Kinder (siehe oben); die Pille soll ihre
	 * Inhaltsbreite behalten. */
	align-self: flex-start;
	display: inline-block;
	margin-top: 28px;
	padding: 12px 28px;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	border-radius: var(--en2x-button-radius, 999px);
	transition: opacity 0.15s ease;
}

.en2x-teaser__button:hover,
.en2x-teaser__button:focus {
	opacity: 0.88;
	color: #fff;
}

/* ---------------------------------------------------------------------------
 * Mobile: hide image, show the fallback colour, full-width box.
 * ------------------------------------------------------------------------- */

@media (max-width: 768px) {
	.en2x-teaser {
		padding: 24px 0;
	}

	.en2x-teaser__inner {
		padding: 0 24px;
	}

	.en2x-teaser__media {
		display: none;
	}

	.en2x-teaser__box {
		width: 100%;
		padding: clamp( 20px, 6vw, 32px );
	}
}
