/**
 * Kubota Europe promotions slider (WPBakery element `vc_kbeu_promotions`).
 *
 * The slider mechanics (viewport / track / item, two per view on desktop and one
 * on mobile, the teal prev/next + dots control and the crossfade) are the shared
 * carousel component: the element's root carries the `kbeu-carousel` class, so
 * `kbeu-carousel.js` initializes it and `kbeu-carousel.css` styles the track and
 * the control. This file only restyles the item content into the promotion card
 * of the Figma design
 * (node 4595-1719): a rounded, full-bleed featured image (the promotional
 * creative) with, over its bottom-left, a frosted "glass" box holding the
 * promotion title in white and a white "View More" button.
 *
 * Font family "Inter" comes from the plugin's fonts stylesheet
 * (this handle depends on `kbeu-fonts`) and is referenced via `--kbeu-font-principal`.
 */

.kbeu-promotions {
	--kbeu-promotions-radius: 14px;
	/* Card proportion from Figma (732.187 × 749.244 ≈ almost square). */
	--kbeu-promotions-ratio: 732 / 749;
}

/* Configurable content width (element param "Content max width", default 1400px):
   the inner wrapper is centered and capped, shrinking on narrower viewports. */
.kbeu-promotions__inner {
	margin: 0 auto;
	max-width: var( --kbeu-promotions-max-width, 1400px );
}

/* The promotion card fills its slider item. */
.kbeu-promotions__item {
	display: flex;
}

.kbeu-promotions__card {
	position: relative;
	flex: 1 1 auto;
	display: block;
	aspect-ratio: var( --kbeu-promotions-ratio );
	border-radius: var( --kbeu-promotions-radius );
	overflow: hidden;
	background: var( --kbeu-color-border );
	text-decoration: none;
	color: inherit;
}

/* Featured image: the whole promotional creative, covering the card. */
.kbeu-promotions__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

/* Frosted "glass" box pinned to the bottom-left. */
.kbeu-promotions__overlay {
	position: absolute;
	left: clamp( 16px, 2vw, 30px );
	bottom: clamp( 16px, 2vw, 30px );
	max-width: min( 86%, 380px );
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp( 16px, 1.8vw, 26px );
	padding: clamp( 20px, 2.2vw, 34px );
	border-radius: 29px;
	background: rgba( 0, 0, 0, 0.27 );
	-webkit-backdrop-filter: blur( 3.475px );
	backdrop-filter: blur( 3.475px );
}

.kbeu-promotions__title {
	margin: 0;
	font-family: var( --kbeu-font-principal );
	font-weight: 700;
	line-height: 1.37;
	font-size: clamp( 22px, 2.4vw, 32px );
	color: #fff;
}

/* The whole card is the link, so trigger the button's hover fill on card
   hover/focus (matches `.kbeu-btn--white:hover`). */
.kbeu-promotions__card:hover .kbeu-btn,
.kbeu-promotions__card:focus-visible .kbeu-btn {
	background-color: var( --kbeu-btn-primary-bg );
	border-color: var( --kbeu-btn-primary-bg );
	color: #fff;
}

.kbeu-promotions__card:focus-visible {
	outline: 3px solid var( --kbeu-color-teal );
	outline-offset: 3px;
}

/* One card per view on mobile: give the near-square card a bit more height room. */
@media ( max-width: 860px ) {
	.kbeu-promotions {
		--kbeu-promotions-ratio: 4 / 5;
	}
}
