/* Heritage – layout articolo "heritage" */

.asa-heritage-page #sp-main-body {
	padding: 0;
}

.asa-heritage-page .body-innerwrapper {
	overflow-x: clip;
}

.asa-heritage {
	--ah-navy: #19233f;
	--ah-orange: #e9531d;
	--ah-grey: #f4f4f2;
	--ah-muted: #6b7285;
	--ah-line: rgba(25, 35, 63, .14);
	--ah-header: 0px;
	--ah-nav-h: 0px;
	--ah-gutter: clamp(20px, 5vw, 80px);
	--ah-pad: clamp(40px, 8vh, 88px);

	position: relative;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	color: var(--ah-navy);
}

.asa-heritage *,
.asa-heritage *::before,
.asa-heritage *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------- Hero */

.ah-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: min(72vh, 760px);
	padding: clamp(72px, 12vh, 140px) var(--ah-gutter) clamp(72px, 10vh, 112px);
	background: var(--ah-navy);
	color: #fff;
	overflow: hidden;
	isolation: isolate;
}

.ah-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -2;
	background: var(--ah-hero-image, none) center / cover no-repeat;
}

.ah-hero.has-image::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(25, 35, 63, .25) 0%, rgba(25, 35, 63, .88) 75%);
}

.ah-hero__inner {
	display: grid;
	gap: 28px;
	width: 100%;
	max-width: 1360px;
	margin: 0 auto;
}

.ah-hero__title {
	margin: 0;
	font-size: clamp(2.5rem, 5vw, 4.5rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -.02em;
	color: #fff;
}

.ah-hero__title::after {
	content: "";
	display: block;
	width: 72px;
	height: 5px;
	margin-top: 24px;
	background: var(--ah-orange);
}

.ah-hero__lead p {
	margin: 0 0 1em;
	font-size: clamp(1rem, 1.15vw, 1.15rem);
	line-height: 1.65;
	color: rgba(255, 255, 255, .75);
}

.ah-hero__lead p:first-child {
	font-size: clamp(1.2rem, 1.7vw, 1.6rem);
	font-weight: 500;
	line-height: 1.45;
	color: #fff;
}

.ah-hero__lead p:last-child {
	margin-bottom: 0;
}

.ah-hero__cue {
	position: absolute;
	right: var(--ah-gutter);
	bottom: clamp(28px, 5vh, 56px);
	width: 26px;
	height: 58px;
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 13px;
}

.ah-hero__cue span {
	position: absolute;
	top: 11px;
	left: 50%;
	width: 4px;
	height: 11px;
	margin-left: -2px;
	border-radius: 2px;
	background: var(--ah-orange);
	animation: ah-cue 1.8s ease-in-out infinite;
}

@keyframes ah-cue {
	0% { transform: translateY(0); opacity: 0; }
	30% { opacity: 1; }
	100% { transform: translateY(24px); opacity: 0; }
}

/* ---------------------------------------------------------------- Timeline – base / mobile */

.ah-timeline {
	position: relative;
	background: var(--ah-grey);
}

.ah-nav {
	position: sticky;
	top: var(--ah-header);
	z-index: 20;
	background: rgba(255, 255, 255, .96);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--ah-line);
}

.ah-nav__list {
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0 12px;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}

.ah-nav__list::-webkit-scrollbar {
	display: none;
}

.ah-nav__list li {
	flex: 0 0 auto;
	margin: 0;
}

/* Centrata quando c'è spazio, scorrevole da sinistra quando non basta */
.ah-nav__list li:first-child {
	margin-left: auto;
}

.ah-nav__list li:last-child {
	margin-right: auto;
}

.ah-nav__link {
	position: relative;
	display: block;
	padding: 16px 10px;
	font-size: .95rem;
	font-weight: 600;
	letter-spacing: .04em;
	white-space: nowrap;
	color: var(--ah-muted) !important;
	text-decoration: none !important;
	transition: color .25s;
}

.ah-nav__link::after {
	content: "";
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: -1px;
	height: 3px;
	background: var(--ah-orange);
	transform: scaleX(0);
	transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}

.ah-nav__link:hover,
.ah-nav__link.is-active {
	color: var(--ah-navy) !important;
}

.ah-nav__link.is-active::after {
	transform: scaleX(1);
}

.ah-nav__progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 1px;
}

.ah-nav__progress span {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--ah-navy);
	transform-origin: 0 50%;
	transform: scaleX(var(--ah-progress, 0));
}

.ah-chapter {
	position: relative;
	padding: clamp(56px, 10vw, 96px) var(--ah-gutter);
	border-top: 1px solid var(--ah-line);
	scroll-margin-top: calc(var(--ah-header) + var(--ah-nav-h));
}

.ah-chapter:first-child {
	border-top: 0;
}

.ah-visual__decade {
	display: block;
	font-size: clamp(3.6rem, 19vw, 6.4rem);
	font-weight: 800;
	line-height: .85;
	letter-spacing: -.05em;
	color: var(--ah-navy);
	font-variant-numeric: lining-nums;
}

.is-long-label .ah-visual__decade {
	font-size: clamp(2.2rem, 9.6vw, 3.6rem);
	line-height: .95;
	letter-spacing: -.03em;
}

/* Su mobile le immagini stanno dentro al testo, il visual mostra solo l'anno */
.has-images .ah-visual {
	display: none;
}

.ah-visual__img,
.ah-visual__tag {
	display: none;
}

.ah-content {
	margin-top: 28px;
}

