/*
 * RRPS Services — [rrps_services] shortcode ("What We Do").
 *
 * Glass cards on the brand gradient (the gradient is the Elementor section
 * background). Cards rest in their glass state and expand only while
 * hovered or focused. Expanded = light card, teal icon disc, "Explore more"
 * button and the short description revealed.
 */

.rrps-services {
	--rrps-sv-min-h: 337px;
	display: grid;
	grid-template-columns: repeat(var(--rrps-cols, 3), minmax(0, 1fr));
	gap: 24px;
}

.rrps-services__card {
	min-width: 0;
}

.rrps-services__link {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 24px;
	box-sizing: border-box;
	min-height: var(--rrps-sv-min-h);
	height: 100%;
	padding: 24px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: var(--rrps-radius-card, 16px);
	background: rgba(255, 255, 255, 0.15);
	color: var(--rrps-ice);
	text-decoration: none;
	overflow: hidden;
	transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, transform 0.35s ease;
}

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

/* ---- Top row: icon disc + CTA ---- */

.rrps-services__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.rrps-services__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--rrps-teal-light);
	color: var(--rrps-navy);
	transition: background-color 0.35s ease, color 0.35s ease;
}

.rrps-services__icon .rrps-icon-svg,
.rrps-services__icon .rrps-icon-img {
	width: 20px;
	height: 20px;
}

.rrps-services__cta {
	opacity: 0;
	transform: translateY(-6px);
	pointer-events: none;
	transition: opacity 0.35s ease, transform 0.35s ease;
}

/* ---- Body: title + collapsible description ---- */

.rrps-services__body {
	display: block;
}

.rrps-services .rrps-services__title {
	margin: 0;
	font-family: inherit;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--rrps-ice);
	text-wrap: balance;
	transition: color 0.35s ease;
}

.rrps-services__reveal {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	transition: grid-template-rows 0.4s ease, opacity 0.35s ease;
}

.rrps-services__reveal-inner {
	display: block;
	min-height: 0;
	overflow: hidden;
}

.rrps-services__divider {
	display: block;
	height: 1px;
	margin: 16px 0;
	background: var(--rrps-gray-200);
}

.rrps-services__excerpt {
	display: block;
	font-size: 14px;
	line-height: 1.5;
	color: var(--rrps-navy);
}

/* ---- Expanded state ----
 * Only the hovered or focused card (no default). */

.rrps-services__card:hover .rrps-services__link,
.rrps-services__card:focus-within .rrps-services__link {
	background: var(--rrps-gray-50);
	border-color: var(--rrps-gray-50);
	color: var(--rrps-navy);
}

.rrps-services__card:hover .rrps-services__icon,
.rrps-services__card:focus-within .rrps-services__icon {
	background: var(--rrps-teal-dark);
	color: #fff;
}

.rrps-services .rrps-services__card:hover .rrps-services__title,
.rrps-services .rrps-services__card:focus-within .rrps-services__title {
	color: var(--rrps-navy);
}

.rrps-services__card:hover .rrps-services__cta,
.rrps-services__card:focus-within .rrps-services__cta {
	opacity: 1;
	transform: none;
}

.rrps-services__card:hover .rrps-services__reveal,
.rrps-services__card:focus-within .rrps-services__reveal {
	grid-template-rows: 1fr;
	opacity: 1;
}

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

@media (max-width: 1024px) {
	.rrps-services {
		grid-template-columns: repeat(min(var(--rrps-cols, 3), 2), minmax(0, 1fr));
		--rrps-sv-min-h: 300px;
	}
}

@media (max-width: 767px) {
	.rrps-services {
		grid-template-columns: 1fr;
		gap: 16px;
		--rrps-sv-min-h: 0;
	}

	.rrps-services__link {
		gap: 32px;
	}

	.rrps-services__title {
		font-size: 20px;
	}
}

/* Touch / no-hover devices: nothing can be revealed by hovering, so every
   card renders expanded. */
