/**
 * Kubota Europe card carousel (WPBakery element `vc_kbeu_card_carousel`).
 *
 * Figma node 4221-1867 (Kubota Care page, the cards) and 4221-1889 (the control
 * below them). Nothing is drawn here from scratch: the paging and the teal
 * chevrons + dots are the shared carousel (`kbeu-carousel.css`), the card is the
 * division products grid's (`.kbeu-dp__*` in `kbeu-division-products.css`, the
 * root carrying `kbeu-dp` for its tokens). This file only holds the deltas:
 *
 *   - cards per view (keep in sync with the root's `data-kbeu-per-view*`
 *     attributes the engine reads: `data-per-view` 2/3/4 on desktop, two
 *     ≤ 1199px, one ≤ 640px) and the grid's 44px column gap;
 *   - the design's card: 602 × 614 @2560 (the grey tile runs below the tag),
 *     the picture 72% of the card's width (434 × 353), starting 175px from the top;
 *   - hover: the viewport clips its overflow, so the grid's lift is dropped and
 *     the viewport gets room for the shadow; a card without a link has no hover.
 *
 * Further card styles (picture on top, product, testimonial, spec card) have their
 * own sections below.
 *
 * Sizes are `clamp()`s whose maximum is the Figma value (2560px artboard).
 */

.kbeu-cc {
	--kbeu-carousel-per-view: 3;
	--kbeu-carousel-gap: var( --kbeu-dp-gap-x );
	/* Room around the track for the hover shadow (0 12px 30px) and the focus ring. */
	--kbeu-cc-shadow-top: 12px;
	--kbeu-cc-shadow-bottom: 44px;
}

.kbeu-cc[data-per-view='2'] {
	--kbeu-carousel-per-view: 2;
}

.kbeu-cc[data-per-view='4'] {
	--kbeu-carousel-per-view: 4;
}

/* The viewport's clipping edge moves out by the padding; the negative margins
   keep the element's box where it was. */
.kbeu-cc__viewport {
	padding: var( --kbeu-cc-shadow-top ) 4px var( --kbeu-cc-shadow-bottom );
	margin: calc( -1 * var( --kbeu-cc-shadow-top ) ) -4px calc( -1 * var( --kbeu-cc-shadow-bottom ) );
}

/* The card fills its carousel item (the item is a flex box). */
.kbeu-cc .kbeu-dp__card {
	display: flex;
	flex: 1 1 auto;
	width: 100%;
}

.kbeu-cc .kbeu-dp__link {
	flex: 1 1 auto;
	/* Design: 602 × 614 (the grey tile runs 21% below the 506px frame). */
	min-height: clamp( 360px, 23.98vw, 614px );
}

/* Design: the picture is 72% of the card's width, 434 × 353 @2560. */
.kbeu-cc .kbeu-dp__img {
	width: 72%;
	max-height: clamp( 180px, 13.8vw, 353px );
}

/* No lift inside the carousel (the viewport would clip it); the shadow stays. */
.kbeu-cc .kbeu-dp__link:hover,
.kbeu-cc .kbeu-dp__link:focus-visible {
	transform: none;
}

/* A card without a link is not interactive. */
.kbeu-cc .kbeu-cc__static,
.kbeu-cc .kbeu-cc__static:hover {
	box-shadow: none;
	cursor: default;
}

/* --- Accent colour (`accent=orange`) ------------------------------------- */
/* The carousel control and the shared button read these tokens. */
.kbeu-cc--accent-orange {
	--kbeu-carousel-accent: var( --kbeu-color-orange );
	--kbeu-carousel-accent-hover: var( --kbeu-color-orange-dark );
	--kbeu-btn-primary-bg: var( --kbeu-color-orange );
	--kbeu-btn-primary-bg-hover: var( --kbeu-color-orange-dark );
}

/* --- "Picture on top" style (`card_style=image_top`) ---------------------- */
/* Figma 4494-2700…2731 (2560 artboard): three 570px cards 93px apart, each a
   570 × 344 picture (15px radius), a one-line 32px / Bold title 50px below it,
   the 24px / Light text, then the 54px button; the buttons of a page line up
   (the text grows). The control: 24px orange chevrons, 12px grey dots and a
   58 × 12 active pill, 23px apart, 141px under the buttons. */
