/**
 * Kubota Europe division landing hero slider (WPBakery element
 * `vc_kbeu_division_slider`).
 *
 * Figma nodes 4481-1318 (title + subtitle) and 4481-2572 (pre-title + title +
 * CTA): a rounded frame (15px) spanning the header's gutter (51 → 2512 of the
 * 2560 artboard, 2461×571), a background image under a 45% black overlay, a
 * centered text block and the shared prev/next arrows in the bottom-right
 * corner. The slider does not loop — the arrows use the `.kbeu-nav-arrow`
 * component and its `:disabled` ring is the design's greyed-out "previous" on
 * the first slide. Slides change with the same gentle opacity crossfade as the
 * other plugin sliders (`.is-fading`), kept even under `prefers-reduced-motion`.
 *
 * Sizes are `clamp()`s whose maximum is the Figma value (the artboard is 2560px
 * wide, so the `vw` term reaches the literal number right around it). Font
 * "Inter" comes from the plugin's fonts stylesheet (this handle
 * depends on `kbeu-fonts`), referenced through `--kbeu-font-principal`.
 */

.kbeu-division-slider {
	--kbeu-ds-overlay: rgba( 0, 0, 0, 0.45 );
	/* Design: frame spans 51 → 2512 of the 2560 artboard — the header's gutter. */
	--kbeu-ds-gutter: clamp( 20px, 2vw, 51px );
	--kbeu-ds-radius: 15px;
	/* Design: 571px tall @2560. */
	--kbeu-ds-height: clamp( 400px, 22.3vw, 571px );

	position: relative;
	/* Break out of the page container to span the viewport, minus the gutter. */
	width: 100vw;
	max-width: 100vw;
	margin-left: calc( 50% - 50vw );
	margin-right: calc( 50% - 50vw );
	padding: 0 var( --kbeu-ds-gutter );
	box-sizing: border-box;
	font-family: var( --kbeu-font-principal );
	color: #fff;
}

.kbeu-division-slider__frame {
	position: relative;
	overflow: hidden;
	border-radius: var( --kbeu-ds-radius );
	background: var( --kbeu-color-near-black );
}

.kbeu-division-slider__viewport {
	overflow: hidden;
	transition: opacity 0.3s ease;
}

.kbeu-division-slider__viewport.is-fading {
	opacity: 0;
}

.kbeu-division-slider__track {
	display: flex;
	will-change: transform;
}

/* --- Slide ---------------------------------------------------------------- */

.kbeu-division-slider__slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	min-height: var( --kbeu-ds-height );
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: clamp( 28px, 2.5vw, 64px ) clamp( 20px, 3.1vw, 80px );
	text-align: center;
}

.kbeu-division-slider__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kbeu-division-slider__img--empty {
	background: #2b2b2b;
}

.kbeu-division-slider__overlay {
	position: absolute;
	inset: 0;
	background: var( --kbeu-ds-overlay );
}

/* --- Text block ----------------------------------------------------------- */

.kbeu-division-slider__content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	/* Design: the title block is 1252px wide @2560. */
	max-width: min( 100%, clamp( 560px, 48.9vw, 1252px ) );
}

/* Design: 24px light @2560, ~20px above the title. */
.kbeu-division-slider__pretitle {
	margin: 0 0 clamp( 10px, 0.78vw, 20px );
	font-size: clamp( 15px, 0.94vw, 24px );
	font-weight: 300;
	line-height: 1.55;
	color: #fff;
}

/* Design: 70px bold @2560 (64px on the longer-title variant), wraps onto two lines. */
.kbeu-division-slider__title {
	margin: 0;
	font-size: clamp( 30px, 2.73vw, 70px );
	font-weight: 700;
	line-height: 1.1;
	color: #fff;
	text-wrap: balance;
}

/* Design: 24px light @2560, ~20px below the title. */
.kbeu-division-slider__subtitle {
	margin: clamp( 10px, 0.78vw, 20px ) 0 0;
	font-size: clamp( 15px, 0.94vw, 24px );
	font-weight: 300;
	line-height: 1.55;
	color: #fff;
}

/* CTA: the shared `.kbeu-btn .kbeu-btn--primary`, resized to the design
   (270×54 box, 20px regular text, 15px radius @2560). */
.kbeu-division-slider .kbeu-division-slider__cta {
	min-width: clamp( 160px, 10.55vw, 270px );
	margin-top: clamp( 12px, 0.94vw, 24px );
	padding: clamp( 9px, 0.5vw, 13px ) clamp( 18px, 1.02vw, 26px );
	border-radius: 15px;
	font-family: inherit;
	font-size: clamp( 15px, 0.78vw, 20px );
	font-weight: 400;
	line-height: 1.2;
}

/* --- Prev / next arrows (bottom-right corner) ----------------------------- */

/* Design @2560: 48px discs, 18px apart, 159px from the right and 76px from the
   bottom of the frame. */
.kbeu-division-slider__nav {
	position: absolute;
	right: clamp( 16px, 6.2vw, 159px );
	bottom: clamp( 16px, 2.97vw, 76px );
	z-index: 3;
	display: flex;
	gap: clamp( 10px, 0.7vw, 18px );
}

/* The idle (disabled) state is the design's grey ring + grey arrow. */
.kbeu-division-slider .kbeu-nav-arrow {
	--kbeu-nav-arrow-size: clamp( 40px, 1.875vw, 48px );
	--kbeu-nav-arrow-idle-bg: transparent;
	--kbeu-nav-arrow-idle-border: var( --kbeu-color-muted );
	--kbeu-nav-arrow-idle-fg: var( --kbeu-color-muted );
}

/* --- Responsive ------------------------------------------------------------ */

@media ( max-width: 782px ) {
	.kbeu-division-slider {
		--kbeu-ds-radius: 12px;
		--kbeu-ds-height: clamp( 420px, 118vw, 520px );
	}

	.kbeu-division-slider__slide {
		/* Room for the arrows below the text block. */
		padding: 28px 20px 88px;
	}

	.kbeu-division-slider__title {
		line-height: 1.15;
	}

	.kbeu-division-slider__nav {
		right: 16px;
		bottom: 16px;
	}
}

/* Respect reduced motion: only the gentle opacity crossfade remains. */
@media ( prefers-reduced-motion: reduce ) {
	.kbeu-division-slider .kbeu-division-slider__cta {
		transition: none;
	}
}
