/*
 * Industries — section title + two-column (photo + stacked rows).
 *
 * Design source: Figma file o2Fw8rOZW4xOIEcs13IWzo, Group 20 / Group 10 at top:3516.
 *   Section bg #F8F8F8, photo 1043×686 with green gradient overlay,
 *   8 rows with horizontal dividers, active row in cyan, decorative arrows below.
 */

.greengrass-industries {
	padding-block: clamp(48px, 6vw, 96px);
	background: #F8F8F8;
	font-family: 'Polin', sans-serif;
	direction: rtl; /* widget owns its direction — independent of page direction */
}

.greengrass-industries__container {
	max-width: 1820px;
	margin-inline: auto;
	padding-inline: clamp(16px, 2vw, 48px);
}

/* ── Section title — its own block above the content row, constrained to 846px so
 * it wraps at the Figma break point. Anchored to logical-start (visual-right in RTL). */
.greengrass-industries__title {
	margin: 0 0 clamp(24px, 2.4vw, 36px);
	max-width: 846px;
	font-family: 'Polin', sans-serif;
	font-size: clamp(26px, 3vw, 55px);
	font-weight: 700;
	line-height: 1.1;
	color: #2C3D41;
	text-align: start;
}

.greengrass-industries__title .accent {
	color: #00A3E9;
}

/* ── Two-column content row ─────────────────────────────── */
.greengrass-industries__content {
	display: flex;
	gap: clamp(24px, 3vw, 64px);
	align-items: stretch; /* photo fills full column height per Figma */
}

/* Source order: rows first → logical-start (visual-right in RTL).
   Photo second → logical-end (visual-left in RTL).
   Rows column matches Figma row width (584px = ~32% of 1816). Title sits in its own
   block above with its own max-width (846px), independent of this column. */
.greengrass-industries__rows {
	flex: 0 0 33%;
	max-width: 584px;
	display: flex;
	flex-direction: column;
	gap: clamp(16px, 1.6vw, 24px);
}

/* Photo column wraps the photo + decorative controls overlaid on its bottom-end corner.
 * Plain positioned block so the parent's align-items:stretch can size it to the rows-column
 * height — even when only the (absolutely-positioned) controls are inside. */
.greengrass-industries__photo-col {
	flex: 1 1 0;
	min-width: 0;
	position: relative;
	align-self: stretch;
	min-height: 200px; /* fallback when no row content is taller (e.g. editor preview) */
}

.greengrass-industries__photo {
	position: absolute;
	inset: 0;
	border-radius: 15px;
	overflow: hidden;
	background: #d9d9d9;
}

/* Each industry row's photo is a stacked slide inside .photo. Only .is-active is visible;
 * the rest are kept in the DOM (preloaded) so swapping is instant with no network delay. */
.greengrass-industries__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease;
}

.greengrass-industries__slide.is-active {
	opacity: 1;
	visibility: visible;
}

.greengrass-industries__slide img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.greengrass-industries__photo::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	/* Transparent for the first ~half of the gradient, then ramps to the green tint
	 * only at the bottom-end corner — matches the Figma stops (0 at 52.37%, 0.25 at 99.06%). */
	background: linear-gradient(169.98deg, rgba(98, 156, 85, 0) 52.37%, var(--gg-photo-overlay, rgba(98, 156, 85, 0.25)) 99.06%);
}

/* ── Industry row list ──────────────────────────────────── */
.greengrass-industries__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.greengrass-industries__row {
	padding-block: clamp(10px, 1.2vw, 18px);
	text-align: start;
	cursor: pointer;
	user-select: none;
	outline: none;
}

.greengrass-industries__row:focus-visible {
	box-shadow: 0 0 0 2px #00A3E9;
	border-radius: 4px;
}

.greengrass-industries__row + .greengrass-industries__row {
	border-block-start: 1px solid rgba(50, 43, 38, 0.31);
}

.greengrass-industries__row-title {
	margin: 0 0 6px;
	font-family: 'Polin', sans-serif;
	font-size: clamp(18px, 2vw, 30px);
	font-weight: 700;
	line-height: 1.05;
	color: #2C3D41;
	transition: color 0.15s ease;
}

.greengrass-industries__row.is-active .greengrass-industries__row-title {
	color: #00A3E9;
}

.greengrass-industries__row-body {
	margin: 0;
	font-family: 'Polin', sans-serif;
	font-size: clamp(14px, 1.3vw, 20px);
	font-weight: 400;
	line-height: 1.2;
	color: #2C3D41;
}

/* ── Controls — absolutely anchored to the bottom-start (visual-right in RTL) of the photo column ─── */
.greengrass-industries__controls {
	position: absolute;
	inset-block-end: clamp(16px, 1.5vw, 24px);
	inset-inline-start: clamp(16px, 1.5vw, 24px);
	display: flex;
	gap: 12px;
	z-index: 2;
}

/* `!important` on background/border/color so the theme's generic button:hover
 * (which is bleeding maroon through on Yuval's setup) can't override us. */
.greengrass-industries__arrow,
.greengrass-industries__arrow:link,
.greengrass-industries__arrow:visited {
	display: flex;
	align-items: center;
	justify-content: center;
	width: clamp(48px, 4.5vw, 70px);
	height: clamp(48px, 4.5vw, 70px);
	box-sizing: border-box;
	background-color: rgba(248, 255, 253, 0.69) !important;
	color: #2C3D41 !important;
	border: 1px solid #2C3D41 !important;
	border-radius: 15px;
	padding: 0;
	font-family: 'Polin', sans-serif;
	font-size: clamp(22px, 2.4vw, 32px);
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.greengrass-industries__arrow:hover,
.greengrass-industries__arrow:focus {
	background-color: #ffffff !important;
	color: #2C3D41 !important;
	border-color: #2C3D41 !important;
	transform: translateY(-1px);
}

/* Responsive — stack columns */
@media (max-width: 960px) {
	.greengrass-industries__content {
		flex-direction: column;
		gap: clamp(24px, 3vw, 40px);
	}
	.greengrass-industries__rows {
		flex: none;
		max-width: none;
		width: 100%;
	}
	.greengrass-industries__photo-col {
		flex: none;
		width: 100%;
		aspect-ratio: 1043 / 686;
	}
	.greengrass-industries__photo {
		flex: 1 1 auto;
		width: 100%;
	}
}