.ah-content__decade {
	margin: 0 0 12px;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .28em;
	color: var(--ah-orange);
}

.ah-chapter:not(.has-images) .ah-content__decade {
	display: none;
}

.ah-content__title {
	margin: 0 0 28px;
	font-size: clamp(1.6rem, 2.6vw, 2.3rem);
	font-weight: 700;
	line-height: 1.15;
	color: var(--ah-navy);
}

.ah-slide + .ah-slide {
	margin-top: 1.1em;
}

.ah-slide__media {
	margin: 8px 0 20px;
	overflow: hidden;
}

.ah-slide__media img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.ah-slide__text p {
	margin: 0 0 1em;
	font-size: clamp(1rem, 1.1vw, 1.1rem);
	line-height: 1.75;
	color: var(--ah-navy);
}

.ah-slide__text p:last-child {
	margin-bottom: 0;
}

/* Comparsa progressiva (solo con JS) */
.asa-heritage.is-ready .ah-slide,
.asa-heritage.is-ready .ah-visual,
.asa-heritage.is-ready .ah-content__title {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}

.asa-heritage.is-ready .is-visible {
	opacity: 1;
	transform: none;
}

/* ---------------------------------------------------------------- Desktop: indice verticale + visual fisso + testi affiancati */

@media (min-width: 992px) {
	.ah-hero__inner {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		gap: clamp(40px, 6vw, 120px);
		align-items: start;
	}

	.ah-hero__lead {
		max-width: 640px;
	}

	.ah-timeline {
		display: grid;
		grid-template-columns: clamp(170px, 13vw, 220px) minmax(0, 1fr);
	}

	.ah-nav {
		align-self: start;
		height: calc(100vh - var(--ah-header));
		padding: var(--ah-pad) 0 40px var(--ah-gutter);
		background: none;
		backdrop-filter: none;
		border: 0;
	}

	.ah-nav__list {
		flex-direction: column;
		gap: 2px;
		padding: 0 0 0 18px;
		overflow: visible;
		border-left: 1px solid var(--ah-line);
	}

	.ah-nav__list li:first-child,
	.ah-nav__list li:last-child {
		margin: 0;
	}

	.ah-nav__link {
		padding: 7px 16px 7px 0;
		font-size: .82rem;
		line-height: 1.35;
		letter-spacing: .12em;
		white-space: normal;
	}

	.ah-nav__link::after {
		top: calc(7px + .675em);
		left: -21px;
		right: auto;
		bottom: auto;
		width: 5px;
		height: 5px;
		margin-top: -2.5px;
		border-radius: 50%;
		transform: scale(0);
	}

	.ah-nav__link.is-active::after {
		transform: scale(1);
	}

	/* Avanzamento complessivo lungo la linea verticale dell'indice */
	.ah-nav__progress {
		top: var(--ah-pad);
		left: var(--ah-gutter);
		right: auto;
		bottom: auto;
		width: 1px;
		height: var(--ah-nav-list-h, 0px);
	}

	.ah-nav__progress span {
		transform-origin: 50% 0;
		transform: scaleY(var(--ah-progress, 0));
	}

	.ah-chapter {
		display: grid;
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		gap: clamp(40px, 5vw, 96px);
		align-items: start;
		min-height: calc(100vh - var(--ah-header));
		padding: var(--ah-pad) var(--ah-gutter) calc(var(--ah-pad) * 1.5) clamp(56px, 7vw, 128px);
		border-top: 0;
	}

	.ah-chapter + .ah-chapter::before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		right: var(--ah-gutter);
		height: 1px;
		background: var(--ah-line);
	}

	.has-images .ah-visual {
		display: block;
	}

	.ah-visual {
		position: sticky;
		top: calc(var(--ah-header) + var(--ah-pad));
		height: min(calc(100vh - var(--ah-header) - 2 * var(--ah-pad)), 680px);
	}

	.ah-visual__inner {
		position: relative;
		display: flex;
		align-items: flex-start;
		height: 100%;
		container-type: inline-size;
	}

	.ah-visual__decade {
		font-size: min(24cqi, 12rem);
	}

	.is-long-label .ah-visual__decade {
		font-size: min(12cqi, 6rem);
	}

	.ah-visual__img {
		position: absolute;
		inset: 0;
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
		opacity: 0;
		transform: scale(1.04);
		transition: opacity .7s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1);
	}

	.ah-visual__img.is-active {
		opacity: 1;
		transform: none;
	}

	.ah-visual__tag {
		position: absolute;
		left: 0;
		bottom: 0;
		display: block;
		padding: 10px 16px;
		font-size: .85rem;
		font-weight: 600;
		letter-spacing: .2em;
		color: #fff;
		background: var(--ah-navy);
	}

	.ah-content {
		margin-top: 0;
		padding-top: 0;
	}

	.ah-chapter .ah-content__decade {
		display: block;
	}

	.ah-slide__media {
		display: none;
	}

	/* Il paragrafo in lettura è pieno, gli altri attenuati */
	.asa-heritage.is-ready .ah-slide.is-visible {
		opacity: .4;
		transition: opacity .5s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
	}

	.asa-heritage.is-ready .ah-slide.is-visible.is-active {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ah-hero__cue span {
		animation: none;
	}

	.asa-heritage.is-ready .ah-slide,
	.asa-heritage.is-ready .ah-visual,
	.asa-heritage.is-ready .ah-content__title {
		transform: none;
		transition: none;
	}
}