.kbeu-cc--image-top {
	--kbeu-carousel-gap: clamp( 20px, 3.63vw, 93px );
	--kbeu-carousel-dot-size: 12px;
	--kbeu-carousel-dot-active-width: 58px;
	--kbeu-carousel-dot: #d9d9d9;
	font-family: var( --kbeu-font-principal );
}

.kbeu-cc--image-top .kbeu-cc__viewport {
	padding: 0;
	margin: 0;
}

.kbeu-cc__card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
}

.kbeu-cc__media {
	width: 100%;
	aspect-ratio: 570 / 344;
	border-radius: 15px;
	overflow: hidden;
	background: var( --kbeu-color-surface );
}

.kbeu-cc .kbeu-cc__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.kbeu-cc__title {
	width: 100%;
	margin: clamp( 18px, 1.95vw, 50px ) 0 0;
	/* Impreza pads every heading that is not a first child. */
	padding: 0;
	font-family: var( --kbeu-font-principal );
	font-weight: 700;
	line-height: 1.37;
	font-size: clamp( 22px, 1.25vw, 32px );
	color: var( --kbeu-color-ink-alt );
	/* One line, as designed; the full title is the element's `title`. */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kbeu-cc__body {
	flex: 1 1 auto;
	margin: clamp( 10px, 1.02vw, 26px ) 0 0;
	font-weight: 300;
	line-height: 1.55;
	font-size: clamp( 16px, 0.94vw, 24px );
	color: var( --kbeu-color-ink );
}

.kbeu-cc__actions {
	margin-top: clamp( 14px, 0.78vw, 20px );
}

/* The shared `.kbeu-btn--primary`, sized as designed (4494-2709): 20px / Roman,
   26px at the sides, 54px tall. */
.kbeu-cc .kbeu-cc__btn {
	padding: clamp( 8px, 0.39vw, 10px ) clamp( 18px, 1.02vw, 26px );
	font-family: var( --kbeu-font-principal );
	font-size: clamp( 16px, 0.78vw, 20px );
	font-weight: 400;
	line-height: 1.5;
	white-space: nowrap;
}

.kbeu-cc--image-top .kbeu-carousel__control {
	gap: clamp( 12px, 0.9vw, 23px );
	margin-top: clamp( 40px, 5.5vw, 141px );
}

.kbeu-cc--image-top .kbeu-carousel__dots {
	gap: 9px;
}

/* --- "Product card" style (`card_style=product`) -------------------------- */

/* Figma 4516-2401…2423 + 4516-2113 (élevage landing): the division products
   grid's card as the grid draws it — 602 × 506 @2560 and the grid's picture
   sizing, i.e. the Kubota Care deltas above undone — and the "Picture on top"
   control: 12px grey dots and a 58 × 12 active pill 9px apart, 23px from the
   chevrons, whose 24px glyph sits 64px under the cards (56px to the 40px arrow
   box). With the orange accent the tag and the key
   figure turn orange as well (the grid's teal token). */
.kbeu-cc--product {
	--kbeu-carousel-dot-size: 12px;
	--kbeu-carousel-dot-active-width: 58px;
	--kbeu-carousel-dot: #d9d9d9;
}

.kbeu-cc--product.kbeu-cc--accent-orange {
	--kbeu-dp-teal: var( --kbeu-color-orange );
}

.kbeu-cc--product .kbeu-dp__link {
	min-height: clamp( 300px, 19.77vw, 506px );
}

.kbeu-cc--product .kbeu-dp__img {
	width: 80%;
	max-height: clamp( 160px, 11vw, 280px );
}

.kbeu-cc--product .kbeu-carousel__control {
	gap: clamp( 12px, 0.9vw, 23px );
	margin-top: clamp( 20px, 2.19vw, 56px );
}

.kbeu-cc--product .kbeu-carousel__dots {
	gap: 9px;
}

/* --- "Testimonial" style (`card_style=testimonial`) ----------------------- */

/* Figma 5037-5157 / 5037-5166 (lead generation page): 1130px light grey cards
   48px apart, 20px corners, 48px padding; a 70px / Medium turquoise opening
   quotation mark (its box = the glyph's cap height, 50px: with `line-height: 1`
   the face's ascent is its cap height, so the ink starts at the box top), the
   quote's cap height 32px under it (24px / Light, #1d1d1b), then 32px under its
   last baseline the author row — a round 56px photo 16px before the name (18px /
   Bold) over the role (18px / Light, turquoise), 4px apart. The control is the
   product style's (12px dots, 58px pill). */
.kbeu-cc--testimonial {
	--kbeu-carousel-gap: clamp( 16px, 1.875vw, 48px );
	--kbeu-carousel-dot-size: 12px;
	--kbeu-carousel-dot-active-width: 58px;
	--kbeu-carousel-dot: #d9d9d9;
	font-family: var( --kbeu-font-principal );
}

.kbeu-cc--testimonial .kbeu-cc__viewport {
	padding: 0;
	margin: 0;
}

.kbeu-cc .kbeu-cc__testimonial {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: clamp( 24px, 1.875vw, 48px );
	border-radius: 20px;
	background: var( --kbeu-color-surface );
}

.kbeu-cc__mark {
	display: block;
	height: 0.71em;
	font-weight: 500;
	font-size: clamp( 48px, 2.73vw, 70px );
	line-height: 1;
	color: var( --kbeu-color-teal );
}

/* Impreza draws its own quotation mark and padding on every blockquote. */
.kbeu-cc .kbeu-cc__quote {
	flex: 1 1 auto;
	margin: clamp( 14px, 0.98vw, 25px ) 0 0;
	padding: 0;
	border: 0;
	font-family: inherit;
	font-style: normal;
	font-weight: 300;
	font-size: clamp( 16px, 0.94vw, 24px );
	line-height: 1.55;
	color: var( --kbeu-color-ink );
}

.kbeu-cc .kbeu-cc__quote::before {
	content: none;
}

.kbeu-cc .kbeu-cc__quote p {
	margin: 0;
	padding: 0;
	font: inherit;
	color: inherit;
}

.kbeu-cc__author {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: clamp( 14px, 0.7vw, 18px );
}

.kbeu-cc .kbeu-cc__avatar {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	max-width: none;
	border-radius: 50%;
	object-fit: cover;
	background: var( --kbeu-color-teal );
}

.kbeu-cc__author-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	font-size: clamp( 16px, 0.7vw, 18px );
	line-height: 1.56;
}

