/*
 * Componente: hero.
 *
 * Due impianti: "full" con media di sfondo a tutta larghezza, "split" con
 * l'immagine su metà schermo (la home dei mockup).
 */

.sh-hero {
	position: relative;
	display: flex;
	align-items: center;
	overflow: hidden;
	background-color: var(--sh-bg);
	color: var(--sh-ink);
}

/*
 * La copertina lascia sempre intravedere la sezione successiva: 17rem sono
 * l'header più l'inizio della banda sotto. Al 78% dello schermo, su un
 * portatile le card della home restavano tutte sotto la piega.
 */
.sh-hero--h-home    { min-height: clamp(26rem, calc(100vh - 17rem), 40rem); }
.sh-hero--h-interna { min-height: clamp(20rem, 46vh, 28rem); }
.sh-hero--h-auto    { min-height: 0; }

@supports (height: 100svh) {
	.sh-hero--h-home { min-height: clamp(26rem, calc(100svh - 17rem), 40rem); }
}

.sh-hero__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	padding-block: var(--sh-space-xl);
}

.sh-hero__content > * + * {
	margin-block-start: var(--sh-space-sm);
}

.sh-hero__title {
	margin-block: 0;
}

.sh-hero__title .sh-title__line {
	display: block;
}

.sh-hero__subtitle {
	margin-block: var(--sh-space-md) 0;
	font-weight: 600;
}

.sh-hero__text {
	max-width: 46ch;
	/* Pieno come nei mockup: bianco sugli hero scuri, nero sull'hero chiaro della home. */
	color: var(--sh-ink);
}

.sh-hero__price {
	margin-block: var(--sh-space-md) 0;
	color: var(--sh-red-text);
	font-family: var(--sh-font-display);
	font-weight: 700;
}

.sh-hero__price small {
	color: var(--sh-muted);
	font-size: 0.5em;
	font-weight: 400;
}

/* ==== Sfondo a tutta larghezza ==== */

.sh-hero__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.sh-hero__bg img,
.sh-hero__video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	/*
	 * Nei mockup il soggetto sta a destra, dove il testo non c'è; il taglio
	 * verticale privilegia l'alto, dove stanno cielo e claim.
	 */
	object-position: 70% 30%;
}

.sh-hero__video {
	position: absolute;
	inset: 0;
}

.sh-hero__overlay {
	position: absolute;
	inset: 0;
	/*
	 * Nero pieno sotto il testo, poi la foto: come nei mockup degli hero scuri.
	 * L'intensità del widget regola l'opacità dell'intera velatura.
	 */
	background: linear-gradient(90deg, var(--sh-c-black) 0%, var(--sh-c-black) 22%, rgb(0 0 0 / 0.55) 45%, rgb(0 0 0 / 0.1) 75%);
}

/*
 * Sotto il breakpoint tablet il video non viene nemmeno caricato (lo decide
 * hero.js): resta il poster. Un video di sfondo su mobile affonda l'LCP.
 */
@media (max-width: 767px) {
	.sh-hero__video {
		display: none;
	}

	.sh-hero__overlay {
		background: linear-gradient(180deg, rgb(0 0 0 / 0.55) 0%, rgb(0 0 0 / 0.75) 100%);
	}

	/*
	 * Copertina chiara con foto: su mobile il testo finisce sopra il soggetto.
	 * Un velo del colore di fondo lo tiene leggibile anche con l'intensità a 0.
	 */
	.sh-scheme--light.sh-hero--full .sh-hero__bg::after {
		content: "";
		position: absolute;
		inset: 0;
		background: color-mix(in srgb, var(--sh-bg) 72%, transparent);
	}
}

/* ==== Impianto diviso: testo a sinistra, immagine a destra ==== */

.sh-hero--split .sh-hero__media {
	margin-block-start: var(--sh-space-lg);
}

.sh-hero--split .sh-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (min-width: 1024px) {
	.sh-hero--split .sh-hero__inner {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: var(--sh-space-xl);
		align-items: center;
	}

	.sh-hero--split .sh-hero__media {
		margin-block-start: 0;
		align-self: stretch;
		min-height: 100%;
	}
}

/* ==== Titolo inclinato, sottotitolo spaziato, claim ==== */

/* Corsivo sintetizzato dal browser: il margine tiene dentro l'ultima lettera inclinata. */
.sh-hero--italic .sh-hero__title {
	padding-inline-end: 0.12em;
	font-style: italic;
}

/*
 * Occhiello del titolo extra: a 13px spariva accanto a righe alte 120px. Nel
 * mockup Utilitarie è un'etichetta rossa nel font dei titoli, in scala.
 */
.sh-hero--xl .sh-eyebrow,
.sh-hero--italic .sh-eyebrow {
	margin-block-end: var(--sh-space-xs);
	font-family: var(--sh-font-display);
	font-size: clamp(1.125rem, 1.8vw, 1.5rem);
	font-weight: 600;
	letter-spacing: 0.04em;
}

/* Negli hero inclinati (Contatti, News, Corsi) l'occhiello s'inclina con il titolo. */
.sh-hero--italic .sh-eyebrow {
	font-style: italic;
	letter-spacing: 0.02em;
}

.sh-hero__subtitle--spaziato {
	font-family: var(--sh-font-body);
	font-size: 1.0625rem;
	font-weight: 500;
	letter-spacing: 0.3em;
	line-height: 1.6;
	text-transform: uppercase;
}

