/**
 * Service Intro block styles (block-scoped; enqueued only when the block is present).
 * BEM only, prefixed with the block slug. Do not touch the theme's global style.css.
 *
 * Design reference: Techivo template, node 5006:6662 (slider) for the two-column stage
 * and node 5006:4894 (counter) for the parameter row — the same pair the hero block is
 * built from. Two differences from hero, both deliberate: the photo is a plain rounded
 * rectangle rather than hero's organic blob mask (that silhouette is the home page's
 * signature and loses its force if every service page repeats it), and the heading runs
 * on the H2 scale because a service page already prints its h1 in the breadcrumb block.
 *
 * The `--plain` / `--gradient` modifiers paint the stage only; the root stays transparent
 * either way, so the card row always straddles the boundary between the tinted stage and
 * the white page below.
 */

.sws-service-intro {
	--sin-main: var(--wp--preset--color--main, #3e66f3);
	--sin-title: var(--wp--preset--color--title, #1c1c25);
	--sin-body: var(--wp--preset--color--body, #797e88);
	--sin-white: var(--wp--preset--color--white, #fff);
	--sin-card-line: #ebecf5;
	--sin-surface: #f6f7fa;
	--sin-display: var(--wp--preset--font-family--geologica, "Geologica", inherit);
	--sin-container: 1380px;

	/* Card row height from the mockup. Half of it is how far the row rides up. */
	--sin-card-height: 8.4375rem; /* 135px */
	--sin-card-overlap: calc(var(--sin-card-height) / 2);

	container: sws-service-intro / inline-size;

	/* The soft gradients bleed past the inner width; never let them scroll the page. */
	overflow: hidden;
}

/*
 * Stage. Its bottom padding carries the card overlap, so the tint reaches down to the
 * middle of the card row while nothing above the cards moves.
 */
.sws-service-intro__stage {
	padding-block: 3rem calc(4.5rem + var(--sin-card-overlap));
}

.sws-service-intro--plain .sws-service-intro__stage {
	background: var(--sin-surface);
}

.sws-service-intro--gradient .sws-service-intro__stage {
	background-image:
		radial-gradient(24rem 18rem at 8% 14%, rgb(62 102 243 / 10%), transparent 70%),
		radial-gradient(20rem 16rem at 88% 6%, rgb(126 102 243 / 8%), transparent 70%),
		/* Stops short of transparent: the mockup ends the tint on a hard edge that the
		   card row crosses, which a fade to 0% would erase. */
		linear-gradient(180deg, rgb(35 53 215 / 11%) 0%, rgb(63 102 239 / 5%) 100%);
}

.sws-service-intro__inner {
	box-sizing: border-box;
	max-width: var(--sin-container);
	margin-inline: auto;
	padding-inline: clamp(1rem, 4cqw, 2.5rem);
}

/* Content column
--------------------------------------------- */

.sws-service-intro__eyebrow {
	margin: 0 0 1rem;
	font-family: var(--sin-display);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--sin-main);
}

.sws-service-intro__heading {
	margin: 0 0 1rem;
	font-family: var(--sin-display);
	font-size: clamp(1.75rem, 1.1rem + 2.6cqw, 2.75rem);
	font-weight: 700;
	line-height: 1.2;
	color: var(--sin-title);
	/* Evens out the line lengths instead of leaving one orphaned word. */
	text-wrap: balance;
}

.sws-service-intro__text {
	max-width: 38rem;
	margin: 0 0 1.75rem;
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--sin-body);
}

/* Descendant selector: the markup inside comes from the WYSIWYG field. */
.sws-service-intro__text p {
	margin: 0 0 0.75em;
}

.sws-service-intro__text p:last-child {
	margin-bottom: 0;
}

.sws-service-intro__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.sws-service-intro__btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 3.4375rem; /* 55px */
	padding: 0.75rem 2.0625rem;
	border-radius: 100px;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.sws-service-intro__btn--primary {
	background: var(--sin-main);
	color: var(--sin-white);
}

.sws-service-intro__btn--primary:hover,
.sws-service-intro__btn--primary:focus {
	background: #2f55dd;
	color: var(--sin-white);
}

.sws-service-intro__btn--secondary {
	background: rgb(62 102 243 / 10%);
	color: var(--sin-main);
}

.sws-service-intro__btn--secondary:hover,
.sws-service-intro__btn--secondary:focus {
	background: rgb(62 102 243 / 18%);
	color: var(--sin-main);
}

.sws-service-intro__btn:focus-visible {
	outline: 2px solid var(--sin-main);
	outline-offset: 3px;
}

/* Media column
--------------------------------------------- */

.sws-service-intro__figure {
	margin: 2.5rem 0 0;
}

.sws-service-intro__media {
	/* 16:9 matches the service photo series; reserving the box guards against CLS. */
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 30px;
	background: rgb(28 28 37 / 4%);
}

/* Descendant selector: the tag may become <picture><img> after optimisation. */
.sws-service-intro__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sws-service-intro--no-media .sws-service-intro__content {
	max-width: 48rem;
}

/* Card row
--------------------------------------------- */

/*
 * The row straddles the edge of the stage: it is pulled up by half a card, which the
 * stage added to its own bottom padding. Positioning it puts the row above the stage in
 * paint order, so the white cards mask the tint.
 */
.sws-service-intro__inner--cards {
	position: relative;
	margin-top: calc(var(--sin-card-overlap) * -1);
	padding-bottom: 2.5rem;
}

.sws-service-intro__cards {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sws-service-intro__card {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	box-sizing: border-box;
	min-height: var(--sin-card-height);
	padding: 1.5rem;
	border: 1px solid var(--sin-card-line);
	border-radius: 20px;
	background: var(--sin-white);
}

/* The icon SVGs already carry their own disc, so this only sizes them. */
.sws-service-intro__card-media {
	flex: 0 0 auto;
	display: block;
	width: 3.375rem; /* 54px */
	height: 3.375rem;
}

.sws-service-intro__card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.sws-service-intro__card-body {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	min-width: 0;
}

.sws-service-intro__card-metric {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.375rem;
}

.sws-service-intro__card-value {
	font-family: var(--sin-display);
	font-size: 2.5rem; /* 40px */
	font-weight: 700;
	line-height: 1;
	color: var(--sin-main);
}

.sws-service-intro__card-unit {
	font-family: var(--sin-display);
	font-size: 1.125rem; /* 18px */
	font-weight: 500;
	line-height: 1.1;
	color: var(--sin-title);
}

.sws-service-intro__card-text {
	display: block;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.3;
	color: var(--sin-body);
}

/* Small phones landscape and up: buttons stop filling the row.
--------------------------------------------- */

@container sws-service-intro (min-width: 480px) {

	.sws-service-intro__btn {
		width: auto;
	}
}

@container sws-service-intro (min-width: 600px) {

	.sws-service-intro__cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@container sws-service-intro (min-width: 782px) {

	.sws-service-intro__stage {
		padding-block: 4rem calc(5rem + var(--sin-card-overlap));
	}

	.sws-service-intro__inner--cards {
		padding-bottom: 4rem;
	}
}

/*
 * The stage splits later than the rest of the page. At 782px the text column is only
 * ~350px wide, too narrow for a heading that has already grown to ~38px — the same
 * reason mission and why-choose-us hold their split until 900px.
 */
@container sws-service-intro (min-width: 900px) {

	.sws-service-intro__stage .sws-service-intro__inner {
		display: grid;
		align-items: center;
		gap: 2.5rem;
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	}

	.sws-service-intro__figure {
		margin-top: 0;
	}
}

@container sws-service-intro (min-width: 1200px) {

	.sws-service-intro__stage .sws-service-intro__inner {
		gap: 3.75rem;
	}

	.sws-service-intro__cards {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}
