/**
 * Kubota Europe icon cards (WPBakery element `vc_kbeu_icon_cards`).
 *
 * Based on the Figma design 4226-2890 (Service Excellence page, cards 4226-4243 /
 * 4251 / 4259): white cards with a 1px orange outline and 14px corners, three per
 * row on desktop (615px wide, 25px apart on the 2560 artboard). Each card holds an
 * 86px icon (the orange check-circle by default), 26px below it a bold title
 * (32px / Bold, line-height 1.37) and a light paragraph (24px / Light, line-height
 * 1.55, #1d1d1b). Sizes are `clamp()`s whose maximum is the Figma value. Cards of a
 * row share one height (grid stretch); two per row at 1199px and below, one at
 * 767px and below.
 *
 * The `--filled` modifier is the Find a dealer design ("Details" group 5168-2235,
 * cards 611 x 431 on the 2560 artboard): light grey (#f6f6f6) cards without a
 * border, text 57px from the left edge, and a foot row 44px below the paragraph
 * holding a 344px (~71%) 1px #9e9e9f rule on the left and the icon (58-96px, ~70px
 * from the right edge, centred slightly above the rule) on the right. The content
 * block sits vertically centred in the card, which is at least the design's height
 * (431px @2560, scaled by vw) and otherwise grows with the row.
 *
 * The `--filled-top` modifier (campaign page, Figma 4978-5117…5134) is the filled
 * cards' colour with the outlined layout (icon on top), see its block below; the
 * `--white-top` modifier (lead generation page, Figma 5037-5069) is that layout on
 * white cards for a grey band. A card with a link ends with a button (see "Optional
 * button" below).
 *
 * Font family "Inter" is provided by the plugin's fonts stylesheet
 * (this handle depends on `kbeu-fonts`), referenced via `--kbeu-font-principal`.
 */

.kbeu-icon-cards {
	--kbeu-ic-cols: 3;
	--kbeu-ic-gap: clamp( 16px, 1vw, 25px );
	--kbeu-ic-pad-y: clamp( 28px, 2.35vw, 60px );
	--kbeu-ic-pad-x: clamp( 20px, 1.7vw, 43px );
	--kbeu-ic-icon: clamp( 56px, 3.36vw, 86px );
	--kbeu-ic-border: var( --kbeu-color-orange );
	--kbeu-ic-radius: 14px;
	width: 100%;
	font-family: var( --kbeu-font-principal );
}

.kbeu-icon-cards .kbeu-icon-cards__list {
	display: grid;
	grid-template-columns: repeat( var( --kbeu-ic-cols ), minmax( 0, 1fr ) );
	gap: var( --kbeu-ic-gap );
	margin: 0;
	padding: 0;
	list-style: none;
}

.kbeu-icon-cards .kbeu-icon-cards__card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	margin: 0;
	padding: var( --kbeu-ic-pad-y ) var( --kbeu-ic-pad-x );
	background: #fff;
	border: 1px solid var( --kbeu-ic-border );
	border-radius: var( --kbeu-ic-radius );
}

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

.kbeu-icon-cards__icon {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	height: var( --kbeu-ic-icon );
	margin-bottom: clamp( 16px, 1vw, 26px );
}

.kbeu-icon-cards .kbeu-icon-cards__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-cards .kbeu-icon-cards__img[src$='.svg'] {
	height: 100%;
}

.kbeu-icon-cards .kbeu-icon-cards__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: #000;
	overflow-wrap: break-word;
}

.kbeu-icon-cards .kbeu-icon-cards__text {
	margin: clamp( 10px, 1.2vw, 31px ) 0 0;
	padding: 0;
	font-family: inherit;
	font-weight: 300;
	font-size: clamp( 16px, 0.94vw, 24px );
	line-height: 1.55;
	color: #1d1d1b;
	overflow-wrap: break-word;
}

/* Filled style (Find a dealer "Details" cards). */

.kbeu-icon-cards--filled {
	--kbeu-ic-pad-y: clamp( 32px, 2.7vw, 70px );
	--kbeu-ic-pad-x: clamp( 20px, 2.23vw, 57px );
	--kbeu-ic-pad-r: clamp( 20px, 2.66vw, 68px );
	--kbeu-ic-icon: clamp( 48px, 3.75vw, 96px );
	--kbeu-ic-rule: #9e9e9f;
	/* The design's card height (431px @2560); cards of a row still share one height. */
	--kbeu-ic-min-h: min( 16.84vw, 431px );
}

