/**
 * Hero 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, nodes 5006:6662 (slider) + 5006:6637 (counter).
 * Metrics below are the @1920 values from the mockup, scaled down mobile-first.
 */

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

	/* Margin left beside the centred container; the decorative dots live in it. */
	--sws-hero-gutter: calc((100% - var(--sws-hero-container)) / 2);

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

	/* The soft gradients bleed past the container; never let them scroll the page. */
	overflow: hidden;
	padding-bottom: 2.5rem;
}

.sws-hero__container {
	box-sizing: border-box;
	max-width: var(--sws-hero-container);
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/*
 * Gradient stage. Its bottom padding carries the card overlap, so the gradient
 * reaches down to the middle of the card row while nothing above the cards moves.
 */
.sws-hero__stage {
	position: relative;
	padding-block: 2.5rem calc(4.5rem + var(--sws-hero-card-overlap));
	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%);
}

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

.sws-hero__heading {
	margin: 0 0 1rem;
	font-family: var(--sws-hero-display);
	font-size: clamp(2rem, 1.15rem + 3.4vw, 3.5rem);
	font-weight: 700;
	line-height: 1.18;
	color: var(--sws-hero-title);
	/* Evens out the line lengths instead of leaving one orphaned word. */
	text-wrap: balance;
}

.sws-hero__text {
	max-width: 41rem;
	margin: 0 0 1.75rem;
	font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.5rem);
	font-weight: 500;
	line-height: 1.42;
	color: var(--sws-hero-title);
}

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

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

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

.sws-hero__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-hero__btn--primary {
	background: var(--sws-hero-main);
	color: var(--sws-hero-white);
}

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

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

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

.sws-hero__btn:focus-visible {
	outline: 2px solid var(--sws-hero-main);
	outline-offset: 3px;
}

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

.sws-hero__figure {
	position: relative;
	margin-top: 2.5rem;
}

/*
 * Layout lives on the wrapper: ratio and the organic blob silhouette from the
 * mockup (node 5006:6683), applied as a mask so any uploaded photo takes that
 * shape. Ratio matches the blob's own 605x488 box so mask and image align.
 */
.sws-hero__media {
	/* Sits above the decorative blobs painted by the ::before/::after of the figure. */
	position: relative;
	z-index: 1;
	aspect-ratio: 605 / 488;
	background: rgb(28 28 37 / 4%);
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 605 488'%3E%3Cpath d='M0.440839 318.49C2.99492 411.009 17.9055 436.278 63.2285 470.604C116.239 510.752 198.382 471.646 267.555 450.808C336.728 429.971 416.543 478.939 517.641 413.301C618.74 347.663 630.446 111.157 561.273 33.0166C492.101 -45.1239 350.562 39.2679 288.839 44.4773C227.115 49.6866 159.006 10.0954 84.5125 33.0166C10.0187 55.9379 -2.75176 202.842 0.440839 318.49Z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 605 488'%3E%3Cpath d='M0.440839 318.49C2.99492 411.009 17.9055 436.278 63.2285 470.604C116.239 510.752 198.382 471.646 267.555 450.808C336.728 429.971 416.543 478.939 517.641 413.301C618.74 347.663 630.446 111.157 561.273 33.0166C492.101 -45.1239 350.562 39.2679 288.839 44.4773C227.115 49.6866 159.006 10.0954 84.5125 33.0166C10.0187 55.9379 -2.75176 202.842 0.440839 318.49Z'/%3E%3C/svg%3E");
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
}

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

.sws-hero--no-media .sws-hero__content {
	max-width: 48rem;
}

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

/*
 * The row straddles the edge of the gradient: 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 gradient.
 */
.sws-hero__container--cards {
	position: relative;
	margin-top: calc(var(--sws-hero-card-overlap) * -1);
}

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

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

.sws-hero__card-icon {
	flex: 0 0 auto;
	display: block;
	width: 3.375rem; /* 54px */
	height: 3.375rem;
}

/* Descendant selector: SVG uploads carry no intrinsic size, so normalise here. */
.sws-hero__card-icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

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

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

.sws-hero__card-value {
	font-family: var(--sws-hero-display);
	font-size: 2.5rem; /* 40px */
	font-weight: 700;
	line-height: 1;
	color: var(--sws-hero-title);
}

.sws-hero__card-unit {
	font-family: var(--sws-hero-display);
	font-size: 1.125rem; /* 18px */
	font-weight: 500;
	line-height: 1;
	color: var(--sws-hero-title);
}

.sws-hero__card-text {
	display: block;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.25;
	color: var(--sws-hero-body);
}

/* Small phones landscape and up: buttons stop filling the row.
--------------------------------------------- */
@media (min-width: 480px) {

	.sws-hero__btn {
		width: auto;
	}
}

