/**
 * Kubota Europe news slider (WPBakery element `vc_kbeu_news_slider`).
 *
 * Figma node 3727-7538 (2560 artboard): wide slides of 1126 × 503 with a 30px
 * gap, the current one centered and its neighbours peeking at the edges; each a
 * rounded (14px) full-bleed featured image with the sector tag at the top-left
 * (teal pill, 7px radius, 20px roman), a frosted "glass" box over the lower part
 * (rgba(0,0,0,.27) + 3.475px backdrop blur, 29px radius) holding the title
 * (32px / 700, white) and, on one line, the outlined "Read More" button and the
 * date (18px / 700, bullet) at the right; the chevrons + dots control 62px
 * below.
 *
 * The slider mechanics (centered mode, crossfade, control) are the shared
 * carousel component (`kbeu-carousel.css` / `kbeu-carousel.js`); this file sets
 * its tokens for this element and styles the slide. Sizes are `clamp()`s whose
 * maximum is the Figma value (vw = px / 25.6). The element takes the width its
 * WPBakery row gives it — a full-width row shows the peeking neighbours as
 * designed. Font "Inter" comes from the plugin's fonts
 * stylesheet (this handle depends on `kbeu-fonts`), via `--kbeu-font-principal`.
 */

.kbeu-ns {
	--kbeu-carousel-gap: clamp( 16px, 1.17vw, 30px );
	/* Slide width relative to the viewport (1126 / 2560). */
	--kbeu-carousel-item-w: 44%;
	--kbeu-ns-radius: 14px;
	/* Slide proportion from Figma (1126 × 503). */
	--kbeu-ns-ratio: 1126 / 503;
	--kbeu-ns-teal: var( --kbeu-color-teal );
	position: relative;
	width: 100%;
	font-family: var( --kbeu-font-principal );
	color: #fff;
}

.kbeu-ns[hidden] {
	display: none;
}

/* The control sits 62px under the slides in the design. */
.kbeu-ns .kbeu-carousel__control {
	margin-top: clamp( 28px, 2.42vw, 62px );
}

/* Slide: rounded, full-bleed image with the overlay content on top. */
.kbeu-ns__card {
	position: relative;
	flex: 1 1 auto;
	display: block;
	aspect-ratio: var( --kbeu-ns-ratio );
	border-radius: var( --kbeu-ns-radius );
	overflow: hidden;
	background: var( --kbeu-color-near-black );
	text-decoration: none;
	color: inherit;
}

.kbeu-ns__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.kbeu-ns__img--empty {
	background: linear-gradient( 135deg, #2a2a2a, #141414 );
}

/* Sector tag, pinned to the top-left (70px / 52px in from the slide's corner). */
.kbeu-ns__tag {
	position: absolute;
	top: clamp( 14px, 2.03vw, 52px );
	left: clamp( 16px, 2.73vw, 70px );
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	height: clamp( 22px, 1.13vw, 29px );
	padding: 0 clamp( 12px, 0.78vw, 20px );
	border-radius: 7px;
	background: var( --kbeu-ns-teal );
	font-size: clamp( 13px, 0.78vw, 20px );
	font-weight: 400;
	line-height: 1;
	color: #fff;
	white-space: nowrap;
}

/* Frosted "glass" box over the lower part of the slide (70px / 84px / 46px in
   from the left / right / bottom edges). */
.kbeu-ns__glass {
	position: absolute;
	left: 6.2%;
	right: 7.5%;
	bottom: clamp( 14px, 1.8vw, 46px );
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: clamp( 12px, 1.17vw, 30px );
	box-sizing: border-box;
	min-height: clamp( 120px, 9.7vw, 248px );
	padding: clamp( 16px, 1.6vw, 41px ) clamp( 16px, 1.6vw, 41px ) clamp( 16px, 1.9vw, 49px );
	border-radius: 29px;
	background: rgba( 0, 0, 0, 0.27 );
	-webkit-backdrop-filter: blur( 3.475px );
	backdrop-filter: blur( 3.475px );
}

.kbeu-ns__title {
	margin: 0;
	font-family: var( --kbeu-font-principal );
	font-weight: 700;
	line-height: 1.37;
	font-size: clamp( 18px, 1.25vw, 32px );
	color: #fff;
	/* Keep long headlines to two lines, as designed. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Bottom line of the box: the button on the left, the date on the right. */
.kbeu-ns__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: clamp( 12px, 1.17vw, 30px );
	flex-wrap: wrap;
}

/* "Read More" (design node I3727:7546;3076:200): the shared
   `.kbeu-btn .kbeu-btn--transparent`, with the design's 1px outline and size. */
.kbeu-ns .kbeu-ns__btn {
	padding: clamp( 10px, 0.78vw, 20px ) clamp( 16px, 1.02vw, 26px );
	border-width: 1px;
	border-color: #fff;
	font-family: var( --kbeu-font-principal );
	font-size: clamp( 14px, 0.78vw, 20px );
	font-weight: 400;
	line-height: 1.5;
}

/* The whole slide is the link, so mirror the button's white hover fill on slide
   hover/focus (matches `.kbeu-btn--transparent:hover`). */
.kbeu-ns__card:hover .kbeu-ns__btn,
.kbeu-ns__card:focus-visible .kbeu-ns__btn {
	background-color: #fff;
	border-color: #fff;
	color: var( --kbeu-color-near-black );
}

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

/* Date with a small bullet marker, right end of the bottom line. */
.kbeu-ns__date {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	font-weight: 700;
	font-size: clamp( 13px, 0.7vw, 18px );
	line-height: 1.5;
	color: #fff;
	white-space: nowrap;
}

.kbeu-ns__date::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

/* Tablet: wider slides so the current one still reads at a glance. */
@media ( max-width: 1100px ) {
	.kbeu-ns {
		--kbeu-carousel-item-w: 64%;
	}

	.kbeu-ns__glass {
		left: 5%;
		right: 5%;
	}
}

/* Phones: almost the whole viewport, a thin peek on each side. */
@media ( max-width: 720px ) {
	.kbeu-ns {
		--kbeu-carousel-item-w: 86%;
	}

	.kbeu-ns__card {
		aspect-ratio: 4 / 3;
	}

	.kbeu-ns__glass {
		min-height: 0;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.kbeu-ns .kbeu-ns__btn {
		transition: none;
	}
}
