/*
 * RRPS Industries — [rrps_industries] shortcode.
 *
 * Two columns: image panel (left) + hover list (right). The active row is
 * tinted light blue and its image is shown in the panel; other images are
 * stacked underneath at opacity 0 so switching is an instant cross-fade.
 */

.rrps-industries {
	display: grid;
	grid-template-columns: minmax(0, 524fr) minmax(0, 610fr);
	gap: 24px clamp(24px, 7vw, 106px);
	align-items: end;
}

/* ---- Image panel ---- */

.rrps-industries__media {
	position: relative;
	aspect-ratio: 524 / 364;
	border-radius: var(--rrps-radius-card, 16px);
	background: var(--rrps-ice);
	overflow: hidden;
}

.rrps-industries__image {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	transition: opacity 0.45s ease;
}

.rrps-industries__image.is-active {
	opacity: 1;
	z-index: 1;
}

/* Two classes so it outranks Elementor's `.elementor img { height: auto }`,
   which would otherwise let the photo size to its own aspect ratio. */
.rrps-industries .rrps-industries__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rrps-industries .rrps-industries__img--placeholder {
	background: var(--rrps-gradient);
}

.rrps-industries__badge {
	position: absolute;
	top: 24px;
	left: 24px;
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	min-height: 32px;
	padding: 4px 20px;
	border: 1px solid rgba(186, 194, 202, 0.28);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.rrps-industries__bar {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 12px;
	background: var(--rrps-gradient-bar);
	z-index: 2;
}

/* ---- List ---- */

.rrps-industries__list {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rrps-industries__item {
	margin: 0;
	padding: 6px 0;
	border-top: 1px solid var(--rrps-gray-100);
}

.rrps-industries__item:first-child {
	padding-top: 0;
	border-top: 0;
}

.rrps-industries .rrps-industries__link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 8px;
	border-radius: 12px;
	color: var(--rrps-gray-500);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.rrps-industries .rrps-industries__link:hover,
.rrps-industries .rrps-industries__link:focus-visible,
.rrps-industries .rrps-industries__item.is-active .rrps-industries__link {
	background: var(--rrps-ice);
	color: var(--rrps-blue);
	text-decoration: none;
}

.rrps-industries__link:focus-visible {
	outline: 2px solid var(--rrps-teal-light);
	outline-offset: 2px;
}

.rrps-industries__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	padding: 8px;
	box-sizing: border-box;
	border-radius: 6px;
}

.rrps-industries__icon-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: 28px;
	object-fit: contain;
}

.rrps-industries__name {
	flex: 1 1 auto;
	min-width: 0;
}

/*
 * Trailing arrow. The Figma shows it on the active row only, so it is revealed
 * by the same selectors that already tint the row. It stays in the layout at
 * all times and only fades, so rows do not shift width as the pointer moves
 * down the list.
 */
.rrps-industries__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.rrps-industries__arrow svg {
	display: block;
	width: 100%;
	height: 100%;
}

.rrps-industries .rrps-industries__link:hover .rrps-industries__arrow,
.rrps-industries .rrps-industries__link:focus-visible .rrps-industries__arrow,
.rrps-industries .rrps-industries__item.is-active .rrps-industries__arrow {
	opacity: 1;
}

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

@media (max-width: 1024px) {
	/* Tablet: image and list stay side by side, a little tighter. */
	.rrps-industries {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 24px 32px;
	}

	.rrps-industries .rrps-industries__link {
		gap: 8px;
		padding: 4px 8px;
		font-size: 14px;
	}

	.rrps-industries__icon {
		width: 36px;
		height: 36px;
		padding: 6px;
	}

	.rrps-industries .rrps-industries__icon-img {
		height: 24px;
	}

	.rrps-industries__arrow {
		width: 24px;
		height: 24px;
	}

	.rrps-industries__badge {
		top: 16px;
		left: 16px;
		font-size: 14px;
	}
}

@media (max-width: 767px) {
	/* Phone: the list first, then the selected industry's image. */
	.rrps-industries {
		grid-template-columns: minmax(0, 1fr);
		align-items: start;
		gap: 32px;
	}

	/* No hover on phones, so the image panel loses its point: hide it and
	   let the list rows link straight through to each industry page. */
	.rrps-industries__media {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rrps-industries__image,
	.rrps-industries__link,
	.rrps-industries__arrow {
		transition: none;
	}
}
