/**
 * Kubota Europe logo hero (WPBakery element `vc_kbeu_logo_hero`).
 *
 * Based on the Figma "OK Kubota Care" page (node 4166-12873, layers 4221:1660,
 * 4221:1663, 4221:1667 and 4221:1664): on the 2560 artboard, a 2457×856 frame
 * with a 15px radius whose left ~81% hold a photo (2304×948 source, cover-fitted)
 * on a white background. Over the photo lies the "main-figure" (4221:1663), a
 * white check-mark-like shape 1557×857 starting 899px from the frame's left edge
 * (36.6%) and running to its right edge and full height — its diagonal cuts into
 * the photo and its notch points left. It is bundled as
 * `assets/img/kbeu-logo-hero-shape.png` (the Figma image, 1566×862, transparent
 * left part) and stretched to that box. On its white, inset 156px from the right:
 *   - the Kubota Care logo, 459×219 (shield + wordmark + orange underline), its
 *     top at 397px (46% of the height);
 *   - 41px under it, "Up to 5 YEARS" (64px / Regular, right-aligned);
 *   - "Extended Warranty" (40px / Bold), whose baseline sits 99px above the
 *     frame's bottom edge.
 * The Figma file also holds a white "Agriculture, engineered for real work" title
 * hidden behind the photo — a leftover of another template, not part of the hero.
 *
 * Everything inside the frame is sized against the FRAME's width, not the
 * viewport's: the frame is a size container and the measurements are `cqi`
 * (1cqi = 1% of its width), so the composition keeps its proportions whatever
 * width the WPBakery row gives the block. Browsers without container units read
 * the viewport-based declaration just before each `cqi` one.
 *
 * Font family "Inter" is provided by the plugin's fonts stylesheet
 * (this handle depends on `kbeu-fonts`). The bundled family ships the 300 / 400 /
 * 500 / 700 weights, so the design's 400 (Roman) headline gets the Regular face.
 *
 * The element takes the width its WPBakery row gives it (no breakout, no inner
 * max-width). Between 768 and 1199px the frame grows taller and the logo and the
 * claim get a larger share of it, so they stay readable. Below
 * 768px there is no design to follow: the block stacks — the photo on top in its
 * own rounded frame (4:3, or 4:5 with the element's portrait mobile photo), then
 * the logo and the claim centred on white under it.
 *
 * The `--claim` style (Figma "OK Kubota Protect Plus", node 4280-907) is laid out
 * in its own section at the end of this file.
 */

.kbeu-logo-hero {
	--kbeu-lh-radius: 15px;
	--kbeu-lh-photo-width: 81%;
	--kbeu-lh-shape-left: 36.6%;
	--kbeu-lh-bg: #fff;

	width: 100%;
	font-family: var( --kbeu-font-principal );
	color: var( --kbeu-color-ink, #1d1d1b );
}

.kbeu-logo-hero,
.kbeu-logo-hero *,
.kbeu-logo-hero *::before,
.kbeu-logo-hero *::after {
	box-sizing: border-box;
}

/* --- Frame + photo ------------------------------------------------------ */

.kbeu-logo-hero__frame {
	position: relative;
	width: 100%;
	aspect-ratio: 2457 / 856;
	border-radius: var( --kbeu-lh-radius );
	background-color: var( --kbeu-lh-bg );
	overflow: hidden;
	container-type: inline-size;
}

/* Browsers without `aspect-ratio`: the classic padding-top box (856 / 2457). */
@supports not ( aspect-ratio: 1 / 1 ) {
	.kbeu-logo-hero__frame {
		height: 0;
		padding-top: 34.84%;
	}
}

.kbeu-logo-hero__media {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: block;
	width: var( --kbeu-lh-photo-width );
	height: 100%;
}

/* The design's white check-mark shape over the photo's right part: stretched to
   its Figma box (from 36.6% to the right edge, full height), so its diagonal and
   notch keep meeting the frame's edges whatever the frame's ratio. */
.kbeu-logo-hero .kbeu-logo-hero__shape {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: var( --kbeu-lh-shape-left );
	display: block;
	width: calc( 100% - var( --kbeu-lh-shape-left ) );
	height: 100%;
	max-width: none;
	object-fit: fill;
	pointer-events: none;
	user-select: none;
}

/* Scoped with the block class so the theme's generic `img` sizing (max-width /
   height: auto) cannot win over the cover fit. */
.kbeu-logo-hero .kbeu-logo-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	pointer-events: none;
}

/* --- Panel: logo + claim ------------------------------------------------- */