.kbeu-icon-cards--filled .kbeu-icon-cards__card {
	justify-content: center;
	min-height: var( --kbeu-ic-min-h );
	padding-right: var( --kbeu-ic-pad-r );
	background: var( --kbeu-color-surface, #f6f6f6 );
	border: 0;
}

.kbeu-icon-cards--filled .kbeu-icon-cards__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: clamp( 12px, 1vw, 26px );
	width: 100%;
	margin-top: clamp( 20px, 1.72vw, 44px );
}

.kbeu-icon-cards--filled .kbeu-icon-cards__rule {
	display: block;
	flex: 0 1 71%;
	max-width: 344px;
	height: 0;
	border-top: 1px solid var( --kbeu-ic-rule );
	/* The design's icon is centred slightly above the rule. */
	transform: translateY( clamp( 0px, 0.6vw, 15px ) );
}

.kbeu-icon-cards--filled .kbeu-icon-cards__icon {
	flex: 0 0 auto;
	justify-content: flex-end;
	margin: 0 0 0 auto;
}

/*
 * Filled, icon on top (`--filled-top`, Figma campaign page 4978-5117…5134): the
 * filled style's grey (#f6f6f6) borderless cards, 622 × 447 @2560 and 14px apart,
 * laid out like the outlined ones — a 61px icon 58px from the top and 66px from the
 * left, the title's line box 29px under it, the paragraph's cap height 59px under
 * the title's. Content from the top; the card is at least the design's height.
 */
.kbeu-icon-cards--filled-top {
	--kbeu-ic-gap: clamp( 10px, 0.56vw, 14px );
	--kbeu-ic-pad-y: clamp( 28px, 2.27vw, 58px );
	--kbeu-ic-pad-x: clamp( 20px, 2.58vw, 66px );
	--kbeu-ic-icon: clamp( 40px, 2.4vw, 61px );
	--kbeu-ic-min-h: min( 17.46vw, 447px );
}

