/**
 * Kubota Europe image & text (WPBakery element `vc_kbeu_image_text`).
 *
 * Based on the Figma designs 4978-3580 (image left, half of the row: eyebrow +
 * title + text + button) and 4978-3613 (image right, ~60% of the row: title +
 * text): a rounded picture (15px radius) beside a light grey (#f6f6f6) rounded
 * card (14px radius) with ~25–32px between them on the 2560 artboard. Inside the
 * card, padded ~90px: a turquoise eyebrow (28px / Light), a bold title (32px /
 * Bold, 1.37 line height), a light paragraph (24px / Light, 1.55 line height) and
 * the turquoise button (20px / Roman, 15px radius, 26px side padding). Same type
 * scale as the product descriptions and the text card, so they read as one family.
 *
 * Kubota Tracking System variant (4244-6222 image left / 4244-6263 image right, the
 * picture ~40% of the row): the card opens with a top row — an uploaded turquoise
 * pictogram (136–143px tall) on the left, level with the title, and the eyebrow on
 * the right, 24px / Bold, black and right-aligned — then the title at the same
 * height in every block whatever the length of its text. So with that row
 * (`--has-top`) the card content is aligned to the top instead of centred, and the
 * icon sits in a fixed-height box so blocks with different pictograms line up.
 *
 * Kubota Protect Plus variant (4280-1239, image left, 806 of 1896px ≈ the 43%
 * preset): the same card painted orange (#d85324, `--kbeu-color-orange`) with the
 * title and the text in white, same type scale. The card's colours are tokens
 * (`--kbeu-it-card-*`) and the `--card-orange` modifier only swaps them; the
 * eyebrow and the text links, turquoise on grey, turn white on orange, and the
 * template prints the shared white button instead of the turquoise one.
 *
 * Layout: the picture's column is an exact share of the row minus the gap
 * (50% by default) and the card takes the rest. It must be an explicit basis, not
 * grow factors over a zero basis: the card's padding counts towards its base size
 * whatever the box model, so grow factors made the card wider than its share and
 * the columns of two stacked blocks did not line up. The share comes from the
 * `data-image-width` attribute, NOT an inline custom property — an inline value
 * would beat the stacking override below.
 * The source order is always image → card; the `--image-right` modifier reverses
 * the row, so the stacked layout keeps the image on top. Both columns stretch to
 * the same height: the picture's `aspect-ratio` is only a floor (16:9 gives the
 * design's 611px at 60% of the row), and when the card is taller the image grows
 * with it and is cropped by `object-fit: cover` — that is how both Figma variants
 * get equal heights.
 *
 * The element takes the width its WPBakery row gives it (no breakout, no inner
 * max-width). Below 861px there is no design to follow: the columns stack, image
 * first, and the card's padding shrinks.
 *
 * Font family "Inter" is provided by the plugin's fonts stylesheet
 * (this handle depends on `kbeu-fonts`), referenced via `--kbeu-font-principal`.
 * The bundled family ships the 300 / 400 / 500 / 700 weights, so the design's 400
 * (Roman) button matches exactly. The button is the shared
 * `.kbeu-btn--primary` (this handle depends on `kbeu-buttons`), whose fill already
 * is the design's turquoise; only its size is tweaked here.
 */

.kbeu-image-text {
	/* The image's share of the row, in percent (the card takes the rest).
	   Overridden per preset by the `data-image-width` rules below. */
	--kbeu-it-image: 50;
	--kbeu-it-gap: clamp( 20px, 1.15vw, 29px );
	--kbeu-it-radius: 15px;
	--kbeu-it-card-radius: 14px;
	/* Height of the top row's icon box (the design's pictograms are 136–143px). */
	--kbeu-it-icon-h: clamp( 64px, 5.5vw, 140px );
	--kbeu-it-surface: var( --kbeu-color-surface );
	--kbeu-it-teal: var( --kbeu-color-teal );
	/* Card colours (light grey card); the card style modifiers below swap them.
	   `ink` = title and corner eyebrow, `text` = paragraph, `accent` = eyebrow
	   above the title and the paragraph's links. */
	--kbeu-it-card-bg: var( --kbeu-it-surface );
	--kbeu-it-card-ink: #000;
	--kbeu-it-card-text: var( --kbeu-color-ink );
	--kbeu-it-card-accent: var( --kbeu-it-teal );

	/* Fills whatever width its WPBakery row/column gives it (no breakout, no
	   own max width): the row decides between site width and full width. */
	width: 100%;
	display: flex;
	align-items: stretch;
	gap: var( --kbeu-it-gap );
	font-family: var( --kbeu-font-principal );
}

