/**
 * Kubota Europe offer cards (WPBakery element `vc_kbeu_offer_cards`).
 *
 * Figma "OK Promotions_2 blocks" (node 4280-1434): a white bar of sector tabs —
 * the division categories bar's design, whose stylesheet (`kbeu-division-filter`)
 * this one depends on and only adapts to `<button>` tabs — then two columns of
 * offer cards 143px apart (102px between rows: the design's 116 runs from the
 * validity note's text box, which is shorter than its line): a rounded 874 × 554 photo, the
 * model (bold 32), the financing type (light 20), the offer headline (bold 32), a
 * paragraph (light 24), two full-width buttons (52px outlined, 54px orange, 17px
 * apart) and a validity note (light 20); a centred orange "More offers" closes the
 * grid. The buttons and notes of a row line up (the card is a flex column whose
 * footer is pushed to the bottom).
 *
 * Sizes are `clamp()`s whose maximum is the Figma value (the artboard is 2560px
 * wide: vw = px / 25.6). The element fills the width its WPBakery row gives it.
 */

.kbeu-oc {
	--kbeu-oc-gap-x: clamp( 24px, 5.59vw, 143px );
	--kbeu-oc-gap-y: clamp( 44px, 3.98vw, 102px );
	--kbeu-oc-title-fs: clamp( 22px, 1.25vw, 32px );
	--kbeu-oc-text-fs: clamp( 16px, 0.94vw, 24px );
	--kbeu-oc-small-fs: clamp( 15px, 0.78vw, 20px );
	--kbeu-oc-btn-fs: clamp( 16px, 0.78vw, 20px );
	--kbeu-oc-btn-py: clamp( 8px, 0.39vw, 10px );
	/* Orange buttons: the shared `.kbeu-btn--primary` reads its fill from these. */
	--kbeu-btn-primary-bg: var( --kbeu-color-orange );
	--kbeu-btn-primary-bg-hover: var( --kbeu-color-orange-dark );

	width: 100%;
	font-family: var( --kbeu-font-principal );
	color: #000;
}

/* --- Sector tabs (the division bar's markup with buttons) ----------------------- */

/* Design: the cards start 77px below the 103px bar. */
.kbeu-oc .kbeu-oc__bar {
	margin-bottom: clamp( 32px, 3.01vw, 77px );
}

/* The bar's tabs are links; here they are buttons: drop the browser's and the
   theme's button look, keep the bar's padding, type and underline. */
.kbeu-oc .kbeu-oc__tab {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding-left: 0;
	padding-right: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	font-family: inherit;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
}

.kbeu-oc .kbeu-oc__tab:focus {
	outline: none;
}

.kbeu-oc .kbeu-oc__tab:focus-visible {
	outline: 2px solid var( --kbeu-color-teal );
	outline-offset: 2px;
}

/* --- Grid ------------------------------------------------------------------------ */

.kbeu-oc__grid {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: var( --kbeu-oc-gap-y ) var( --kbeu-oc-gap-x );
}

.kbeu-oc__card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.kbeu-oc__card:focus {
	outline: none;
}

.kbeu-oc__card[hidden],
.kbeu-oc__empty[hidden],
.kbeu-oc__more[hidden] {
	display: none;
}

/* Cards revealed by a tab or by "More offers" fade in. */
.kbeu-oc__card.is-revealed {
	animation: kbeu-oc-in 0.35s ease both;
}

@keyframes kbeu-oc-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* --- Presets: three columns, the image's own proportions ----------------------------- */

/* Figma 4280-4846 ("OK Promotions_3 blocks"): three 584px columns 71px apart, 97px
   between rows (111 from the note's text box, as above). Same card typography. */
.kbeu-oc[data-columns='3'] {
	--kbeu-oc-gap-x: clamp( 20px, 2.78vw, 71px );
	--kbeu-oc-gap-y: clamp( 40px, 3.79vw, 97px );
}

.kbeu-oc[data-columns='3'] .kbeu-oc__grid {
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
}

/* An offer banner carries text: drawn whole at its own proportions (the img's
   width / height attributes reserve its box before it loads). */
.kbeu-oc[data-image-ratio='auto'] .kbeu-oc__media {
	aspect-ratio: auto;
}

.kbeu-oc[data-image-ratio='auto'] .kbeu-oc__img {
	height: auto;
}

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

