/*
 * Responsive layer shared by every active LPD page.
 * Loaded last so it can safely normalize legacy inline dimensions.
 */

:root {
	--lpd-header-height: 114px;
	--lpd-page-gutter: clamp(1rem, 3vw, 2rem);
}

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

html {
	overflow-x: clip;
	scroll-padding-top: calc(var(--lpd-header-height) + 1rem);
}

body {
	min-width: 0;
	width: 100%;
	padding-top: 0 !important;
	overflow-x: clip;
}

body > .lpd-header + main {
	margin-top: var(--lpd-header-height);
}

body > nav.fixed-top + main {
	margin-top: 70px;
}

body > .lpd-header:has(> div[style*="background:#222222"]) + main {
	margin-top: 96px;
}

img,
svg,
video,
canvas {
	max-width: 100%;
	height: auto;
}

iframe {
	max-width: 100%;
}

table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

main,
main p,
main h1,
main h2,
main h3,
main h4,
main a {
	overflow-wrap: break-word;
	word-break: normal;
	hyphens: none;
}

.row > [class*="col-"] {
	min-width: 0;
}

.container,
.container-fluid {
	--bs-gutter-x: max(1.5rem, calc(var(--lpd-page-gutter) * 2));
}

.lpd-header {
	background-color: color-mix(in srgb, var(--colore-crema) 94%, transparent) !important;
	box-shadow: 0 1px 14px color-mix(in srgb, var(--colore-inchiostro) 8%, transparent);
}

.lpd-header .navbar-brand img {
	display: block;
	width: auto;
	max-width: min(220px, 48vw);
	height: 50px;
	object-fit: contain;
}

.lpd-header .navbar-collapse[style] {
	margin-right: 0 !important;
}

.navbar-toggler {
	min-width: 44px;
	min-height: 44px;
	padding: .5rem;
	border-radius: 8px;
}

.navbar-toggler-icon {
	filter: invert(1);
}

.nav-link,
.dropdown-item,
.lpd-btn,
.button-cta,
.link-cta,
button,
input,
textarea,
select {
	touch-action: manipulation;
}

/* :where(...) lascia fuori la dashboard di amministrazione (.lpd-amministrazione), che dà ai pulsanti le sue altezze,
   senza cambiare la specificità */
.lpd-btn,
.button-cta,
button:not(.carousel-control-prev):not(.carousel-control-next):where(:not(.lpd-amministrazione *)) {
	min-height: 44px;
}

.section-title,
.lpd-title {
	font-size: clamp(1.75rem, 3.2vw, 2.875rem) !important;
}

.section-lead,
.lpd-lead {
	font-size: clamp(1rem, 1.5vw, 1.375rem) !important;
}

.home-section,
.people-section,
.family-section,
.health-section,
.company-section,
.value-section,
.promise-section,
.masterclass-section-sage,
.care-prevention,
.problem-simple {
	padding-block: clamp(3.5rem, 7vw, 7rem) !important;
}

.lpd-card,
.family-card,
.employee-card,
.health-grid-card,
.company-context-card,
.patient-step,
.masterclass-process-item,
.level-card,
.discipline-grid-item {
	height: 100%;
}

/* Homepage hero: keep the photograph, but protect text contrast at every width. */
#carouselBackground .carousel-inner,
.carousel-div-header .carousel-inner {
	height: 600px !important;
	min-height: 600px;
}

#carouselBackground .carousel-item,
.carousel-div-header .carousel-item {
	isolation: isolate;
	background-size: auto 100% !important;
	background-position: center right !important;
}

#carouselBackground .carousel-item::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(90deg, color-mix(in srgb, var(--colore-beige-caldo) 98%, transparent) 0%, color-mix(in srgb, var(--colore-beige-caldo) 92%, transparent) 38%, color-mix(in srgb, var(--colore-beige-caldo) 12%, transparent) 72%);
	pointer-events: none;
}

#carouselBackground .carousel-item[data-bg="#CDDBEF"]::before {
	background: linear-gradient(90deg, color-mix(in srgb, var(--colore-azzurro) 98%, transparent) 0%, color-mix(in srgb, var(--colore-azzurro) 92%, transparent) 38%, color-mix(in srgb, var(--colore-azzurro) 12%, transparent) 72%);
}