/* Pinned to the right edge and to the bottom, as in the design: the content
   hangs from the bottom so a longer claim (a translation) grows upwards. The
   claim is right-aligned, so only the right side is padded: its box is ~34% of
   the frame, the after-sales Kubota Care design's 831px (Figma 5286-4963), and
   "Up to 5000 hours extended warranty" stays on one line. */
.kbeu-logo-hero__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: flex-end;
	width: 40%;
	padding: 0 6.1% 3.6% 0;
	text-align: right;
}

.kbeu-logo-hero__logo {
	width: 18.7vw;
	width: 18.7cqi;
	max-width: 100%;
	line-height: 0;
}

.kbeu-logo-hero .kbeu-logo-hero__logo-img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
}

.kbeu-logo-hero__headline,
.kbeu-logo-hero__tagline {
	margin: 0;
	padding: 0;
	color: inherit;
	letter-spacing: 0;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.kbeu-logo-hero__headline {
	margin-top: 1.05vw;
	margin-top: 1.05cqi;
	font-size: clamp( 20px, 2.6vw, 64px );
	font-size: clamp( 20px, 2.6cqi, 64px );
	font-weight: 400;
}

.kbeu-logo-hero__tagline {
	font-size: clamp( 15px, 1.63vw, 40px );
	font-size: clamp( 15px, 1.63cqi, 40px );
	font-weight: 700;
}

.kbeu-logo-hero__headline strong,
.kbeu-logo-hero__headline b {
	font-weight: 700;
}

/* Heading for screen readers only (the logo is the visible title). */
.kbeu-logo-hero .kbeu-logo-hero__sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	white-space: nowrap;
	border: 0;
}

/* No claim (Figma 5286-5558, the Kubota Insight Programme page): the logo alone,
   a 432px round sticker 156px from the right edge and 19px above the bottom one. */
.kbeu-logo-hero--no-claim .kbeu-logo-hero__panel {
	padding: 0 6.35% 0.79% 0;
}

.kbeu-logo-hero--no-claim .kbeu-logo-hero__logo {
	width: 17.6vw;
	width: 17.6cqi;
}

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

@media ( max-width: 1199px ) and ( min-width: 768px ) {
	.kbeu-logo-hero--no-claim .kbeu-logo-hero__panel {
		padding: 0 5% 2% 0;
	}

	.kbeu-logo-hero--no-claim .kbeu-logo-hero__logo {
		width: 22vw;
		width: 22cqi;
	}
}

@media ( max-width: 767px ) {
	/* Stacked: the sticker centred under the photo. */
	.kbeu-logo-hero--no-claim .kbeu-logo-hero__panel {
		padding: 24px 8px 0;
	}

	.kbeu-logo-hero--no-claim .kbeu-logo-hero__logo {
		width: min( 220px, 56% );
	}
}

@media ( max-width: 1199px ) and ( min-width: 768px ) {
	/* Narrower rows: the frame grows taller and the panel wider, so the logo and
	   the claim keep a readable size (the shape keeps its Figma box). */
	.kbeu-logo-hero__frame {
		aspect-ratio: 2.3 / 1;
	}

	.kbeu-logo-hero__panel {
		width: 45%;
		padding: 0 5% 4.5% 0;
	}

	.kbeu-logo-hero__logo {
		width: 25vw;
		width: 25cqi;
	}

	.kbeu-logo-hero__headline {
		font-size: 3.4vw;
		font-size: 3.4cqi;
	}

	.kbeu-logo-hero__tagline {
		font-size: 2.15vw;
		font-size: 2.15cqi;
	}
}

@media ( max-width: 767px ) {
	/* Stacked: the photo in its own rounded frame, then the logo and the claim
	   centred on white. The outer frame drops its ratio, radius and clipping. */
	.kbeu-logo-hero__frame {
		display: flex;
		flex-direction: column;
		align-items: center;
		aspect-ratio: auto;
		border-radius: 0;
		background: transparent;
		overflow: visible;
		container-type: normal;
	}

	@supports not ( aspect-ratio: 1 / 1 ) {
		.kbeu-logo-hero__frame {
			height: auto;
			padding-top: 0;
		}
	}

	.kbeu-logo-hero__media {
		position: relative;
		width: 100%;
		height: auto;
		aspect-ratio: 4 / 3;
		border-radius: 12px;
		overflow: hidden;
	}

	/* The portrait mobile photo gets a portrait frame. */
	.kbeu-logo-hero--has-mobile .kbeu-logo-hero__media {
		aspect-ratio: 4 / 5;
	}

	/* No room for the shape beside a stacked photo: the panel is plain white. */
	.kbeu-logo-hero .kbeu-logo-hero__shape {
		display: none;
	}

	/* A landscape photo cropped to 4:3 keeps its subject, which the desktop
	   layout places left of centre (the right side is under the white shape). */
	.kbeu-logo-hero:not( .kbeu-logo-hero--has-mobile ) .kbeu-logo-hero__img {
		object-position: 40% center;
	}

	.kbeu-logo-hero__panel {
		position: static;
		align-items: center;
		width: 100%;
		padding: 28px 8px 0;
		text-align: center;
	}

	.kbeu-logo-hero__logo {
		width: min( 240px, 64% );
	}

	.kbeu-logo-hero__headline {
		margin-top: 18px;
		font-size: 30px;
	}

	.kbeu-logo-hero__tagline {
		font-size: 20px;
	}
}

