/**
 * Kubota Europe icon features (WPBakery element `vc_kbeu_icon_features`).
 *
 * Based on the Figma design 4221-1704 (Kubota Care services): a row of centred
 * items, five per row on desktop. Each item has a pictogram on top (the tallest
 * ~122px in the design, all bottom-aligned on a common line), an orange bold
 * title (32px / Bold, line-height 1.37) and a short black paragraph (20px / Roman,
 * line-height 1.5). The column count is the `data-columns` preset (3-6) and
 * collapses to three, two, then one per row on narrower viewports; a last row
 * with fewer items stays centred. The title's line box starts 10px under the
 * icon line and the paragraph right under the title (cap heights 21px apart).
 *
 * Optional looks (after-sales Kubota Care, Figma 5286-5002 in the box 5286-5000):
 * `--accent-teal` turns the titles turquoise; `--outlined` wraps the row in a
 * 1px black frame with 14px corners (2066 × 335 @2560: 41px above the icons, 57px
 * under the paragraphs). The frame is the row's width (1896px), narrower than the
 * design's, so it keeps a small inner gutter and gap and every title on one line.
 *
 * Kubota Insight Programme (Figma 5286-5590 / 5286-5653): `--accent-white` for a
 * row on the orange band and `--large` (155px icons, two-line titles, 24px text).
 *
 * 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)
 * paragraph matches exactly.
 */

.kbeu-icon-features {
	--kbeu-if-cols: 5;
	--kbeu-if-gap-x: clamp( 16px, 2vw, 48px );
	--kbeu-if-gap-y: clamp( 32px, 3vw, 64px );
	--kbeu-if-icon-h: clamp( 64px, 4.8vw, 122px );
	--kbeu-if-accent: var( --kbeu-color-orange );
	--kbeu-if-accent-dark: var( --kbeu-color-orange-dark );
	width: 100%;
	font-family: var( --kbeu-font-principal );
}

.kbeu-icon-features--accent-teal {
	--kbeu-if-accent: var( --kbeu-color-teal );
	--kbeu-if-accent-dark: var( --kbeu-color-teal-dark );
}

/* White titles and paragraphs, for a row on a coloured band (Figma 5286-5590, the
   Kubota Insight Programme page's orange band). */
.kbeu-icon-features--accent-white {
	--kbeu-if-accent: #fff;
	--kbeu-if-accent-dark: #fff;
	--kbeu-if-text: #fff;
}

.kbeu-icon-features--outlined {
	--kbeu-if-gap-x: 8px;
	box-sizing: border-box;
	padding: clamp( 20px, 1.56vw, 40px ) clamp( 12px, 0.63vw, 16px ) clamp( 24px, 2.19vw, 56px );
	border: 1px solid #000;
	border-radius: 14px;
}

.kbeu-icon-features[data-columns='3'] { --kbeu-if-cols: 3; }
.kbeu-icon-features[data-columns='4'] { --kbeu-if-cols: 4; }
.kbeu-icon-features[data-columns='5'] { --kbeu-if-cols: 5; }
.kbeu-icon-features[data-columns='6'] { --kbeu-if-cols: 6; }

.kbeu-icon-features .kbeu-icon-features__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var( --kbeu-if-gap-y ) var( --kbeu-if-gap-x );
	margin: 0;
	padding: 0;
	list-style: none;
}

.kbeu-icon-features .kbeu-icon-features__item {
	flex: 0 1 calc( ( 100% - ( var( --kbeu-if-cols ) - 1 ) * var( --kbeu-if-gap-x ) ) / var( --kbeu-if-cols ) );
	min-width: 0;
	margin: 0;
	padding: 0;
}

.kbeu-icon-features__item::before {
	content: none;
}

.kbeu-icon-features__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	text-align: center;
	color: inherit;
	text-decoration: none;
}

/* Common baseline for pictograms of different proportions. */
.kbeu-icon-features__icon {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 100%;
	height: var( --kbeu-if-icon-h );
	margin-bottom: clamp( 6px, 0.39vw, 10px );
}

.kbeu-icon-features .kbeu-icon-features__img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* SVGs without intrinsic size would collapse to 0 x 0 with `width: auto`. */
.kbeu-icon-features .kbeu-icon-features__img[src$='.svg'] {
	height: 100%;
}

.kbeu-icon-features .kbeu-icon-features__title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-weight: 700;
	font-size: clamp( 20px, 1.25vw, 32px );
	line-height: 1.37;
	letter-spacing: 0;
	color: var( --kbeu-if-accent );
	overflow-wrap: break-word;
}