#carouselBackground h1,
.carousel-div-header h1 {
	max-width: none;
	font-size: 60px !important;
	line-height: 1.08 !important;
	letter-spacing: normal;
}

.company-hero h1,
.family-hero h1,
.health-hero h1,
.people-hero h1 {
	font-size: clamp(2rem, 4.2vw, 3.75rem) !important;
	line-height: 1.06 !important;
}

footer .row {
	row-gap: 1.75rem;
}

footer p,
footer h6,
footer a {
	overflow-wrap: anywhere;
}

@media (max-width: 1199.98px) {
	.nav-item {
		padding-inline: .55rem !important;
		font-size: 1rem;
	}
}

@media (max-width: 991.98px) {
	:root {
		--lpd-header-height: 112px;
	}

	.lpd-header .navbar {
		min-height: 68px;
	}

	.lpd-header .navbar > .container {
		flex-wrap: nowrap;
	}

	.lpd-header .navbar-collapse {
		position: absolute;
		top: calc(100% + 10px);
		left: var(--bs-gutter-x, 12px);
		right: var(--bs-gutter-x, 12px);
		z-index: 1060;
		max-height: calc(100dvh - var(--lpd-header-height) - 1rem);
		margin: 0 !important;
		padding: .75rem 1rem 1rem;
		overflow-y: auto;
		background: var(--colore-crema);
		border: 1px solid color-mix(in srgb, var(--colore-inchiostro) 10%, transparent);
		border-radius: 0 0 14px 14px;
		box-shadow: 0 16px 28px color-mix(in srgb, var(--colore-inchiostro) 18%, transparent);
	}

	.lpd-header > div[style*="background:#222222"] .container > div {
		padding-right: 0 !important;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.lpd-header .dropdown:has(#profiloDropdown) {
		right: 5.25rem !important;
		top: 50% !important;
		transform: translateY(-50%);
	}

	.lpd-header #profiloDropdown > div[style*="width:82px"] {
		width: 46px !important;
		height: 46px !important;
		font-size: 1rem !important;
	}

	.lpd-header #profiloMenu {
		top: 54px !important;
	}

	.lpd-header .navbar-nav {
		gap: 0 !important;
	}

	.lpd-header .nav-item {
		display: block;
		width: 100%;
		padding: 0 !important;
	}

	.lpd-header .nav-link {
		display: flex;
		align-items: center;
		width: 100%;
		min-height: 48px;
		margin: 0;
		padding: .65rem .75rem !important;
		border-radius: 8px;
	}

	.lpd-header .navbar .nav-link.active::after {
		display: none;
	}

	.lpd-header .dropdown-menu {
		position: static;
		width: 100%;
		padding: .25rem 0 .5rem;
		background: transparent;
		border: 0;
		box-shadow: none;
	}

	.lpd-header .dropdown-item {
		min-height: 44px;
		padding: .65rem 1rem;
		color: var(--colore-inchiostro);
		white-space: normal;
	}

	#carouselBackground .carousel-item::before {
		background: linear-gradient(90deg, color-mix(in srgb, var(--colore-beige-caldo) 98%, transparent) 0%, color-mix(in srgb, var(--colore-beige-caldo) 86%, transparent) 56%, color-mix(in srgb, var(--colore-beige-caldo) 20%, transparent) 100%);
	}

	#carouselBackground .carousel-item[data-bg="#CDDBEF"]::before {
		background: linear-gradient(90deg, color-mix(in srgb, var(--colore-azzurro) 98%, transparent) 0%, color-mix(in srgb, var(--colore-azzurro) 86%, transparent) 56%, color-mix(in srgb, var(--colore-azzurro) 20%, transparent) 100%);
	}

	.community-strip {
		padding: clamp(2rem, 6vw, 3.5rem) !important;
	}
}

