/**
 * Homepage — Case study (sezione 4).
 * Asset generati da case-study-new.svg via build-from-new.mjs
 *
 * @package GDS-Fullcreative
 */

.gds-hcs {
	--gds-hcs-logo-scale: 0.82;
	background: #ffffff;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.gds-hcs__wrap {
	width: min(100%, 1412px);
	margin-inline: auto;
	padding: clamp(48px, 6vw, 88px) clamp(24px, 5vw, 90px) clamp(56px, 7vw, 80px);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.gds-hcs__intro {
	width: 100%;
	max-width: 1396px;
	margin: 0 auto clamp(48px, 8vw, 142px);
	text-align: center;
}

.gds-hcs__title {
	margin: 0 0 16px;
	color: #2a355f;
	font-family: var(--font-primary, "Helvetica Neue", Helvetica, Arial, sans-serif);
	/* 35px ancorato a 1440 (come hero e about us). */
	font-size: clamp(28px, 2.43vw, 35px);
	font-weight: 300;
	line-height: 1.26;
}

.gds-hcs__lead {
	margin: 0;
	max-width: 1396px;
	color: #2A2F3A;
	font-family: var(--font-primary, "Helvetica Neue", Helvetica, Arial, sans-serif);
	font-size: clamp(16px, 1.15vw, 22px);
	font-weight: 300;
	line-height: 1.5;
	letter-spacing: 0;
}

.gds-hcs__stage {
	position: relative;
	width: 100%;
	max-width: 1412px;
	margin: 0 auto clamp(48px, 8vw, 130px);
}

.gds-hcs__network,
.gds-hcs__stage .gds-svg-inline-wrap {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: fill;
	opacity: 0;
	transition: opacity 0.35s ease;
}

.gds-hcs__stage .gds-svg-inline-wrap svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

#gds-hcs-line,
[id^="gds-hcs-line-"] {
	fill: none;
	stroke: #1f232c;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.gds-hcs__stage.gds-hcs-anim-complete #gds-hcs-line,
.gds-hcs__stage.gds-hcs-anim-complete [id^="gds-hcs-line-"] {
	stroke-dasharray: 5 5;
	stroke-dashoffset: 0;
}

[id^="gds-hcs-dot-"] {
	fill: #fff;
	stroke: #1f232c;
	stroke-width: 2;
	opacity: 0;
	transform-box: fill-box;
	transform-origin: center;
}

html.gds-anim-js .gds-hcs__stage:not(.gds-hcs-anim-complete) [id^="gds-hcs-dot-"] {
	opacity: 0;
}

.gds-hcs__stage.gds-hcs-anim-complete [id^="gds-hcs-dot-"] {
	opacity: 1;
}

html.gds-anim-js .gds-hcs:not(.gds-anim-is-active) .gds-hcs__network,
html.gds-anim-js .gds-hcs:not(.gds-anim-is-active) .gds-svg-inline-wrap {
	opacity: 0;
}

.gds-hcs__network.gds-svg-ready,
.gds-hcs__stage .gds-svg-inline-wrap.gds-svg-ready,
.gds-hcs.gds-anim-is-active .gds-hcs__network,
.gds-hcs.gds-anim-is-active .gds-svg-inline-wrap {
	opacity: 1;
}

.gds-hcs__logos {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.gds-hcs__logo {
	position: absolute;
	left: var(--logo-x, 0);
	top: var(--logo-y, 0);
	width: var(--logo-w, 10%);
	height: var(--logo-h, 10%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.gds-hcs__logo img {
	width: calc(100% * var(--gds-hcs-logo-scale, 1));
	height: calc(100% * var(--gds-hcs-logo-scale, 1));
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center;
}

.gds-hcs__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 187px;
	min-height: 49px;
	padding: 0 20px;
	border: 1.5px solid var(--gds-color-red, #c72a29);
	border-radius: 999px;
	background: transparent;
	color: var(--gds-color-red, #c72a29);
	font-family: var(--font-primary, "Helvetica Neue", Helvetica, Arial, sans-serif);
	font-size: var(--gds-home-btn-fs, 16px);
	font-weight: 300;
	line-height: var(--gds-home-btn-lh, 18px);
	letter-spacing: 0;
	text-decoration: none;
	text-transform: uppercase;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.gds-hcs__cta:hover,
.gds-hcs__cta:focus-visible {
	color: #ffffff;
	background-color: #c72a29;
	border-color: #c72a29;
}

.gds-hcs__stage--mobile {
	display: none;
}

@media (max-width: 1280px) {
	.gds-hcs {
		/* Slot compatti + loghi leggermente più grandi nel vano del tracciato. */
		--gds-hcs-logo-scale: 0.78;
		--gds-hcs-mobile-slot-scale: 0.88;
		/* Metà del restringimento slot, per centrare ( (1 - scale) / 2 ). */
		--gds-hcs-mobile-slot-inset: 0.06;
		--gds-hcs-mobile-stage-height: 1120;
		min-height: auto;
	}

	.gds-hcs__stage--desktop {
		display: none;
	}

	.gds-hcs__wrap {
		padding-block: 40px 48px;
	}

	.gds-hcs__intro {
		margin-bottom: 32px;
		text-align: left;
	}

	.gds-hcs__title {
		font-size: clamp(24px, 6vw, 30px);
		line-height: 1.25;
	}

	.gds-hcs__lead {
		font-size: 16px;
		line-height: 1.45;
	}

	.gds-hcs__stage--mobile {
		display: block;
		width: 100%;
		max-width: min(100%, 357px);
		margin-inline: auto;
		margin-bottom: 32px;
		/* Design 357×1398: comprime ~20% l’altezza (inline aspect-ratio dal PHP). */
		aspect-ratio: 357 / var(--gds-hcs-mobile-stage-height, 1120) !important;
	}

	.gds-hcs__stage--mobile .gds-hcs__logos {
		position: absolute;
		inset: 0;
		display: block;
		margin-top: 0;
	}

	/*
	 * --logo-x/y/w/h dal PHP includono già il suffisso % (es. 21.906%).
	 * Non moltiplicare per 1%: invalida calc() e accorpa tutti i loghi in alto.
	 */
	.gds-hcs__stage--mobile .gds-hcs__logo {
		left: calc(var(--logo-x) + var(--logo-w) * var(--gds-hcs-mobile-slot-inset, 0.06));
		top: calc(var(--logo-y) + var(--logo-h) * var(--gds-hcs-mobile-slot-inset, 0.06));
		width: calc(var(--logo-w) * var(--gds-hcs-mobile-slot-scale, 0.88));
		height: calc(var(--logo-h) * var(--gds-hcs-mobile-slot-scale, 0.88));
	}
}

@media (max-width: 768px) {
	.gds-hcs__stage {
		margin-bottom: 32px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gds-hcs__network,
	.gds-hcs__stage .gds-svg-inline-wrap {
		opacity: 1 !important;
		transition: none;
	}

	.gds-hcs [id^="gds-hcs-dot-"] {
		opacity: 1 !important;
		transform: none !important;
	}
}
