/**
 * Kubota Europe product Kubota Farm Solutions (WPBakery element
 * `vc_kbeu_product_farm_solutions`).
 *
 * Based on the Figma product page (rows: nodes 3721-5020 … 3721-5059; wheel:
 * node 3721-5028; chevron: node 3721-5025). Two 50/50 columns: on the left an
 * accordion of native <details> rows — a 79px round icon (raster glyph inside a
 * 1.4px black-25% ring), the label (32px / Bold, #161618,
 * -0.64px tracking) and a 24px teal chevron flush right; the open row shows its
 * text (24px / Light, line-height 1.61, black) 34px under the icon. Rows are
 * 157px apart (79 row + 78 gap), an open panel also leaves 78px before the next
 * row; no divider lines. On the right the 734px wheel, flush right, its top 82px
 * below the first row's. The design's numbers are the `clamp()` maxima (the
 * artboard is 2560px wide). Below 860px the wheel stacks under the accordion.
 * The section heading above the columns (node 3721-5016) is the section-heading
 * element's own markup, printed by this template; only its distance to the first
 * row (183px) lives here.
 *
 * Font family "Inter" is provided by the plugin's fonts stylesheet
 * (this handle depends on `kbeu-fonts`) and referenced via `--kbeu-font-principal`.
 * The bundled family ships 300 / 400 / 500 / 700 weights.
 */

.kbeu-product-farm {
	--kbeu-farm-teal: var( --kbeu-color-teal );
	--kbeu-farm-ink: #161618;
	--kbeu-farm-ring: rgba( 0, 0, 0, 0.25 );
	--kbeu-farm-gap: clamp( 40px, 8.4vw, 215px );
	--kbeu-farm-row-gap: clamp( 28px, 3.05vw, 78px );
	--kbeu-farm-icon: clamp( 56px, 3.1vw, 79px );
	width: 100%;
}

/* Heading → first accordion row: 183px in the design. */
.kbeu-product-farm__heading {
	margin-bottom: clamp( 40px, 7.15vw, 183px );
}

.kbeu-product-farm__inner {
	display: flex;
	align-items: flex-start;
	gap: var( --kbeu-farm-gap );
}

/* Both columns take half of the row (Figma: 943 | 946 of 1893). */
.kbeu-farm__list,
.kbeu-farm__graphic {
	flex: 1 1 0;
	min-width: 0;
}

/* --- Accordion rows ------------------------------------------------------- */

.kbeu-farm__item + .kbeu-farm__item {
	margin-top: var( --kbeu-farm-row-gap );
}

.kbeu-farm__summary {
	display: flex;
	align-items: center;
	gap: clamp( 16px, 1vw, 25px );
	cursor: pointer;
	list-style: none;
	color: var( --kbeu-farm-ink );
	font-family: var( --kbeu-font-principal );
}

/* No native disclosure marker (WebKit needs the pseudo-element). */
.kbeu-farm__summary::-webkit-details-marker {
	display: none;
}

.kbeu-farm__summary::marker {
	content: '';
}

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

.kbeu-farm__summary:focus-visible {
	outline: 2px solid var( --kbeu-farm-teal );
	outline-offset: 4px;
	border-radius: 4px;
}

/* Icon: the ring is drawn here; the file holds the glyph only. */
.kbeu-farm__icon {
	flex: none;
	box-sizing: border-box;
	width: var( --kbeu-farm-icon );
	height: var( --kbeu-farm-icon );
	border: 1.4px solid var( --kbeu-farm-ring );
	border-radius: 50%;
	overflow: hidden;
	background: #fff;
}

/* Block-scoped so the theme's generic img sizing cannot win. */
.kbeu-farm__icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.kbeu-farm__label {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 700;
	font-size: clamp( 22px, 1.25vw, 32px );
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.kbeu-farm__summary:hover .kbeu-farm__label {
	color: var( --kbeu-farm-teal );
}

/* Chevron: the glyph points right; open = down, closed = up (Figma nodes
   3721-5025 / 3721-5035). Swap the two rotations to invert the convention. */
.kbeu-farm__chevron {
	flex: none;
	width: 24px;
	height: 24px;
	color: var( --kbeu-farm-teal );
	transform: rotate( 90deg );
	transition: transform 0.2s ease;
}

.kbeu-farm__item:not([open]) .kbeu-farm__chevron {
	transform: rotate( -90deg );
}

/* --- Open panel ------------------------------------------------------------ */

/* 34px below the icon; the text stops ~60px short of the column (882 of 943). */
.kbeu-farm__panel {
	padding: clamp( 16px, 1.33vw, 34px ) clamp( 0px, 2.4vw, 61px ) 0 0;
	font-family: var( --kbeu-font-principal );
	font-weight: 300;
	font-size: clamp( 17px, 0.94vw, 24px );
	line-height: 1.61;
	color: #000;
}

.kbeu-farm__panel p {
	margin: 0 0 1em;
	text-align: left;
}

.kbeu-farm__panel p:last-child {
	margin-bottom: 0;
}

.kbeu-farm__panel ul,
.kbeu-farm__panel ol {
	margin: 0 0 1em 1.2em;
	padding: 0;
}

/* A gentle fade-in when a row opens (opacity only; fine under reduced motion). */
.kbeu-farm__item[open] > .kbeu-farm__panel {
	animation: kbeu-farm-fade 0.25s ease;
}

@keyframes kbeu-farm-fade {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* --- Wheel diagram --------------------------------------------------------- */

.kbeu-farm__graphic {
	display: flex;
	justify-content: flex-end;
	padding-top: clamp( 0px, 3.2vw, 82px );
}

.kbeu-farm__diagram {
	display: block;
	width: min( 100%, 734px );
	height: auto;
}

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

@media ( max-width: 860px ) {
	.kbeu-product-farm__inner {
		flex-direction: column;
	}

	.kbeu-farm__list,
	.kbeu-farm__graphic {
		flex: none;
		width: 100%;
	}

	.kbeu-farm__graphic {
		justify-content: center;
		padding-top: 0;
	}

	.kbeu-farm__diagram {
		width: min( 100%, 480px );
	}
}

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