/**
 * Kubota Europe related news (WPBakery element `vc_kbeu_related_news`).
 *
 * Figma news post, node 3727-8469 "Other Stories" (2560 artboard): the heading
 * block with its "Show all news" button at the right, then — 62px below it — a
 * row of "← Previous / Next →" text links (20px / Light, #1e1e1e, a 16px arrow,
 * 8px apart, 8 × 12px padding) and, 40px lower, three news cards 602px wide,
 * 43px apart.
 *
 * Three existing pieces do most of the work and this file only glues them:
 *
 *   - the heading is `vc_kbeu_heading`'s template (handle `kbeu-heading`, its
 *     left variant anchoring the button bottom-right);
 *   - the cards are the news grid's (`kbeu-news-grid.css`, `.kbeu-ng__*`): the
 *     root carries `kbeu-ng` so the grid's tokens and the `.kbeu-ng .kbeu-ng__btn`
 *     rule apply, and the cards ride in carousel items instead of the grid;
 *   - the paging is the shared carousel (`kbeu-carousel.css` / `.js`): this file
 *     sets the per-view tokens — three, two ≤ 1199px, one ≤ 640px, the grid's own
 *     breakpoints, kept equal to the root's `data-kbeu-bp-*` — restyles the
 *     `.kbeu-carousel__control` into the design's nav row (the engine still hides
 *     it when every card fits) and draws the text buttons, which carry the
 *     engine's `--prev` / `--next` hooks but not `.kbeu-carousel__arrow`, so the
 *     chevron look never applies.
 *
 * Sizes are `clamp()`s whose maximum is the Figma value (vw = px / 25.6). The
 * block fills the width its WPBakery row/column gives it (no breakout, no own
 * max width). Font "Inter" comes from the plugin's fonts
 * stylesheet (this handle depends on `kbeu-fonts`), via `--kbeu-font-principal`;
 * the bundled family ships the 300 / 400 / 500 / 700 weights, so the nav's Light face
 * matches exactly.
 */

.kbeu-carousel.kbeu-rn {
	--kbeu-rn-ink: var( --kbeu-color-near-black );
	--kbeu-rn-accent: var( --kbeu-color-teal );
	/* Design @2560: 62px from the heading to the nav row, 40px from it to the cards. */
	--kbeu-rn-nav-gap: clamp( 32px, 2.42vw, 62px );
	--kbeu-rn-cards-gap: clamp( 20px, 1.56vw, 40px );

	/* Three cards per view, spaced like the grid's columns. */
	--kbeu-carousel-per-view: 3;
	--kbeu-carousel-gap: var( --kbeu-ng-gap-x );

	/* 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%;
	box-sizing: border-box;
	font-family: var( --kbeu-font-principal );
}

/* The nav row: "Previous" at the left edge, "Next" at the right, replacing the
   shared control's centered chevrons + dots layout. */
.kbeu-rn .kbeu-carousel__control {
	justify-content: space-between;
	gap: 16px;
	margin-top: var( --kbeu-rn-nav-gap );
}

/* Text button, reset against the theme's button styling. */
.kbeu-rn .kbeu-rn__nav-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 8px 12px;
	border: 0;
	border-radius: 8px;
	background: none;
	box-shadow: none;
	font-family: var( --kbeu-font-principal );
	font-weight: 300;
	line-height: 1.5;
	font-size: clamp( 16px, 0.78vw, 20px );
	color: var( --kbeu-rn-ink );
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: color 0.2s ease, opacity 0.2s ease;
}

.kbeu-rn .kbeu-rn__nav-btn:hover,
.kbeu-rn .kbeu-rn__nav-btn:focus-visible {
	background: none;
	color: var( --kbeu-rn-accent );
}

.kbeu-rn .kbeu-rn__nav-btn:focus-visible {
	outline: 2px solid var( --kbeu-rn-accent );
	outline-offset: 2px;
}

/* The engine disables the button at either end (the carousel arrows' idiom). */
.kbeu-rn .kbeu-rn__nav-btn:disabled {
	opacity: 0.3;
	cursor: default;
	color: var( --kbeu-rn-ink );
}

.kbeu-rn__nav-icon {
	display: block;
	flex: none;
	width: 16px;
	height: 16px;
}

/* One arrow drawing, pointing left; mirrored for "Next". */
.kbeu-rn__nav-btn--next .kbeu-rn__nav-icon {
	transform: scaleX( -1 );
}

.kbeu-rn__viewport {
	margin-top: var( --kbeu-rn-cards-gap );
}

/* The grid card is a flex box sized by its column; inside a carousel item (a
   flex container too) it has to be told to fill it, so the "Read More" buttons
   of a row keep lining up at the bottom. */
.kbeu-rn__item > .kbeu-ng__card {
	flex: 1 1 auto;
	width: 100%;
}

/* Two per view on tablets, one on phones — the grid's breakpoints. */
@media ( max-width: 1199px ) {
	.kbeu-carousel.kbeu-rn {
		--kbeu-carousel-per-view: 2;
	}
}

@media ( max-width: 640px ) {
	.kbeu-carousel.kbeu-rn {
		--kbeu-carousel-per-view: 1;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.kbeu-rn .kbeu-rn__nav-btn {
		transition: none;
	}
}