@media (hover: none) {
	.rrps-services__link {
		background: var(--rrps-gray-50);
		border-color: var(--rrps-gray-50);
		color: var(--rrps-navy);
	}

	.rrps-services__icon {
		background: var(--rrps-teal-dark);
		color: #fff;
	}

	.rrps-services .rrps-services__title {
		color: var(--rrps-navy);
	}

	.rrps-services__cta {
		opacity: 1;
		transform: none;
	}

	.rrps-services__reveal {
		grid-template-rows: 1fr;
		opacity: 1;
	}
}

/* ---- Light variant (on a white / gray-50 sheet, e.g. industry pages) ----
 * Resting: white card, navy title, teal-light icon disc. Hover keeps the
 * same reveal but tints the card ice blue. */

.rrps-services--light .rrps-services__link {
	border-color: var(--rrps-gray-100);
	background: #fff;
	color: var(--rrps-navy);
}

.rrps-services--light .rrps-services__icon {
	background: var(--rrps-teal-light);
	color: var(--rrps-navy);
}

.rrps-services--light .rrps-services__title {
	color: var(--rrps-navy);
}

.rrps-services--light .rrps-services__card:hover .rrps-services__link,
.rrps-services--light .rrps-services__card:focus-within .rrps-services__link {
	border-color: var(--rrps-teal-light);
	background: var(--rrps-ice);
}

.rrps-services--light .rrps-services__divider {
	background: var(--rrps-gray-100);
}

@media (hover: none) {
	.rrps-services--light .rrps-services__link {
		background: #fff;
		border-color: var(--rrps-gray-100);
	}
}

@media (prefers-reduced-motion: reduce) {
	.rrps-services__link,
	.rrps-services__icon,
	.rrps-services__cta,
	.rrps-services__reveal {
		transition: none;
	}
}

/* ---- Tablet & mobile: cards always open ----
 * Below 1025px hover can't be relied on, so every card shows its open state
 * (light card, teal icon, description) and runs top to bottom: icon, title,
 * divider, description, then "Explore more" — the tablet design. */
@media (max-width: 1024px) {
	.rrps-services {
		--rrps-sv-min-h: 0;
		grid-template-columns: repeat(min(var(--rrps-cols, 3), 3), minmax(0, 1fr));
		gap: 16px;
	}

	.rrps-services__link {
		justify-content: flex-start;
		gap: 16px;
		padding: 24px 16px;
		background: var(--rrps-gray-50);
		border-color: var(--rrps-gray-50);
		color: var(--rrps-navy);
	}

	.rrps-services__top {
		display: contents;
	}

	.rrps-services__icon {
		order: 0;
		align-self: flex-start;
		background: var(--rrps-teal-dark);
		color: #fff;
	}

	.rrps-services__body {
		order: 1;
		flex: 1 1 auto;
	}

	.rrps-services .rrps-services__cta {
		order: 2;
		align-self: flex-start;
		opacity: 1;
		transform: none;
	}

	.rrps-services .rrps-services__title {
		font-size: 18px;
		color: var(--rrps-navy);
	}

	.rrps-services__reveal {
		grid-template-rows: 1fr;
		opacity: 1;
	}

	.rrps-services--light .rrps-services__icon {
		background: var(--rrps-teal-dark);
		color: #fff;
	}

	.rrps-services--light .rrps-services__link {
		background: #fff;
		border-color: var(--rrps-gray-100);
	}
}

@media (max-width: 767px) {
	.rrps-services {
		grid-template-columns: minmax(0, 1fr);
	}

	/* [rrps_services slider="mobile"]: one card at a time, swiped, with dots. */
	.rrps-services--slider {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
		margin-inline: -16px;
		padding-inline: 16px;
		scroll-padding-inline: 16px;
	}

	.rrps-services--slider::-webkit-scrollbar {
		display: none;
	}

	.rrps-services--slider .rrps-services__card {
		flex: 0 0 100%;
		scroll-snap-align: start;
	}
}
