/*
 * en2x Hero Slider – module styles.
 *
 * Desktop: two columns per slide (image left, content right), vertically
 * centered. Tablet/mobile: stacked and centered (image, then content), with the
 * navigation overlaid. Brand colours / background come from the configuration as
 * inline styles; font is inherited (Rubik from Salient).
 */

.en2x-hero {
	position: relative;
	display: flex;
	align-items: center;
	font-family: inherit;
	outline: none;
	/* Full-bleed background (image cover / colour) is set inline on this root in
	 * a full-width-content row, replacing the Salient row background. */
	background-size: cover;
	background-repeat: no-repeat;
}

/* Height steps (same thinking as the Thema Hero Detail). The content is centered
 * vertically; the chosen background covers the full area. */
.en2x-hero--gering {
	min-height: 350px;
}

.en2x-hero--mittel {
	min-height: 550px;
}

.en2x-hero--hoch {
	min-height: 800px;
}

/* Content container: capped to the 1600px content width and centered, while the
 * background bleeds to the full row width. */
.en2x-hero__inner {
	width: 100%;
	max-width: 1600px;
	margin: 0 auto;
	padding: 56px 64px;
}

.en2x-hero__empty {
	margin: 0;
	padding: 24px;
	text-align: center;
	font-size: 16px;
}

/* Viewport masks the horizontally translating track. */
.en2x-hero__viewport {
	position: relative;
	overflow: hidden;
}

.en2x-hero__track {
	display: flex;
	transition: transform 0.5s ease;
}

/* Each slide fills the viewport; align-items:stretch (default) keeps all
 * slides as tall as the tallest, so height never jumps between slides. */
.en2x-hero__slide {
	flex: 0 0 100%;
	width: 100%;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	align-items: center;
}

/* ---------------------------------------------------------------------------
 * Media column (image + top bar), same look as the Content Card.
 * ------------------------------------------------------------------------- */

.en2x-hero__media {
	border-radius: 8px;
	overflow: hidden;
	/* No background here: a parent background bleeds a 1px hairline through the
	 * rounded corners on iOS Safari (the visible white sliver). The bar and image
	 * fill the media completely and round their own outer corners below. */
}

.en2x-hero__bar {
	padding: 8px 16px;
	/* Round the top corners so the bar's own dark colour fills them cleanly
	 * (instead of relying on the parent clip, which leaves a corner sliver). */
	border-radius: 8px 8px 0 0;
	background: var(--en2x-color-headline, #250F51);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.en2x-hero__image {
	position: relative;
	width: 100%;
	aspect-ratio: 7 / 4;
	/* Round the bottom corners to match (clean clip at the image's own edges). */
	border-radius: 0 0 8px 8px;
	overflow: hidden;
}

.en2x-hero__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Round the image's own bottom corners too: the track has a transform
	 * (translateX) which can break the parent's overflow-clip + radius in Safari,
	 * leaving square corners. Rounding the img directly is reliable. */
	border-radius: 0 0 8px 8px;
}

/* Without the top bar the image rounds all four corners itself. */
.en2x-hero__media--no-bar .en2x-hero__image,
.en2x-hero__media--no-bar .en2x-hero__image img {
	border-radius: 8px;
}

.en2x-hero__image-placeholder {
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient(
		45deg,
		#ececf2,
		#ececf2 10px,
		#e3e3ec 10px,
		#e3e3ec 20px
	);
}

/* ---------------------------------------------------------------------------
 * Content column.
 * ------------------------------------------------------------------------- */

.en2x-hero__content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.en2x-hero__title {
	margin: 0 0 16px;
	font-size: 30px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
}

.en2x-hero__text {
	margin: 0 0 24px;
	font-size: 17px;
	line-height: 1.5;
}

/* Button suited to a colour/image background: light fill, primary text. */
.en2x-hero__button {
	display: inline-block;
	padding: 12px 28px;
	background: #fff;
	color: var(--en2x-color-primary, #221182);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	border-radius: var(--en2x-button-radius, 999px);
	transition: opacity 0.15s ease;
}

.en2x-hero__button:hover,
.en2x-hero__button:focus {
	opacity: 0.88;
	color: var(--en2x-color-primary, #221182);
}

/* ---------------------------------------------------------------------------
 * Navigation: round arrow buttons + bullet dots.
 * ------------------------------------------------------------------------- */

/* Navigation bar: arrows + bullets in one compact row, left-aligned under the
 * image (starts at the left image edge = the container's content edge). */
.en2x-hero__nav-bar {
	display: flex;
	align-items: center;
	margin-top: 20px;
}

.en2x-hero__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: var(--en2x-color-primary, #221182);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.en2x-hero__nav:hover,
.en2x-hero__nav:focus {
	opacity: 0.85;
}

/* The two arrows sit close together. */
.en2x-hero__nav-next {
	margin-left: 8px;
}

/* Bullets: white on the (usually coloured) hero background. */
.en2x-hero__bullets {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: 20px;
}

.en2x-hero__bullet {
	width: 12px;
	height: 12px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	opacity: 0.45;
	transition: opacity 0.15s ease, background 0.15s ease;
}

.en2x-hero__bullet.is-active {
	background: #fff;
	opacity: 1;
}

/* ---------------------------------------------------------------------------
 * Tablet / mobile: stack and center.
 * ------------------------------------------------------------------------- */

@media (max-width: 900px) {
	.en2x-hero__inner {
		padding: 32px 20px;
	}

	/* Lower the height floors on small screens; stacked content usually exceeds
	 * these, so they only prevent an over-tall hero when content is short. */
	.en2x-hero--gering {
		min-height: 280px;
	}

	.en2x-hero--mittel {
		min-height: 360px;
	}

	.en2x-hero--hoch {
		min-height: 460px;
	}

	.en2x-hero__slide {
		grid-template-columns: 1fr;
		gap: 24px;
		text-align: center;
		/* Top-align: the image sits at the top, the text follows with a constant
		 * 24px gap, and any extra slide height goes to the BOTTOM. Without this the
		 * stretched slide (grid align-content defaults to stretch) blew the rows
		 * apart → a huge gap between image and text when the text was short. */
		align-items: start;
		align-content: start;
	}

	.en2x-hero__content {
		align-items: center;
	}

	/* Cap the text height so a long excerpt cannot make one slide much taller
	 * than the others — all slides (and thus the whole slider) stay a uniform,
	 * bounded height; the text grows downward up to this limit. */
	.en2x-hero__text {
		display: -webkit-box;
		-webkit-line-clamp: 6;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	/* Center the navigation bar under the image on tablet/mobile. */
	.en2x-hero__nav-bar {
		justify-content: center;
	}
}