/* The paddings and radii are the design's own measurements, so they have to
   stay inside the columns whatever the theme's box model. */
.kbeu-image-text,
.kbeu-image-text *,
.kbeu-image-text *::before,
.kbeu-image-text *::after {
	box-sizing: border-box;
}

/* Image on the right: keep source order image → card but flip it. */
.kbeu-image-text--image-right {
	flex-direction: row-reverse;
}

/* Orange card (the `card_style` param): white texts, links included. */
.kbeu-image-text--card-orange {
	--kbeu-it-card-bg: var( --kbeu-color-orange );
	--kbeu-it-card-ink: #fff;
	--kbeu-it-card-text: #fff;
	--kbeu-it-card-accent: #fff;
}

/* Width presets (the `image_width` param). 50% is the default above. */
.kbeu-image-text[data-image-width='40'] {
	--kbeu-it-image: 40;
}

/* Protect Plus design: 806px of the 1896px row. */
.kbeu-image-text[data-image-width='43'] {
	--kbeu-it-image: 43;
}

.kbeu-image-text[data-image-width='60'] {
	--kbeu-it-image: 60;
}

.kbeu-image-text[data-image-width='66'] {
	--kbeu-it-image: 66;
}

/* Square picture (the `image_ratio` param; Tonte résidentielle landing, Figma
   4494-3333 / 4494-3321 / 4494-3345: 784 × 803 photos beside short texts): a 1:1
   floor instead of 16:9, so the card grows to the photo. Desktop only — stacked,
   the picture keeps the default 16:9 — and never for a video (its poster sets
   the proportion).
   The img box is the drawn photo (height 100%, natural width, centred), not the
   column: core turns lazy images' `sizes` into "auto, …" and Chrome then picks
   the candidate from the box's width, so a 3:2 photo in a square column would
   get a variant as wide as the column — too short — and be upscaled (same fix as
   `.kbeu-gc .kbeu-csg__img`). `min-width` keeps a portrait photo covering. */
@media ( min-width: 861px ) {
	.kbeu-image-text[data-image-ratio='square'] .kbeu-image-text__media:not( .kbeu-image-text__media--video ) {
		aspect-ratio: 1 / 1;
	}

	.kbeu-image-text[data-image-ratio='square'] .kbeu-image-text__img {
		width: auto;
		min-width: 100%;
		height: 100%;
		margin-left: 50%;
		translate: -50% 0;
	}
}

/* --- Picture ------------------------------------------------------------ */

/* The ratio is a floor: `align-items: stretch` grows the column to the card's
   height when the texts are taller. The flat grey shows while the picture loads.
   Its width is the exact share of the row left after the gap, so every block with
   the same preset splits at the same x whatever its texts. */
.kbeu-image-text__media {
	flex: 0 0 calc( ( 100% - var( --kbeu-it-gap ) ) * var( --kbeu-it-image ) / 100 );
	min-width: 0;
	aspect-ratio: 16 / 9;
	border-radius: var( --kbeu-it-radius );
	background-color: var( --kbeu-it-surface );
	overflow: hidden;
}

/* Scoped with the block class so the theme's generic `img` sizing (max-width /
   height: auto) cannot win over the cover fit. */
.kbeu-image-text .kbeu-image-text__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

/* --- Card ---------------------------------------------------------------- */

/* Takes whatever the picture leaves (its padding does not change the split). */
.kbeu-image-text__card {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	padding: clamp( 32px, 3.6vw, 92px );
	background: var( --kbeu-it-card-bg );
	border-radius: var( --kbeu-it-card-radius );
	color: var( --kbeu-it-card-ink );
	text-align: left;
}