/* --- Two-tone claim style ------------------------------------------------ */

/* Figma "OK Kubota Protect Plus" (node 4280-907): on the same 2457×856 frame the
   photo ("Fondo Negro", 4280:1175) covers the whole width, and three layers sit
   over its right half:
     - the white diagonal shape ("main-figure 2", 4280:1178), 1247×874, flush with
       the frame's right and bottom edges and running 18px above its top (the
       frame clips that); bundled as `kbeu-logo-hero-shape-diagonal.svg`;
     - the white 3D plus ("plus 1", 4280:1262), 255×264, at 394.5 / 314 inside
       the shape's box — on the photo, just left of the diagonal;
     - the claim (4280:1181), 64px / Bold, line height 1.2, left-aligned at
       681.5 inside the shape's box, its last baseline 55px above the bottom edge:
       an orange part ("Maintenance planifiée.") over a black one ("Budget
       maîtrisé."), four lines in all.
   The three live in `__figure`, a box sized like the shape: the shape is in flow
   at its own ratio (width-driven, so the diagonal keeps its angle and the box
   gets its height from it), and the mark and the claim are placed in % of that
   box, so they stay against the diagonal whatever the frame's ratio. The box is
   a size container: the claim's 64px are 5.13cqi of the shape's width (64/1247).
   The claim column is 34% of the box (about 424px at 2457), which wraps the
   design's two phrases exactly as drawn; up to four lines fit below the
   diagonal. */

.kbeu-logo-hero--claim {
	/* 1247 / 2457: the shape's share of the frame width. */
	--kbeu-lh-figure-w: 50.75%;
	--kbeu-lh-photo-width: 100%;
}

.kbeu-logo-hero__figure {
	position: absolute;
	right: 0;
	bottom: 0;
	width: var( --kbeu-lh-figure-w );
	container-type: inline-size;
}

/* Scoped with the block class so the theme's generic `img` sizing cannot win. */
.kbeu-logo-hero .kbeu-logo-hero__figure-shape {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	pointer-events: none;
	user-select: none;
}

.kbeu-logo-hero .kbeu-logo-hero__mark {
	position: absolute;
	top: 35.93%;
	left: 31.64%;
	display: block;
	width: 20.45%;
	height: auto;
	max-width: none;
	pointer-events: none;
	user-select: none;
}

.kbeu-logo-hero .kbeu-logo-hero__claim {
	position: absolute;
	bottom: 3.3%;
	left: 54.66%;
	width: 34%;
	margin: 0;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-size: clamp( 20px, 2.6vw, 64px );
	font-size: clamp( 20px, 5.13cqi, 64px );
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.2;
	text-align: left;
	text-transform: none;
	hyphens: auto;
	overflow-wrap: break-word;
}

.kbeu-logo-hero__claim-accent,
.kbeu-logo-hero__claim-text {
	display: block;
}

.kbeu-logo-hero__claim-accent {
	color: var( --kbeu-color-orange, #d85324 );
}

@media ( max-width: 1199px ) and ( min-width: 768px ) {
	/* The frame is 2.3:1 here: the shape keeps 102.1% of its height
	   ((1247 / 856) / 2.3), so it gets wider and the claim grows with it. */
	.kbeu-logo-hero--claim {
		--kbeu-lh-figure-w: 63.34%;
	}
}

@media ( max-width: 767px ) {
	/* Stacked like the logo style: no shape and no mark beside a stacked photo,
	   the claim centred on white under it. */
	.kbeu-logo-hero__figure {
		position: static;
		width: 100%;
		container-type: normal;
	}

	.kbeu-logo-hero .kbeu-logo-hero__figure-shape,
	.kbeu-logo-hero .kbeu-logo-hero__mark {
		display: none;
	}

	.kbeu-logo-hero .kbeu-logo-hero__claim {
		position: static;
		width: 100%;
		padding: 28px 8px 0;
		font-size: 30px;
		text-align: center;
	}
}