.kbeu-icon-features .kbeu-icon-features__text {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-weight: 300;
	font-size: clamp( 15px, 0.78vw, 20px );
	line-height: 1.5;
	color: var( --kbeu-if-text, #000 );
	overflow-wrap: break-word;
}

/*
 * "Size" = large (Figma 5286-5653…5664, the Kubota Insight Programme page's three
 * steps, and the orange band's four reasons 5286-5590): a 155px icon box, titles
 * kept two lines tall so every paragraph starts on one line, 24px / Light
 * paragraphs and the design's 122px between the columns.
 */
.kbeu-icon-features--large {
	--kbeu-if-gap-x: clamp( 16px, 4.77vw, 122px );
	--kbeu-if-icon-h: clamp( 80px, 6.05vw, 155px );
}

.kbeu-icon-features--large .kbeu-icon-features__icon {
	margin-bottom: clamp( 10px, 0.82vw, 21px );
}

.kbeu-icon-features--large .kbeu-icon-features__title {
	min-height: calc( 2em * 1.37 );
}

.kbeu-icon-features--large .kbeu-icon-features__text {
	margin-top: clamp( 12px, 1.02vw, 26px );
	font-size: clamp( 15px, 0.94vw, 24px );
	line-height: 1.55;
}

/* The design's paragraph boxes (330px) in the outlined row's wider items. */
.kbeu-icon-features--outlined .kbeu-icon-features__text {
	max-width: 330px;
}

/* Clickable item: the title underlines on hover, the whole item gets the ring. */
.kbeu-icon-features__inner--link .kbeu-icon-features__title {
	transition: color 0.2s ease;
}

.kbeu-icon-features__inner--link:hover .kbeu-icon-features__title {
	color: var( --kbeu-if-accent-dark );
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.kbeu-icon-features__inner--link:focus-visible {
	outline: 2px solid var( --kbeu-if-accent );
	outline-offset: 6px;
	border-radius: 4px;
}

.kbeu-icon-features__placeholder {
	margin: 0;
	padding: 24px;
	border: 1px dashed var( --kbeu-color-border, #ccc );
	text-align: center;
	color: var( --kbeu-color-muted, #666 );
}

@media ( max-width: 1199px ) {
	.kbeu-icon-features[data-columns] {
		--kbeu-if-cols: 3;
		--kbeu-if-icon-h: 80px;
	}

	/* Four large items: two by two rather than three and a lone one. */
	.kbeu-icon-features--large[data-columns='4'] {
		--kbeu-if-cols: 2;
	}
}

@media ( max-width: 767px ) {
	.kbeu-icon-features[data-columns] {
		--kbeu-if-cols: 2;
		--kbeu-if-icon-h: 72px;
	}

	.kbeu-icon-features--large .kbeu-icon-features__title {
		min-height: 0;
	}
}

@media ( max-width: 480px ) {
	.kbeu-icon-features[data-columns] {
		--kbeu-if-cols: 1;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.kbeu-icon-features__inner--link .kbeu-icon-features__title {
		transition: none;
	}
}

/*
 * Numbered items and the side layout (the UGAP page, Figma 4386-1449 / 1456 / 1463:
 * three steps on the turquoise band). An item's `number` is a 96px / Bold figure
 * centred in a 103px square with 14px corners — the accent colour with a white
 * figure, or white with an orange figure on a coloured band (`--accent-white`).
 * `--side`: the icon or number on the left, 36px from the title (32px / Bold,
 * its capitals level with the top of the square) and the paragraph (24px / Light,
 * capitals 50px under the title's), left-aligned; 214px between the columns.
 */
.kbeu-icon-features {
	--kbeu-if-tile: clamp( 56px, 4.02vw, 103px );
}

.kbeu-icon-features--accent-white {
	--kbeu-if-tile-bg: #fff;
	--kbeu-if-tile-fg: var( --kbeu-color-orange );
}

.kbeu-icon-features .kbeu-icon-features__icon--number {
	align-items: center;
	height: auto;
}

/* Bold capitals fill the top 0.71em of a 1em line: the top padding (0.29em)
   centres them in the square. */
.kbeu-icon-features .kbeu-icon-features__number {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var( --kbeu-if-tile );
	height: var( --kbeu-if-tile );
	padding-top: 0.29em;
	border-radius: 14px;
	background: var( --kbeu-if-tile-bg, var( --kbeu-if-accent ) );
	color: var( --kbeu-if-tile-fg, #fff );
	font-weight: 700;
	font-size: calc( var( --kbeu-if-tile ) * 0.932 );
	line-height: 1;
}

.kbeu-icon-features--side {
	--kbeu-if-gap-x: clamp( 24px, 8.35vw, 214px );
}

.kbeu-icon-features--side .kbeu-icon-features__inner {
	display: grid;
	grid-template-columns: var( --kbeu-if-tile ) minmax( 0, 1fr );
	grid-template-rows: auto 1fr;
	align-items: start;
	column-gap: clamp( 14px, 1.41vw, 36px );
	text-align: left;
}

.kbeu-icon-features--side .kbeu-icon-features__icon {
	grid-row: 1 / span 2;
	grid-column: 1;
	align-items: flex-start;
	justify-content: flex-start;
	width: var( --kbeu-if-tile );
	height: auto;
	margin: 0;
}

.kbeu-icon-features--side .kbeu-icon-features__title,
.kbeu-icon-features--side .kbeu-icon-features__text {
	grid-column: 2;
}

/* The capitals level with the top of the icon: pull the line box up by its
   half-leading. */
.kbeu-icon-features--side .kbeu-icon-features__title {
	margin-top: calc( ( 1.37em - 1em ) / -2 );
}

.kbeu-icon-features--side .kbeu-icon-features__text {
	margin-top: clamp( 4px, 0.22vw, 6px );
	font-size: clamp( 15px, 0.94vw, 24px );
	font-weight: 300;
	line-height: 1.55;
}

/* Side items need room for their text: one column of centred items below desktop. */
@media ( max-width: 1199px ) {
	.kbeu-icon-features--side[data-columns] {
		--kbeu-if-cols: 1;
	}

	.kbeu-icon-features--side .kbeu-icon-features__item {
		max-width: 40rem;
	}
}