/* Design: 874 × 554, 15px radius. */
.kbeu-oc__media {
	aspect-ratio: 874.42 / 553.62;
	overflow: hidden;
	border-radius: 15px;
	background: var( --kbeu-color-surface-alt );
}

.kbeu-oc .kbeu-oc__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 0;
}

.kbeu-oc__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
}

/* Design: the model's capitals 67px below the photo. Impreza pads every heading
   that is not a first child: reset. */
.kbeu-oc .kbeu-oc__title {
	margin: clamp( 24px, 2.3vw, 59px ) 0 0;
	padding: 0;
	font-family: inherit;
	font-size: var( --kbeu-oc-title-fs );
	font-weight: 700;
	line-height: 1.37;
	letter-spacing: 0;
	color: #000;
}

.kbeu-oc .kbeu-oc__subtitle {
	margin: 0;
	font-size: var( --kbeu-oc-small-fs );
	font-weight: 300;
	line-height: 1.56;
}

.kbeu-oc .kbeu-oc__headline {
	margin: clamp( 10px, 0.78vw, 20px ) 0 0;
	font-size: var( --kbeu-oc-title-fs );
	font-weight: 700;
	line-height: 1.37;
}

.kbeu-oc .kbeu-oc__text {
	margin: clamp( 12px, 0.94vw, 24px ) 0 0;
	font-size: var( --kbeu-oc-text-fs );
	font-weight: 300;
	line-height: 1.55;
}

/* A model code in the text (U17-5) never breaks at its hyphen (set by the template). */
.kbeu-oc__code {
	white-space: nowrap;
}

/* Buttons + note at the bottom of the card, so they line up along a row. */
.kbeu-oc__footer {
	margin-top: auto;
	padding-top: clamp( 28px, 2.7vw, 69px );
}

.kbeu-oc__actions {
	display: flex;
	flex-direction: column;
	gap: clamp( 10px, 0.66vw, 17px );
}

/* Design: full width, 20px Roman labels; 52px outlined (1px), 54px orange (the
   shared 2px border). */
.kbeu-oc .kbeu-oc__btn {
	box-sizing: border-box;
	width: 100%;
	padding: var( --kbeu-oc-btn-py ) 26px;
	font-family: inherit;
	font-size: var( --kbeu-oc-btn-fs );
	font-weight: 400;
	line-height: 1.5;
	white-space: normal;
}

.kbeu-oc .kbeu-oc__btn--outline {
	border-width: 1px;
	border-color: #000;
	color: #000;
}

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

.kbeu-oc .kbeu-oc__note {
	margin: clamp( 20px, 1.6vw, 41px ) 0 0;
	font-size: var( --kbeu-oc-small-fs );
	font-weight: 300;
	line-height: 1.56;
}

.kbeu-oc .kbeu-oc__note-link {
	/* Impreza's `.no-touch a:hover` reads this variable (see kbeu-buttons.css). */
	--color-content-link-hover: var( --kbeu-color-teal );
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.kbeu-oc .kbeu-oc__note-link:hover,
.kbeu-oc .kbeu-oc__note-link:focus-visible {
	color: var( --kbeu-color-teal );
}

/* --- Empty sector, "More offers" ------------------------------------------------- */

.kbeu-oc .kbeu-oc__empty {
	margin: 0;
	padding: clamp( 24px, 2.5vw, 64px ) 0;
	font-size: var( --kbeu-oc-text-fs );
	font-weight: 300;
	line-height: 1.55;
	text-align: center;
}

/* Design: centred, 143px below the last row, 212 × 54. */
.kbeu-oc__more {
	margin-top: clamp( 40px, 5.59vw, 143px );
	text-align: center;
}

.kbeu-oc .kbeu-oc__more-btn {
	padding: var( --kbeu-oc-btn-py ) clamp( 26px, 2.12vw, 54px );
	font-family: inherit;
	font-size: var( --kbeu-oc-btn-fs );
	font-weight: 400;
	line-height: 1.5;
	cursor: pointer;
}

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

@media ( max-width: 1199px ) {
	.kbeu-oc[data-columns='3'] .kbeu-oc__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 860px ) {
	.kbeu-oc__grid,
	.kbeu-oc[data-columns='3'] .kbeu-oc__grid {
		grid-template-columns: minmax( 0, 1fr );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.kbeu-oc__card.is-revealed {
		animation: none;
	}

	.kbeu-oc .kbeu-oc__note-link {
		transition: none;
	}
}