@media (max-width: 767.98px) {
	:root {
		--lpd-page-gutter: 1rem;
	}

	.container,
	.container-fluid {
		--bs-gutter-x: 2rem;
	}

	.home-section,
	.people-section,
	.family-section,
	.health-section,
	.company-section,
	.value-section,
	.promise-section,
	.masterclass-section-sage,
	.care-prevention,
	.problem-simple {
		padding-block: 3.75rem !important;
	}

	.section-kicker,
	.lpd-kicker {
		margin-bottom: .75rem !important;
		font-size: .75rem !important;
	}

	.section-title,
	.lpd-title,
	.problem-box h2,
	.community-strip h2 {
		font-size: clamp(1.6rem, 6.5vw, 2.1rem) !important;
		line-height: 1.12 !important;
	}

	#carouselBackground .carousel-inner,
	.carousel-div-header .carousel-inner {
		height: min(610px, calc(100svh - var(--lpd-header-height))) !important;
		min-height: 500px;
		padding-left: 0 !important;
	}

	#carouselBackground .carousel-item,
	.carousel-div-header .carousel-item {
		height: 100% !important;
		padding-left: 0;
		border-left: 0;
		background-size: auto 72% !important;
		background-position: right bottom !important;
	}

	#carouselBackground .carousel-item::before {
		background: linear-gradient(180deg, var(--colore-beige-caldo) 0%, color-mix(in srgb, var(--colore-beige-caldo) 96%, transparent) 44%, color-mix(in srgb, var(--colore-beige-caldo) 25%, transparent) 78%);
	}

	#carouselBackground .carousel-item[data-bg="#CDDBEF"]::before {
		background: linear-gradient(180deg, var(--colore-azzurro) 0%, color-mix(in srgb, var(--colore-azzurro) 96%, transparent) 44%, color-mix(in srgb, var(--colore-azzurro) 25%, transparent) 78%);
	}

	#carouselBackground .carousel-item .row,
	.carousel-div-header .carousel-item .row {
		align-items: flex-start !important;
		padding-top: clamp(2.25rem, 8vw, 4rem);
	}

	#carouselBackground h1,
	.carousel-div-header h1 {
		max-width: 12ch;
		font-size: clamp(2.05rem, 9.4vw, 3rem) !important;
		line-height: 1.04 !important;
	}

	#carouselBackground h1 br,
	.carousel-div-header h1 br {
		display: none;
	}

	.target-card {
		min-height: 280px;
		padding: 1.5rem !important;
	}

	.live-visual {
		min-height: 260px !important;
	}

	.lpd-card,
	.family-card,
	.employee-card,
	.health-grid-card,
	.company-context-card,
	.patient-step,
	.masterclass-process-item,
	.level-card,
	.discipline-grid-item {
		padding: 1.35rem !important;
	}

	.masterclass-process,
	.company-how-grid,
	.start-grid {
		grid-template-columns: minmax(0, 1fr) !important;
	}

	.lpd-btn,
	.button-cta {
		justify-content: center;
		max-width: 100%;
		white-space: normal;
		text-align: center;
	}

	footer {
		padding-block: 3rem;
	}

	footer [style*="width:80%"] {
		width: 100% !important;
	}
}

@media (max-width: 575.98px) {
	:root {
		--lpd-header-height: 106px;
	}

	.lpd-header > div:first-child {
		height: 38px !important;
	}

	body > .lpd-header:has(> div[style*="background:#222222"]) + main {
		margin-top: 94px;
	}

	.lpd-header > div[style*="background:#222222"] {
		height: 26px !important;
	}

	.lpd-header > div:first-child .container > div {
		padding-inline: .5rem;
		font-size: .78rem !important;
		line-height: 1.25 !important;
	}

	.lpd-header .navbar {
		min-height: 68px;
		padding-block: .45rem;
	}

	.lpd-header .navbar-brand img {
		height: 42px;
		max-width: min(170px, calc(100vw - 118px));
	}

	#carouselBackground .carousel-inner,
	.carousel-div-header .carousel-inner {
		min-height: 520px;
	}

	#carouselBackground h1,
	.carousel-div-header h1 {
		font-size: clamp(1.9rem, 9vw, 2.65rem) !important;
	}

	.company-hero,
	.family-hero,
	.health-hero,
	.people-hero {
		min-height: auto !important;
		padding-block: 4rem !important;
	}

	.company-hero h1,
	.family-hero h1,
	.health-hero h1,
	.people-hero h1 {
		font-size: clamp(1.6rem, 7.5vw, 2.4rem) !important;
	}

	.community-strip {
		padding: 1.5rem !important;
		border-radius: 14px;
	}

	[style*="font-size:76px"] {
		font-size: clamp(3rem, 16vw, 4.25rem) !important;
	}

	.lpd-btn,
	.final-cta .lpd-btn,
	.health-cta .lpd-btn,
	.family-cta .lpd-btn,
	.company-cta .lpd-btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}