/* Tablets: cards pair up.
--------------------------------------------- */
@media (min-width: 600px) {

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

/* Desktop (matches WordPress's mobile/desktop breakpoint).
--------------------------------------------- */
@media (min-width: 782px) {

	.sws-hero {
		padding-bottom: 4rem;
	}

	.sws-hero__stage {
		padding-block: 4rem calc(5rem + var(--sws-hero-card-overlap));
	}

	.sws-hero__container--stage {
		display: grid;
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
		align-items: center;
		gap: clamp(2rem, 4vw, 4.125rem);
	}

	.sws-hero--no-media .sws-hero__container--stage {
		grid-template-columns: minmax(0, 1fr);
	}

	.sws-hero__figure {
		margin-top: 0;
	}

	/*
	 * Two decorative shapes from the mockup, both behind the image. Neither
	 * repeats the image silhouette: the soft one (node 5006:6681) is offset up
	 * and right, the blue contour (node 5006:6682) is a taller blob that sweeps
	 * out to the right and dips below. Percentages are the Figma offsets divided
	 * by the 605x488 image box, which is exactly the figure's own box.
	 */
	.sws-hero__figure::before,
	.sws-hero__figure::after {
		content: "";
		position: absolute;
		background-repeat: no-repeat;
		background-size: 100% 100%;
		pointer-events: none;
	}

	/* Soft pale-blue backdrop blob, fading out towards the bottom. */
	.sws-hero__figure::before {
		top: -4.92%;
		left: 7.27%;
		width: 103.8%;
		height: 101.23%;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 628 494' fill='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='314' y1='0' x2='314' y2='494' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23F4F7FF'/%3E%3Cstop offset='1' stop-color='%23F4F7FF' stop-opacity='0.19'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M16.2099 242.66C-9.6282 330.192 -3.64012 358.341 27.5029 404.056C63.9284 457.525 151.234 445.355 221.07 446.449C290.907 447.543 349.248 517.281 462.034 485.883C574.82 454.484 657.607 236.164 617.92 142.241C578.234 48.3173 422.618 85.2396 364.379 71.7106C306.14 58.1817 255.688 0.730322 180.333 0.00294907C104.977 -0.724423 48.5074 133.244 16.2099 242.66Z' fill='url(%23g)'/%3E%3C/svg%3E");
	}

	/* Thin blue contour. Its box carries the 1px stroke bleed on every side. */
	.sws-hero__figure::after {
		top: -7.79%;
		left: 13.27%;
		width: 93.67%;
		height: 116.03%;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 566.702 566.215' fill='none'%3E%3Cpath d='M46.1003 441.68C76.838 525.025 97.8842 543.508 148.786 561.064C208.323 581.598 269.406 521.302 324.565 481.522C379.724 441.742 465.832 462.221 535.625 372.094C605.418 281.967 543.074 63.4186 457.463 13.2115C371.852 -36.9957 271.834 82.3626 218.498 105.69C165.161 129.018 92.3571 113.538 33.1027 156.815C-26.1517 200.092 7.6782 337.499 46.1003 441.68Z' stroke='%233E66F3' stroke-width='2'/%3E%3C/svg%3E");
	}

	.sws-hero__cards {
		gap: 1.25rem;
	}
}

/* Wide desktop: the full four-across card row of the mockup.
--------------------------------------------- */
@media (min-width: 1200px) {

	.sws-hero__stage {
		padding-block: 6rem calc(6.5rem + var(--sws-hero-card-overlap));
	}

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

	.sws-hero__heading {
		margin-bottom: 1.5rem;
	}

	.sws-hero__text {
		margin-bottom: 2.5rem;
	}
}

/*
 * Decorative dots from the mockup (nodes 5006:6669 and 5006:6671). They sit in
 * the margin beside the 1380px container, never near the viewport edge, so both
 * are placed as a fraction of that margin rather than of the full width; the
 * fractions are the Figma offsets over the mockup's own 270px margin. Below this
 * width the margin is too narrow to hold them and they are dropped.
--------------------------------------------- */
@media (min-width: 1600px) {

	.sws-hero__stage::before,
	.sws-hero__stage::after {
		content: "";
		position: absolute;
		border-radius: 50%;
		pointer-events: none;
	}

	.sws-hero__stage::before {
		top: 25%;
		left: calc(var(--sws-hero-gutter) * 0.656); /* 177px of 270px */
		width: 1.4375rem; /* 23px */
		height: 1.4375rem;
		background: var(--sws-hero-main);
	}

	/* Offset by the overlap so the card row keeps its distance from the circle. */
	.sws-hero__stage::after {
		bottom: calc(14% + var(--sws-hero-card-overlap));
		left: calc(var(--sws-hero-gutter) * 0.426); /* 115px of 270px */
		width: 3.0625rem; /* 49px */
		height: 3.0625rem;
		background: rgb(62 102 243 / 18%);
	}
}

/* Hero without the card row
 *
 * The section's bottom padding and the stage's reserved overlap exist only so the
 * card row can straddle the bottom edge of the gradient. With no cards the
 * section padding sits outside the stage and the page background shows through it
 * as a bare strip under the tint — that is what appeared on the services archive.
 *
 * Placed last on purpose: every breakpoint above restates these two paddings at
 * the same specificity, so source order is what makes the modifier win. Keep this
 * block at the end of the file.
--------------------------------------------- */

.sws-hero--no-cards {
	padding-bottom: 0;
}

.sws-hero--no-cards .sws-hero__stage {
	padding-bottom: 4rem;
}

@media (min-width: 1200px) {

	.sws-hero--no-cards .sws-hero__stage {
		padding-bottom: 6rem;
	}
}