.sh-hero__claim-wrap {
	position: absolute;
	inset-block-start: 0;
	inset-inline: 0;
	z-index: 1;
	display: none;
	justify-content: flex-end;
	padding-block-start: var(--sh-space-xl);
	pointer-events: none;
}

/* Sotto i 1024px starebbe addosso al titolo: il claim è un di più, non un contenuto. */
@media (min-width: 1024px) {
	.sh-hero__claim-wrap {
		display: flex;
	}
}

.sh-hero__claim {
	margin: 0;
	/* Sta sulla foto: l'ombra lo tiene leggibile anche su un cielo chiaro. */
	text-shadow: 0 1px 10px rgb(0 0 0 / 0.65);
	font-family: var(--sh-font-body);
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.28em;
	line-height: 1.6;
	text-transform: uppercase;
}

/* Claim in basso a destra (copertina dei corsi): stessa colonna, altro bordo. */
.sh-hero--claim-bottom .sh-hero__claim-wrap {
	inset-block: auto 0;
	padding-block: 0 var(--sh-space-xl);
}

/* ==== Riga sotto il testo (Contatti) ==== */

.sh-hero__tagline {
	font-family: var(--sh-font-body);
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	line-height: 1.6;
	text-transform: uppercase;
}

/* Filetto rosso corto sopra la riga, come nel mockup. */
.sh-hero__tagline::before {
	display: block;
	width: 2rem;
	height: 2px;
	margin-block-end: var(--sh-space-sm);
	background-color: var(--sh-red);
	content: "";
}

/* ==== Voci con icona (copertina Utilitarie) ==== */

/*
 * Fila di voci brevi fra testo e bottoni. Ogni voce è larga quanto la sua
 * etichetta, non una colonna fissa: così la prima parte dal filo del testo e
 * le etichette corte non restano sospese in mezzo a uno spazio vuoto.
 */
.sh-hero__features {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--sh-space-md) var(--sh-space-lg);
	margin: var(--sh-space-lg) 0 0;
	padding: 0;
	list-style: none;
}

.sh-hero__feature {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--sh-space-xs);
	min-width: 4.5rem;
	text-align: center;
}

/* Icona a filo come nel mockup: bianca sugli hero scuri, nera su quello chiaro. */
.sh-hero__feature-icon {
	flex: none;
	color: var(--sh-ink);
}

.sh-hero__feature-label {
	font-family: var(--sh-font-display);
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	line-height: 1.2;
	text-transform: uppercase;
}

.sh-hero__feature-line {
	display: block;
}

/* Il trattino rosso sotto l'etichetta lega le voci al filetto del titolo. */
.sh-hero__feature-label::after {
	display: block;
	width: 1.5rem;
	height: 2px;
	margin: var(--sh-space-2xs) auto 0;
	background-color: var(--sh-red);
	content: "";
}

/*
 * Voci sotto i bottoni invece che sopra (copertina dei corsi): stesso markup,
 * cambia solo l'ordine visivo. Nel DOM restano prima dei bottoni.
 */
.sh-hero--features-bottom .sh-hero__content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.sh-hero--features-bottom .sh-hero__features {
	order: 1;
	/* A tutta larghezza: sui telefoni la fila diventa una griglia a due colonne. */
	align-self: stretch;
	margin-block-start: var(--sh-space-xl);
}

/*
 * Sui telefoni quattro etichette in fila non ci stanno («ASSICURAZIONE» è più
 * larga di un quarto di schermo): due per riga, a colonne uguali.
 */
@media (max-width: 479px) {
	.sh-hero__features {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--sh-space-md) var(--sh-space-sm);
	}

	/*
	 * In colonne larghe mezzo schermo le voci centrate galleggiavano staccate
	 * da testo e bottone, allineati a sinistra: qui partono dal loro filo.
	 */
	.sh-hero__feature {
		align-items: flex-start;
		text-align: start;
	}

	.sh-hero__feature-label::after {
		margin-inline: 0;
	}
}

/* ==== Didascalia della foto ==== */

.sh-hero__caption-wrap {
	position: absolute;
	inset-block-end: 0;
	inset-inline: 0;
	z-index: 1;
	display: none;
	justify-content: flex-end;
	padding-block-end: var(--sh-space-xl);
	pointer-events: none;
}

/* Come il claim: sotto i 1024px finirebbe sopra bottoni e voci. */
@media (min-width: 1024px) {
	.sh-hero__caption-wrap {
		display: flex;
	}
}

.sh-hero__caption {
	margin: 0;
	padding-inline-start: var(--sh-space-sm);
	border-inline-start: 2px solid var(--sh-red);
	/* Sta sulla foto, spesso su asfalto chiaro: stessa ombra del claim. */
	text-shadow: 0 1px 10px rgb(0 0 0 / 0.65);
	text-transform: uppercase;
}

.sh-hero__caption-title {
	display: block;
	font-family: var(--sh-font-display);
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.15;
}

.sh-hero__caption-sub {
	display: block;
	margin-block-start: var(--sh-space-3xs);
	color: color-mix(in srgb, var(--sh-ink) 80%, transparent);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	line-height: 1.5;
}

/* ==== Copertina di sola immagine (scritte dentro la foto) ==== */
.sh-image-banner__link {
	display: block;
}

.sh-image-banner__img {
	display: block;
	width: 100%;
	height: auto;
}