/* `card_padding=large`: the 115px the after-sales Kubota Care cards draw (Figma
   5286-5062…5074). Before the quote rules, which keep their own padding. Those
   cards also give the title a fixed box, 828px wide and two lines tall, so the
   texts of a stack of cards start at the same height whatever the title. */
.kbeu-image-text--pad-large .kbeu-image-text__card {
	padding: clamp( 32px, 4.49vw, 115px );
}

.kbeu-image-text--pad-large .kbeu-image-text__title {
	max-width: 828px;
	min-height: calc( 2em * 1.37 );
}

/* A single column left (no picture / no texts) spans the whole row. */
.kbeu-image-text--no-image .kbeu-image-text__card,
.kbeu-image-text--no-card .kbeu-image-text__media {
	flex: 1 1 100%;
}

.kbeu-image-text__eyebrow {
	margin: 0;
	font-weight: 300;
	line-height: 1.2;
	font-size: clamp( 20px, 2vw, 28px );
	color: var( --kbeu-it-card-accent );
}

.kbeu-image-text__title {
	margin: 0;
	/* Impreza gives every heading that is not a first child a 1.5rem padding-top;
	   the gap to the eyebrow is set below instead. */
	padding: 0;
	font-weight: 700;
	line-height: 1.37;
	font-size: clamp( 24px, 2.4vw, 32px );
	color: var( --kbeu-it-card-ink );
	/* Long translations wrap instead of overflowing on narrow screens. */
	overflow-wrap: break-word;
}

/* Design: ~12px between the eyebrow's line box and the title's. */
.kbeu-image-text__eyebrow + .kbeu-image-text__title {
	margin-top: clamp( 8px, 0.5vw, 12px );
}

.kbeu-image-text__text {
	margin: 0;
	font-weight: 300;
	line-height: 1.55;
	font-size: clamp( 17px, 1.7vw, 24px );
	color: var( --kbeu-it-card-text );
	/* Long unbroken strings (URLs) wrap instead of pushing the column wider. */
	overflow-wrap: break-word;
}

/* The text is editor HTML: the theme's own block margins are replaced by one
   blank line between blocks (what a blank line in the old plain text gave). */
.kbeu-image-text .kbeu-image-text__text > * {
	margin: 0;
}

.kbeu-image-text .kbeu-image-text__text > * + * {
	margin-top: 1.55em;
}

.kbeu-image-text__text ul,
.kbeu-image-text__text ol {
	padding-left: 1.25em;
}

.kbeu-image-text .kbeu-image-text__text li + li {
	margin-top: 0.35em;
}

.kbeu-image-text__text strong,
.kbeu-image-text__text b {
	font-weight: 700;
}

