/**
 * Services overview — 19-services-overview-desktop.pdf
 * Hero: CMS box_background + caption (styled like About / Services-inside).
 * Cards: 3-column image grid; white Outfit ExtraBold labels bottom-left.
 */

/* --------------------------------------------------------------------------
   Hero — full-bleed photo + bottom title bar (CMS .box_background)
   -------------------------------------------------------------------------- */

#services .regular_box_title {
	padding: 0;
	margin: 0;
}

#services .regular_box_title .box_background {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	min-height: clamp(420px, 46.8vw, 898px);
	padding-top: 0 !important; /* beat inline aspect padding from pages.php */
	background-color: #1a1a1a;
	background-repeat: no-repeat !important;
	/* Keep the CMS url for ::before inherit; paint the image on the layer so it can slide in. */
	background-size: 0 0 !important;
	background-position: center 32% !important;
	overflow: hidden;
}

#services .regular_box_title .box_background::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background-image: inherit;
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center 32%;
	pointer-events: none;
}

#services .regular_box_title .box_background > .container {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: clamp(28px, 3.2vw, 44px) var(--spiro-gutter, 50px) clamp(24px, 2.6vw, 36px);
	box-sizing: border-box;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%);
}

#services .regular_box_title .box_caption {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	width: 100%;
	max-width: var(--spiro-content-max, 1630px);
	margin: 0 auto;
}

#services .regular_box_title .box_caption > h1,
#services .regular_box_title .box_caption > h2 {
	margin: 0;
	flex: 1 1 auto;
	min-width: 0;
}

#services .regular_box_title .box_caption h1 p,
#services .regular_box_title .box_caption h2 p {
	margin: 0;
	text-align: left !important;
	font-family: var(--spiro-font-family, "Outfit", Arial, sans-serif);
	font-size: var(--spiro-type-hero);
	font-weight: var(--spiro-font-weight-extrabold, 800);
	line-height: 1.05;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--spiro-color-blue, #007ec1);
}

#services span.spiro-services-hero__swiss.swiss_quality--on-dark,
#services span.spiro-services-hero__swiss.swiss_quality--on-dark strong {
	color: #fff;
}

#services span.spiro-services-hero__swiss {
	flex-shrink: 0;
	margin-bottom: 0.55em;
	font-size: 16px;
}

/* Drop legacy narrow preset on this page */
#services .max-width-780 .container {
	max-width: var(--spiro-content-max, 1630px);
}

.spiro-services-overview {
	--spiro-svc-ratio: 488 / 380;
	--spiro-svc-ratio-pct: calc(380 / 488 * 100%);
	--spiro-svc-radius: 20px;
	--spiro-svc-pad-x: clamp(24px, 2vw, 36px);
	--spiro-svc-pad-y: clamp(22px, 1.8vw, 32px);
	--spiro-svc-bg-fallback: #c8cdd1;
	padding-top: clamp(48px, 5vw, 80px);
	padding-bottom: clamp(64px, 7vw, 120px);
}

.spiro-services-overview__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(16px, 2.2vw, 40px);
	align-items: start;
}

.spiro-services-overview__card {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: var(--spiro-svc-ratio);
	border-radius: var(--spiro-svc-radius);
	background-color: var(--spiro-svc-bg-fallback);
	overflow: hidden;
	isolation: isolate;
	text-decoration: none;
	color: #fff;
}

.spiro-services-overview__card::before {
	content: "";
	display: block;
	width: 100%;
	padding-top: var(--spiro-svc-ratio-pct);
}

@supports (aspect-ratio: 488 / 380) {
	.spiro-services-overview__card::before {
		content: none;
		display: none;
		padding-top: 0;
	}
}

.spiro-services-overview__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	background-color: var(--spiro-svc-bg-fallback);
	background-image: var(--spiro-svc-bg-image, none);
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center;
	transform: scale(1);
	transition: transform var(--spiro-hover-duration) var(--spiro-hover-ease);
	pointer-events: none;
}

.spiro-services-overview__card:hover .spiro-services-overview__bg,
.spiro-services-overview__card:focus-visible .spiro-services-overview__bg {
	transform: scale(var(--spiro-hover-zoom));
}

.spiro-services-overview__shade {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	height: 55%;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.55) 0%,
		rgba(0, 0, 0, 0.22) 45%,
		rgba(0, 0, 0, 0) 100%
	);
	pointer-events: none;
}

.spiro-services-overview__title {
	position: absolute;
	left: var(--spiro-svc-pad-x);
	right: var(--spiro-svc-pad-x);
	bottom: var(--spiro-svc-pad-y);
	z-index: 2;
	margin: 0;
	font-family: var(--spiro-font-family, "Outfit", Arial, sans-serif);
	font-size: clamp(18px, 1.5vw, 28px);
	font-weight: var(--spiro-font-weight-extrabold, 800);
	line-height: 1.15;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

@media (max-width: 992px) {
	.spiro-services-overview__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.spiro-services-overview__grid {
		grid-template-columns: 1fr;
		max-width: 520px;
		margin-left: auto;
		margin-right: auto;
	}

	#services .regular_box_title .box_caption {
		flex-direction: column;
		align-items: flex-start;
	}

	#services .regular_box_title .box_caption h1 p,
	#services .regular_box_title .box_caption h2 p {
		font-size: clamp(40px, 12vw, 64px);
	}

	#services .regular_box_title .box_background {
		min-height: 360px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.spiro-services-overview__bg {
		transition: none !important;
	}

	.spiro-services-overview__card:hover .spiro-services-overview__bg,
	.spiro-services-overview__card:focus-visible .spiro-services-overview__bg {
		transform: scale(1);
	}
}

/* Design: Swiss Quality sits top-right on the hero photo from 1100 down. */
@media (max-width: 1100px) {
	#services .regular_box_title .box_background > .container {
		top: 0;
		bottom: 0;
		display: flex;
		align-items: flex-end;
		padding-top: clamp(16px, 2.2vw, 24px);
		background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 180px);
	}

	#services .regular_box_title .box_caption {
		position: static;
		display: block;
		flex-direction: unset;
		align-items: unset;
	}

	#services span.spiro-services-hero__swiss {
		position: absolute;
		top: clamp(16px, 2.2vw, 24px);
		right: var(--spiro-gutter, 50px);
		margin: 0;
		z-index: 3;
	}
}