.kbeu-icon-cards--filled-top .kbeu-icon-cards__card {
	min-height: var( --kbeu-ic-min-h );
	background: var( --kbeu-color-surface, #f6f6f6 );
	border: 0;
}

.kbeu-icon-cards--filled-top .kbeu-icon-cards__icon {
	margin-bottom: clamp( 16px, 1.15vw, 29px );
}

.kbeu-icon-cards--filled-top .kbeu-icon-cards__text {
	margin-top: clamp( 8px, 0.55vw, 14px );
}

/*
 * White, icon on top (`--white-top`, Figma lead generation page 5037-5069, the
 * prize cards on the grey game band): white borderless cards, 616 × 366 @2560 and
 * 24px apart, 15px corners and a faint 0 8px 8px / 3% shadow, everything 28px from
 * the edges — a 61px icon, the title's cap height 30px under it (32px / Bold,
 * #1d1d1b), the paragraph's 30px under the title's baseline, the paragraph 446 /
 * 560 of the card's inner width. Content from the top; the card is at least the
 * design's height.
 */
.kbeu-icon-cards--white-top {
	--kbeu-ic-gap: clamp( 12px, 0.94vw, 24px );
	--kbeu-ic-pad-y: clamp( 20px, 1.09vw, 28px );
	--kbeu-ic-pad-x: clamp( 20px, 1.09vw, 28px );
	--kbeu-ic-icon: clamp( 40px, 2.4vw, 61px );
	--kbeu-ic-radius: 15px;
	--kbeu-ic-min-h: min( 14.3vw, 366px );
}

.kbeu-icon-cards--white-top .kbeu-icon-cards__card {
	min-height: var( --kbeu-ic-min-h );
	background: #fff;
	border: 0;
	box-shadow: 0 8px 8px rgba( 0, 0, 0, 0.03 );
}

.kbeu-icon-cards--white-top .kbeu-icon-cards__icon {
	margin-bottom: clamp( 14px, 0.94vw, 24px );
}

.kbeu-icon-cards--white-top .kbeu-icon-cards__title {
	color: #1d1d1b;
}

.kbeu-icon-cards--white-top .kbeu-icon-cards__text {
	max-width: 79.6%;
	margin-top: clamp( 6px, 0.31vw, 8px );
	color: #000;
}

/*
 * Filled, icon in the corner (`--filled-corner`, genuine parts page, Figma
 * 5309-1712…1728): the filled style's grey borderless cards, 636 × 378 @2560 and
 * ~21px apart, with the texts from the top — the title's line box 64px under the
 * card's top and 62px from the left, the paragraph 14px under it and at most 456px
 * wide — and the 84px icon (a white disc with a turquoise line pictogram) alone in
 * the bottom right corner, 75px from the right and 53px from the bottom: the filled
 * foot row without its rule, pushed down by an auto margin.
 */
.kbeu-icon-cards--filled-corner {
	--kbeu-ic-gap: clamp( 10px, 0.82vw, 21px );
	--kbeu-ic-pad-y: clamp( 28px, 2.5vw, 64px );
	--kbeu-ic-pad-x: clamp( 20px, 2.42vw, 62px );
	--kbeu-ic-icon: clamp( 48px, 3.28vw, 84px );
	--kbeu-ic-min-h: min( 14.77vw, 378px );
}

.kbeu-icon-cards--filled-corner .kbeu-icon-cards__card {
	min-height: var( --kbeu-ic-min-h );
	padding-right: clamp( 20px, 2.93vw, 75px );
	padding-bottom: clamp( 20px, 2.07vw, 53px );
	background: var( --kbeu-color-surface, #f6f6f6 );
	border: 0;
}

.kbeu-icon-cards--filled-corner .kbeu-icon-cards__text {
	max-width: 456px;
	margin-top: clamp( 8px, 0.55vw, 14px );
}

.kbeu-icon-cards--filled-corner .kbeu-icon-cards__foot {
	display: flex;
	justify-content: flex-end;
	width: 100%;
	margin-top: auto;
	/* The design leaves only ~7px between a three-line paragraph and the icon. */
	padding-top: clamp( 4px, 0.27vw, 7px );
}

.kbeu-icon-cards--filled-corner .kbeu-icon-cards__icon {
	margin: 0;
}

/*
 * Optional button (a card with a link): the shared `.kbeu-btn--primary` as the engines
 * downloads page draws it (Figma 5286-7784): 335 × 54 @2560, 20px / Roman label, 26px
 * at the sides, 28px under the paragraph's line box. It sits at the bottom of the card
 * (`margin-top: auto`), so the buttons of a row line up whatever the text lengths.
 * In the `filled-top` style such a card keeps the design's 97px under the button.
 */
.kbeu-icon-cards .kbeu-icon-cards__actions {
	/* The card's width, so the button's `min-width: min( 100%, … )` resolves. */
	align-self: stretch;
	margin-top: auto;
	padding-top: clamp( 16px, 1.09vw, 28px );
}

.kbeu-icon-cards .kbeu-icon-cards__btn {
	min-width: min( 100%, clamp( 200px, 13.09vw, 335px ) );
	padding: clamp( 8px, 0.39vw, 10px ) clamp( 18px, 1.02vw, 26px );
	font-family: inherit;
	font-size: clamp( 16px, 0.78vw, 20px );
	font-weight: 400;
	line-height: 1.5;
}

.kbeu-icon-cards--filled-top .kbeu-icon-cards__card--has-button {
	padding-bottom: clamp( 28px, 3.79vw, 97px );
}

/* "Cards per row" = two (`data-columns="2"`): for a column narrower than the row. */
.kbeu-icon-cards[data-columns='2'] {
	--kbeu-ic-cols: 2;
}

.kbeu-icon-cards__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-cards {
		--kbeu-ic-cols: 2;
	}
}

@media ( max-width: 767px ) {
	.kbeu-icon-cards {
		--kbeu-ic-cols: 1;
		--kbeu-ic-icon: 56px;
	}

	.kbeu-icon-cards[data-columns] {
		--kbeu-ic-cols: 1;
	}

	/* One card per row: the content sets the height. */
	.kbeu-icon-cards--filled,
	.kbeu-icon-cards--filled-top,
	.kbeu-icon-cards--white-top,
	.kbeu-icon-cards--filled-corner {
		--kbeu-ic-min-h: 0px;
	}

	.kbeu-icon-cards--filled-top,
	.kbeu-icon-cards--white-top,
	.kbeu-icon-cards--filled-corner {
		--kbeu-ic-icon: 48px;
	}

	.kbeu-icon-cards--white-top .kbeu-icon-cards__text {
		max-width: none;
	}
}