.kbeu-cc__name {
	font-weight: 700;
	color: var( --kbeu-color-ink );
}

.kbeu-cc__role {
	font-weight: 300;
	color: var( --kbeu-color-teal );
}

.kbeu-cc--testimonial .kbeu-carousel__control {
	gap: clamp( 12px, 0.9vw, 23px );
	margin-top: clamp( 24px, 3.05vw, 78px );
}

.kbeu-cc--testimonial .kbeu-carousel__dots {
	gap: 9px;
}

/* --- "Spec card" style (`card_style=specs`) ------------------------------- */

/* Figma 5286-7901 / 7916 / 7930 (engines downloads page, 2560 artboard): 602 × 764
   tiles 44px apart (#f3f3f3, 14px corners) — the title's cap height 40px under the
   top and 47px in, the bulleted 20px / Light tag on its baseline at the right, the
   40px-tall "New" pill under it (out of the flow: every picture starts 101px from
   the top), the 393.5 × 320 picture (65.4% of the card) centred, 16px under it the
   20px / Light specifications (line height 1.56, 5.5px between the left rows; the
   labels turquoise), then the two 321 × 54 buttons stacked 17px apart, 43px above
   the bottom. The control is the product style's. */
.kbeu-cc--specs {
	--kbeu-carousel-dot-size: 12px;
	--kbeu-carousel-dot-active-width: 58px;
	--kbeu-carousel-dot: #d9d9d9;
}

.kbeu-cc--specs.kbeu-cc--accent-orange {
	--kbeu-dp-teal: var( --kbeu-color-orange );
}

.kbeu-cc--specs .kbeu-dp__link {
	min-height: clamp( 360px, 29.84vw, 764px );
	padding: clamp( 16px, 1.33vw, 34px ) var( --kbeu-dp-pad-x ) clamp( 16px, 1.68vw, 43px );
}