.kbeu-image-text__text a {
	color: var( --kbeu-it-card-accent );
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.kbeu-image-text__text a:hover,
.kbeu-image-text__text a:focus-visible {
	text-decoration: none;
}

/* Design: ~29px between the title's line box and the paragraph's. Also applies
   when the paragraph follows the eyebrow directly (no title). */
.kbeu-image-text__eyebrow + .kbeu-image-text__text,
.kbeu-image-text__title + .kbeu-image-text__text {
	margin-top: clamp( 16px, 1.15vw, 29px );
}

/* --- Button ------------------------------------------------------------- */

/* Only the margin lives on the wrapper: it is drawn only when there is a button. */
.kbeu-image-text__actions {
	margin-top: clamp( 20px, 1.4vw, 36px );
}

/* The text after a button placed at the "Read More" tag (Figma 4516-2124: 49px
   from the button's bottom to the next cap height, i.e. 36px to its line box). */
.kbeu-image-text__actions + .kbeu-image-text__text {
	margin-top: clamp( 20px, 1.41vw, 36px );
}

/* --- Quote card (`card_type=quote`) -------------------------------------- */

/* Figma 4516-2030 (élevage landing): the testimonial in 40px / Bold over its
   author in 32px / Light, 59px from the quote's last baseline to the author's cap
   height (36px between the line boxes), in a card padded 172 / 135px — what
   makes the 923 × 797 card of the design. Impreza's blockquote (side padding,
   1.3em, an opening quote mark) is reset. */
.kbeu-image-text .kbeu-image-text__quote {
	margin: 0;
	padding: 0;
	border: 0;
	font-family: var( --kbeu-font-principal );
	font-style: normal;
	font-weight: 700;
	font-size: clamp( 24px, 1.5625vw, 40px );
	line-height: 1.37;
	color: var( --kbeu-it-card-ink );
	overflow-wrap: break-word;
}

.kbeu-image-text .kbeu-image-text__quote::before,
.kbeu-image-text .kbeu-image-text__quote::after {
	content: none;
}

.kbeu-image-text .kbeu-image-text__quote p {
	margin: 0;
}

.kbeu-image-text__quote + .kbeu-image-text__text {
	margin-top: clamp( 16px, 1.41vw, 36px );
}

.kbeu-image-text--quote .kbeu-image-text__text {
	font-size: clamp( 18px, 1.25vw, 32px );
	line-height: 1.37;
}

@media ( min-width: 861px ) {
	.kbeu-image-text--quote .kbeu-image-text__card {
		padding: clamp( 32px, 6.72vw, 172px ) clamp( 32px, 5.27vw, 135px );
	}
}

/* Light quote (`quote_style=mark`, Figma 4516-5466 / 5474 / 5479, The Journey
   page): the testimonial in 32px / Light (#1d1d1b, 1.37) under a 128px / Bold
   opening quotation mark, in a grey card padded 105 / 102 / 126 / 90px (the
   design draws its cards by hand: 132–153px under the last baseline) — the
   mark's ink 105px below the card's top, the text's cap height 85px below the
   mark's. The mark is decorative (empty alternative text) and its box is the
   ink: in the Bold face (ascent 0.71em = cap height, line-height 1) the glyph
   starts at the top of its line box and is 0.31em tall, so `height: 0.31em`
   plus a 0.31em margin puts the text's cap height 85px lower at 2560 — in em,
   the distances hold at every width. Impreza's own `blockquote:before` mark
   (absolute, Georgia, half opacity) is overridden property by property. */
.kbeu-image-text--quote-mark .kbeu-image-text__quote {
	font-weight: 300;
	font-size: clamp( 20px, 1.25vw, 32px );
	line-height: 1.37;
	color: var( --kbeu-color-ink );
}

.kbeu-image-text.kbeu-image-text--quote-mark .kbeu-image-text__quote::before {
	content: '\201C';
	content: '\201C' / '';
	display: block;
	position: static;
	height: 0.31em;
	margin: 0 0 0.31em;
	font-family: var( --kbeu-font-principal );
	font-size: clamp( 64px, 5vw, 128px );
	font-weight: 700;
	line-height: 1;
	color: #000;
	opacity: 1;
}

@media ( min-width: 861px ) {
	.kbeu-image-text--quote-mark .kbeu-image-text__card {
		justify-content: flex-start;
		padding: clamp( 32px, 4.1vw, 105px ) clamp( 32px, 3.98vw, 102px ) clamp( 32px, 4.92vw, 126px ) clamp( 32px, 3.52vw, 90px );
	}
}

/* --- Top row: icon + corner eyebrow ------------------------------------- */

/* Design: the icon ~78px below the card's top edge and the title 264px below it in
   every block, so the content no longer floats in the middle of the card. */
.kbeu-image-text--has-top .kbeu-image-text__card {
	justify-content: flex-start;
	padding-top: clamp( 28px, 3.05vw, 78px );
}

.kbeu-image-text__top {
	display: flex;
	align-items: flex-start;
	gap: clamp( 16px, 1.25vw, 32px );
	width: 100%;
}

/* Fixed height so blocks with different pictograms start their titles level. */
.kbeu-image-text__icon {
	display: flex;
	align-items: flex-start;
	flex: none;
	height: var( --kbeu-it-icon-h );
}

/* Scoped with the block class so the theme's generic `img` sizing cannot win. */
.kbeu-image-text .kbeu-image-text__icon-img {
	display: block;
	width: auto;
	height: auto;
	max-width: none;
	max-height: 100%;
}

/* An SVG without intrinsic size would collapse with `height: auto`. */
.kbeu-image-text .kbeu-image-text__icon-img[src$='.svg'] {
	height: 100%;
}

/* Pushed to the right edge, with or without an icon next to it. */
.kbeu-image-text__eyebrow--corner {
	flex: 0 1 auto;
	min-width: 0;
	margin-left: auto;
	font-weight: 700;
	font-size: clamp( 17px, 1.4vw, 24px );
	color: var( --kbeu-it-card-ink );
	text-align: right;
	overflow-wrap: break-word;
}

/* Design: ~36px between the icon's box and the title's line box. Whatever comes
   first below the row (title, text, button) takes the same distance. */
.kbeu-image-text__top + * {
	margin-top: clamp( 20px, 1.4vw, 36px );
}

/* Context tweaks over `.kbeu-btn--primary`: the design's button is a 54px pill
   with 26px side padding and a 20px label (the shared button is wider and
   smaller). Same tweaks as the image CTA so the two buttons match. */
.kbeu-image-text__btn {
	padding: clamp( 10px, 0.9vw, 13px ) clamp( 20px, 1.8vw, 26px );
	font-family: var( --kbeu-font-principal );
	font-size: clamp( 16px, 1.4vw, 20px );
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
}

/* "Button style" = outlined (Figma 4494-2693): a 1px black outline and a black
   20px / Roman label on the light grey card; hover fills it ink (the shared
   `.kbeu-btn--outline`). */
.kbeu-image-text .kbeu-image-text__btn--outline {
	border-width: 1px;
	border-color: #000;
	color: #000;
	font-weight: 400;
	line-height: 1.5;
	padding-top: clamp( 8px, 0.43vw, 11px );
	padding-bottom: clamp( 8px, 0.43vw, 11px );
}

.kbeu-image-text .kbeu-image-text__btn--outline:hover,
.kbeu-image-text .kbeu-image-text__btn--outline:focus-visible {
	border-color: var( --kbeu-color-ink-alt );
	color: #fff;
}

/* Outlined on the orange card (Figma 5309-1733, genuine parts page): a white outline
   and a white label; hover fills it white with a dark label (as `.kbeu-btn--transparent`). */
.kbeu-image-text--card-orange .kbeu-image-text__btn--outline {
	border-color: #fff;
	color: #fff;
}

.kbeu-image-text--card-orange .kbeu-image-text__btn--outline:hover,
.kbeu-image-text--card-orange .kbeu-image-text__btn--outline:focus-visible {
	background-color: #fff;
	border-color: #fff;
	color: #000;
}

/* "Card content position" = top: the texts start at the card's top padding when
   the card is taller than them (equal-height columns, a tall picture). */
.kbeu-image-text--content-top .kbeu-image-text__card {
	justify-content: flex-start;
}

/* --- Video in the picture's place (Figma 4494-2670 / 4494-2694) ---------- */
/* The column's minimum proportion is the poster's (`--kbeu-it-media-ratio`, set
   inline from the attachment's size — intrinsic data, not a layout preset), so the
   design's portrait testimonial (734 × 1273) keeps its shape; without a poster
   the picture's 16:9. Stacked on phones it is capped at most of the screen. */
.kbeu-image-text__media--video {
	aspect-ratio: var( --kbeu-it-media-ratio, 16 / 9 );
}

@media ( max-width: 860px ) {
	.kbeu-image-text__media--video {
		max-height: 85vh;
	}
}

/* The shared player (`kbeu-video.css`) fills the column like the picture: the
   column's radius and clipping frame it, the video covers it. */
.kbeu-image-text__media--video .kbeu-video {
	display: block;
	height: 100%;
}

.kbeu-image-text__media--video .kbeu-video-item {
	height: 100%;
	border-radius: 0;
	object-fit: cover;
	background-color: var( --kbeu-color-near-black );
}

/* The caption box as designed: 441 × 183 @2560, 50px from the right and 62px from
   the bottom of the video, frosted like the case study cards' panel, the caption
   (20px / Light) over a two-line 32px / Bold title in a 240px column, the play
   glyph 24px to its right. Only the box's look changes; the player's states
   (playing = cleared box, faded texts) are the shared stylesheet's. */
.kbeu-image-text__video .kbeu-video-title {
	right: clamp( 14px, 1.95vw, 50px );
	bottom: clamp( 14px, 2.42vw, 62px );
	gap: clamp( 12px, 0.94vw, 24px );
	/* 46px above the caption's cap height and below the title's baseline in
	   Figma, i.e. 36 / 42px around their line boxes. */
	padding: clamp( 12px, 1.41vw, 36px ) clamp( 16px, 1.68vw, 43px ) clamp( 14px, 1.64vw, 42px );
	border: 1px solid rgba( 0, 0, 0, 0.13 );
	border-radius: clamp( 16px, 1.13vw, 29px );
	background: rgba( 0, 0, 0, 0.27 );
	-webkit-backdrop-filter: blur( 3.475px );
	backdrop-filter: blur( 3.475px );
}

.kbeu-image-text__video .kbeu-video-title.kbeu-video-title-playing {
	border-color: transparent;
}

.kbeu-image-text__video .kbeu-video-title-container {
	max-width: clamp( 140px, 9.38vw, 240px );
}

.kbeu-image-text__video .kbeu-video-subtitle-caption {
	margin: 0;
	font-family: var( --kbeu-font-principal );
	font-weight: 300;
	font-size: clamp( 15px, 0.78vw, 20px );
	line-height: 1.5;
	color: #fff;
}

.kbeu-image-text__video .kbeu-video-title-text {
	font-family: var( --kbeu-font-principal );
	font-weight: 700;
	font-size: clamp( 20px, 1.25vw, 32px );
	line-height: 1.22;
}

.kbeu-image-text__video .kbeu-video-play-button {
	width: clamp( 45px, 3.55vw, 91px );
}

/* Wide caption box (`video_caption=wide`, Figma 4516-5491, The Journey page):
   731 × 294 @2560 over a landscape video, 179px from the right and 127px from
   the bottom, the title in a 398px column — three lines for "Case studies from
   KUBOTA Business Unit Engine Europe" — and the play glyph 165px to its right.
   Same frosted look, caption and title type as the compact box. */
.kbeu-image-text--caption-wide .kbeu-image-text__video .kbeu-video-title {
	right: clamp( 14px, 6.99vw, 179px );
	bottom: clamp( 14px, 4.96vw, 127px );
	gap: clamp( 16px, 6.45vw, 165px );
	padding: clamp( 14px, 2.81vw, 72px ) clamp( 16px, 1.76vw, 45px ) clamp( 14px, 2.81vw, 72px ) clamp( 16px, 1.84vw, 47px );
}

.kbeu-image-text--caption-wide .kbeu-image-text__video .kbeu-video-title-container {
	flex: 0 1 auto;
	width: clamp( 180px, 15.55vw, 398px );
	max-width: none;
}

/* --- Front-end editor placeholder ----------------------------------------- */

/* Shown in the WPBakery front-end editor when the image and every text are empty. */
.kbeu-image-text__card--empty {
	padding: 24px;
}

.kbeu-image-text__placeholder {
	margin: 0;
	padding: 24px;
	width: 100%;
	border: 1px dashed var( --kbeu-it-teal );
	border-radius: 8px;
	font-weight: 300;
	font-size: 15px;
	color: var( --kbeu-color-gray-blue );
	text-align: left;
}

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

/* Stack on narrow viewports: image on top whatever side it had, then the card.
   These rules must beat the preset ones above, which is why the share is a
   `data-` attribute rather than an inline style. */
@media ( max-width: 860px ) {
	.kbeu-image-text,
	.kbeu-image-text--image-right {
		flex-direction: column;
	}

	.kbeu-image-text__media,
	.kbeu-image-text__card {
		flex: none;
		width: 100%;
	}

	.kbeu-image-text__media {
		border-radius: 12px;
	}

	.kbeu-image-text__card,
	.kbeu-image-text--has-top .kbeu-image-text__card,
	.kbeu-image-text--pad-large .kbeu-image-text__card {
		padding: 24px;
		border-radius: 12px;
	}

	.kbeu-image-text--pad-large .kbeu-image-text__title {
		min-height: 0;
	}

	/* Narrower side padding so a long label still fits on one line on a 390px phone. */
	.kbeu-image-text__btn {
		padding-left: 14px;
		padding-right: 14px;
		white-space: normal;
	}
}