/* Title | tag on one baseline; the badge hangs below the title. */
.kbeu-cc__spec-head {
	position: relative;
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) auto;
	align-items: baseline;
	column-gap: 12px;
}

.kbeu-cc__spec-head .kbeu-dp__title {
	grid-column: 1;
	/* Impreza pads every heading that is not a first child. */
	padding: 0;
}

.kbeu-cc__spec-head .kbeu-dp__tag {
	grid-column: 2;
	grid-row: 1;
	font-size: clamp( 15px, 0.78vw, 20px );
	font-weight: 300;
	line-height: 1.56;
	color: var( --kbeu-dp-teal );
	white-space: nowrap;
}

.kbeu-cc__spec-head .kbeu-dp__badge {
	position: absolute;
	z-index: 1;
	top: 100%;
	left: 0;
	margin: 0;
	/* Design: 97 × 40, 28.5px at the sides. */
	padding: clamp( 3px, 0.27vw, 7px ) clamp( 14px, 1.11vw, 28.5px );
}

.kbeu-cc--specs .kbeu-dp__media {
	flex: 0 0 auto;
	min-height: 0;
	margin: clamp( 10px, 0.93vw, 24px ) 0 0;
}

.kbeu-cc--specs .kbeu-dp__img {
	/* 393.5px of the 508px between the paddings @2560. */
	width: 77.46%;
	height: auto;
	max-height: none;
}

/* Left rows ("Label: value") and the right-aligned column (label on its own line),
   which drops below the rows on a card too narrow for both. */
.kbeu-cc__specs {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: clamp( 8px, 0.47vw, 12px );
	margin-top: clamp( 10px, 0.62vw, 16px );
	font-size: clamp( 15px, 0.78vw, 20px );
	font-weight: 300;
	line-height: 1.56;
	color: var( --kbeu-dp-ink );
}

.kbeu-cc .kbeu-cc__spec-list {
	display: flex;
	flex-direction: column;
	gap: clamp( 3px, 0.21vw, 5.5px );
	min-width: 0;
	margin: 0;
	padding: 0;
}

.kbeu-cc .kbeu-cc__spec-list--side {
	gap: 0;
	margin-left: auto;
	text-align: right;
}

.kbeu-cc .kbeu-cc__spec dt,
.kbeu-cc .kbeu-cc__spec dd {
	display: inline;
	margin: 0;
	padding: 0;
	font: inherit;
}

.kbeu-cc .kbeu-cc__spec dt {
	color: var( --kbeu-dp-teal );
}

.kbeu-cc .kbeu-cc__spec dt::after {
	content: ':';
}

.kbeu-cc .kbeu-cc__spec-list--side dt,
.kbeu-cc .kbeu-cc__spec-list--side dd {
	display: block;
}

/* Two buttons of one width (the wider label's, 321px at least @2560), centred. */
.kbeu-cc__actions--stacked {
	display: grid;
	grid-template-columns: minmax( min( 100%, clamp( 200px, 12.54vw, 321px ) ), max-content );
	justify-content: center;
	row-gap: clamp( 10px, 0.66vw, 17px );
	margin-top: auto;
	padding-top: clamp( 20px, 1.33vw, 34px );
}

.kbeu-cc--specs .kbeu-carousel__control {
	gap: clamp( 12px, 0.9vw, 23px );
	margin-top: clamp( 24px, 3.36vw, 86px );
}

.kbeu-cc--specs .kbeu-carousel__dots {
	gap: 9px;
}

@media ( max-width: 1199px ) {
	.kbeu-cc,
	.kbeu-cc[data-per-view='4'] {
		--kbeu-carousel-per-view: 2;
	}
}

/* (The shared carousel's own ≤ 860px one-per-view rule loses to `.kbeu-cc`, which
   comes later in the cascade: two cards stay down to the grid's 640px breakpoint,
   like the engine's `data-kbeu-bp-mobile`.) */
@media ( max-width: 640px ) {
	.kbeu-cc,
	.kbeu-cc[data-per-view='2'],
	.kbeu-cc[data-per-view='4'] {
		--kbeu-carousel-per-view: 1;
	}

	.kbeu-cc .kbeu-dp__link {
		min-height: 0;
	}

	.kbeu-cc--specs .kbeu-cc__btn {
		white-space: normal;
	}
}
