/* ==========================================================================
   Studio Corr — layout styles that theme.json can't express.
   Colors, fonts and sizes live in theme.json (var(--wp--preset--*)).
   ========================================================================== */

:root {
	--sc-radius: 18px;
	--sc-radius-lg: 28px;
	--sc-shadow: 0 10px 30px rgb(23 28 56 / 0.12);
	--sc-whatsapp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38a9.9 9.9 0 0 0 4.74 1.21c5.46 0 9.91-4.45 9.91-9.91S17.5 2 12.04 2zm0 18.15a8.2 8.2 0 0 1-4.19-1.15l-.3-.18-3.12.82.83-3.04-.2-.31a8.23 8.23 0 1 1 6.98 3.86zm4.52-6.16c-.25-.12-1.47-.72-1.69-.81-.23-.08-.39-.12-.56.13-.17.24-.64.8-.78.97-.14.17-.29.18-.54.06-.25-.12-1.05-.39-1.99-1.23-.74-.66-1.23-1.47-1.38-1.72-.14-.25-.02-.38.11-.51.11-.11.25-.29.37-.43.13-.15.17-.25.25-.42.08-.17.04-.31-.02-.43-.06-.12-.56-1.34-.76-1.84-.2-.48-.41-.42-.56-.43h-.48c-.17 0-.43.06-.66.31-.22.25-.86.85-.86 2.07 0 1.22.89 2.4 1.01 2.56.12.17 1.75 2.67 4.23 3.74.59.26 1.05.41 1.41.52.59.19 1.13.16 1.56.1.48-.07 1.47-.6 1.67-1.18.21-.58.21-1.07.14-1.18-.06-.1-.22-.16-.47-.28z'/%3E%3C/svg%3E");
	--sc-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E");
}

body {
	-webkit-font-smoothing: antialiased;
	/* The carousel bleeds to the viewport edge; avoid a horizontal scrollbar. */
	overflow-x: clip;
}

.is-uppercase {
	text-transform: uppercase;
}

.eyebrow {
	margin-bottom: 0.25rem !important;
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--primary);
}

.chi-siamo .eyebrow {
	color: var(--wp--preset--color--sky);
}

.eyebrow + .wp-block-heading {
	margin-top: 0;
}

.section {
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--50);
}

.is-rounded-img img {
	border-radius: var(--sc-radius);
	box-shadow: var(--sc-shadow);
	width: 100%;
	height: auto;
}

/* Buttons ---------------------------------------------------------------- */

.wp-block-button.has-arrow .wp-block-button__link::after {
	content: "";
	display: inline-block;
	width: 1.1em;
	height: 1.1em;
	margin-left: 0.6em;
	vertical-align: -0.2em;
	background: currentColor;
	-webkit-mask: var(--sc-arrow) center / contain no-repeat;
	mask: var(--sc-arrow) center / contain no-repeat;
	transition: transform 0.2s ease;
}

.wp-block-button.has-arrow .wp-block-button__link:hover::after {
	transform: translateX(3px);
}

/* On the navy panel the default navy hover would hide the fill: only the arrow moves. */
.chi-siamo .wp-block-button.has-arrow .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}

.wp-block-button.is-style-outline-light .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--base);
	border: 1px solid currentColor;
}

.wp-block-button.is-style-outline-light .wp-block-button__link:hover {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--navy);
}

/* Header ----------------------------------------------------------------- */

/* Sticky header: fixed so it floats over the hero on the home page. */
.site-header {
	position: fixed;
	inset: 1rem 0 auto;
	z-index: 50;
}

.admin-bar .site-header {
	top: calc(32px + 1rem);
}

/* Pages without a hero: reserve the header's space so content isn't covered. */
body:not(:has(.hero)) .wp-site-blocks > header.wp-block-template-part {
	height: 6.5rem;
}

/*
 * Glass bar — Figma "Glass" effect:
 * Light -45° / 80%, Refraction 80, Depth 93, Dispersion 100, Frost 27, Splay 49.
 * Frost → backdrop blur, Light → inset highlights from the top-left.
 * Refraction/Depth/Dispersion/Splay → SVG filter built by main.js (Chromium only,
 * enabled via .has-glass-refraction); other browsers keep the frosted fallback.
 */
.site-header__bar {
	--glass-frost: 14px;
	--glass-light: 0.8;
	gap: 1.5rem;
	padding: 0.6rem 0.75rem 0.6rem 1.25rem;
	border-radius: var(--sc-radius);
	/* Opaque enough to keep menu items readable over busy video heroes. */
	background: linear-gradient(135deg, rgb(255 255 255 / 0.72), rgb(255 255 255 / 0.55));
	-webkit-backdrop-filter: blur(var(--glass-frost)) saturate(170%);
	backdrop-filter: blur(var(--glass-frost)) saturate(170%);
	box-shadow:
		inset 1.5px 1.5px 0 rgb(255 255 255 / var(--glass-light)),
		inset -1px -1px 0 rgb(255 255 255 / calc(var(--glass-light) * 0.35)),
		inset 6px 6px 18px -8px rgb(255 255 255 / calc(var(--glass-light) * 0.6)),
		0 10px 30px rgb(23 28 56 / 0.12);
}

.has-glass-refraction .site-header__bar {
	-webkit-backdrop-filter: url(#sc-glass) blur(calc(var(--glass-frost) * 0.6)) saturate(170%);
	backdrop-filter: url(#sc-glass) blur(calc(var(--glass-frost) * 0.6)) saturate(170%);
}

.site-header .wp-block-site-logo img {
	display: block;
	height: auto;
}

.site-header__nav {
	gap: 1.75rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--primary);
}

/* Underline: grows from the left on hover, retracts to the right on leave;
   stays drawn on the current page. */
.site-header__nav .wp-block-navigation-item__content {
	padding-bottom: 0.2em;
	background: linear-gradient(currentColor, currentColor) right bottom / 0 2px no-repeat;
	transition: background-size 0.35s cubic-bezier(0.65, 0, 0.35, 1), color 0.2s;
}

.site-header__nav .wp-block-navigation-item__content:hover,
.site-header__nav .wp-block-navigation-item__content:focus-visible,
.site-header__nav [aria-current="page"] {
	background-position: left bottom;
	background-size: 100% 2px;
}

.site-header__nav a:hover {
	color: var(--wp--preset--color--navy);
}

.site-header__actions {
	gap: 1.5rem;
}

.site-header__phone {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	white-space: nowrap;
}

.site-header__phone a {
	text-decoration: none;
}

.site-header__phone a::before {
	content: "";
	display: inline-block;
	width: 1.1em;
	height: 1.1em;
	margin-right: 0.45em;
	vertical-align: -0.2em;
	background: currentColor;
	-webkit-mask: var(--sc-whatsapp) center / contain no-repeat;
	mask: var(--sc-whatsapp) center / contain no-repeat;
}

.site-header__nav .nav-cta,
.site-header__nav .nav-footer {
	display: none;
}

@keyframes sc-menu-item {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Mobile menu opening: circle centred on the hamburger (16px = half its size). */
@keyframes sc-menu-reveal {
	from {
		clip-path: circle(0 at calc(100% - var(--sc-menu-side) - 16px) calc(var(--sc-menu-top) + 16px));
	}
	to {
		clip-path: circle(150vmax at calc(100% - var(--sc-menu-side) - 16px) calc(var(--sc-menu-top) + 16px));
	}
}

@keyframes sc-menu-x {
	from {
		opacity: 0;
		transform: rotate(-90deg) scale(0.6);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

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

/* Parallax: the photo stays still while the page scrolls over it.
   clip-path confines the fixed image to the hero (works on iOS too,
   unlike background-attachment: fixed). */
.hero.wp-block-cover {
	/* Full-bleed even inside padded/constrained page templates. */
	width: 100vw;
	max-width: none !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	margin-top: 0;
	min-height: clamp(420px, 62vw, 760px) !important;
	clip-path: inset(0);
}

.hero.wp-block-cover .wp-block-cover__image-background,
.hero.wp-block-cover .wp-block-cover__video-background {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100vh;
	height: 100lvh;
}

.hero.wp-block-cover::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 45%;
	background: linear-gradient(to bottom, rgb(255 255 255 / 0), var(--wp--preset--color--base));
	pointer-events: none;
}

/* Video hero: lighter eased fade, so it covers less footage with no visible edge. */
.hero.wp-block-cover:has(video)::after {
	height: 30%;
	background: linear-gradient(
		to bottom,
		rgb(255 255 255 / 0) 0%,
		rgb(255 255 255 / 0.04) 20%,
		rgb(255 255 255 / 0.14) 38%,
		rgb(255 255 255 / 0.32) 55%,
		rgb(255 255 255 / 0.58) 72%,
		rgb(255 255 255 / 0.84) 87%,
		rgb(255 255 255 / 1) 100%
	);
}

/* Tecnologie (page-id-20): show the whole video frame, uncropped.
   The hero takes the video's 16:9 ratio and the video fills it exactly,
   instead of the fixed/parallax full-viewport layer used elsewhere. */
.page-id-20 .hero.wp-block-cover:has(video) {
	min-height: 0 !important;
	aspect-ratio: 16 / 9 !important;
}

.page-id-20 .hero.wp-block-cover .wp-block-cover__video-background {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.page-id-20 .hero.wp-block-cover:has(video)::after {
	height: 12%;
}

/* Il nostro studio ------------------------------------------------------- */

.intro-studio h1 {
	margin-bottom: 0.83em;
	font-size: var(--wp--preset--font-size--x-large);
}

.intro-studio__cols {
	gap: clamp(2rem, 6vw, 6rem);
	font-size: var(--wp--preset--font-size--medium);
}

/* Chi siamo -------------------------------------------------------------- */

.chi-siamo {
	position: relative;
	padding: clamp(3rem, 7vw, 6rem) clamp(1.25rem, 4vw, 3rem);
	border-radius: var(--sc-radius-lg);
}

.chi-siamo .wp-block-heading {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 700;
}

.chi-siamo__photo {
	position: absolute;
	width: clamp(120px, 15vw, 190px);
	margin: 0;
}

.chi-siamo__photo img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
	border-radius: var(--sc-radius);
	box-shadow: 0 14px 30px rgb(0 0 0 / 0.3);
}

.chi-siamo__photo--tl { top: 12%; left: 4%; transform: rotate(-8deg); }
.chi-siamo__photo--tr { top: 10%; right: 4%; transform: rotate(7deg); }
.chi-siamo__photo--bl { bottom: 10%; left: 9%; transform: rotate(6deg); }
.chi-siamo__photo--br { bottom: 12%; right: 6%; transform: rotate(-6deg); }

/* Trattamenti (carousel) ------------------------------------------------- */

.carousel {
	position: relative;
}

.carousel__track {
	display: flex !important;
	gap: 1.25rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding: 0 0 0.5rem;
	margin: 0 calc(50% - 50vw) 0 0;
	max-width: none !important;
	list-style: none;
}

.carousel__track::-webkit-scrollbar {
	display: none;
}

.carousel__track > li {
	flex: 0 0 clamp(240px, 28vw, 300px);
	scroll-snap-align: start;
	margin: 0 !important;
}

.carousel__nav {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 1rem;
}

.carousel__nav button {
	width: 2.5rem;
	height: 2.5rem;
	border: 0;
	background: none;
	color: var(--wp--preset--color--primary);
	cursor: pointer;
}

.carousel__nav button::before {
	content: "";
	display: block;
	width: 100%;
	height: 100%;
	background: currentColor;
	-webkit-mask: var(--sc-arrow) center / 70% no-repeat;
	mask: var(--sc-arrow) center / 70% no-repeat;
}

.carousel__nav .carousel__prev::before {
	transform: scaleX(-1);
}

.carousel__nav button:disabled {
	opacity: 0.35;
	cursor: default;
}

.treatment-card {
	position: relative;
	height: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	border-radius: var(--sc-radius);
	background: var(--wp--preset--color--light);
}

.treatment-card__img,
.treatment-card__img img {
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.treatment-card__img {
	position: absolute !important;
	inset: 0;
	transition: opacity 0.35s ease;
}

.treatment-card__text {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	padding: 1.5rem;
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--navy);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.treatment-card__text .wp-block-post-excerpt__more-text {
	display: none;
}

.treatment-card__label {
	position: absolute;
	right: 1rem;
	bottom: 1rem;
	margin: 0;
	padding: 0.45rem 1rem;
	border-radius: 999px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 500;
	line-height: 1.2;
	text-align: right;
	transition: opacity 0.35s ease;
}

/* Hover (desktop) or tap (touch, via .is-open) shows the description. */
.treatment-card:hover .treatment-card__img,
.treatment-card:hover .treatment-card__label,
.treatment-card.is-open .treatment-card__img,
.treatment-card.is-open .treatment-card__label {
	opacity: 0;
}

.treatment-card:hover .treatment-card__text,
.treatment-card.is-open .treatment-card__text {
	opacity: 1;
}

/* Un sorriso per ogni età ------------------------------------------------ */

.sorriso {
	padding: clamp(1.5rem, 4vw, 3rem);
	border-radius: var(--sc-radius-lg);
}

.sorriso__cols {
	gap: clamp(1.5rem, 3vw, 2.5rem);
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--navy);
}

.sorriso__img img {
	box-shadow: none;
}

.sorriso .wp-block-heading:where(h3) {
	margin-top: 0;
	font-weight: 500;
}

/* Timed slides (main.js): stacked in one grid cell so the box keeps the
   height of the tallest; the nav lines fill up until the next slide. */
.sorriso__slides.is-enhanced {
	display: grid;
}

.sorriso__slides.is-enhanced > .sorriso__cols {
	grid-area: 1 / 1;
	margin: 0;
	transition: opacity 0.6s ease, visibility 0.6s;
}

.sorriso__slides.is-enhanced > .sorriso__cols:not(.is-current) {
	opacity: 0;
	visibility: hidden;
}

.sorriso__nav {
	display: flex;
	gap: 1rem;
	margin-block: 0 clamp(1.25rem, 3vw, 2rem);
}

.sorriso__nav button {
	flex: 1;
	max-width: 16rem;
	padding: 0 0 0.6rem;
	border: 0;
	background: none;
	color: var(--wp--preset--color--navy);
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-align: left;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.55;
	cursor: pointer;
	transition: opacity 0.3s ease;
}

.sorriso__nav button[aria-current="true"],
.sorriso__nav button:hover {
	opacity: 1;
}

.sorriso__nav button::after {
	content: "";
	display: block;
	height: 3px;
	margin-top: 0.5rem;
	border-radius: 3px;
	background: linear-gradient(var(--wp--preset--color--primary) 0 0) no-repeat left / 0 100%, rgb(0 0 0 / 0.12);
}

.sorriso__nav button[aria-current="true"]::after {
	background-size: 100% 100%, auto;
}

.sorriso__nav.is-playing button[aria-current="true"]::after {
	animation: sc-progress var(--sorriso-duration, 9s) linear forwards;
}

.sorriso__nav.is-paused button[aria-current="true"]::after {
	animation-play-state: paused;
}

@keyframes sc-progress {
	from { background-size: 0 100%, auto; }
	to { background-size: 100% 100%, auto; }
}

/* Footer ----------------------------------------------------------------- */

.site-footer {
	margin-top: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: 1rem;
	font-size: var(--wp--preset--font-size--small);
}

.site-footer a {
	color: inherit;
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--wp--preset--color--sky);
}

.site-footer__cols {
	gap: clamp(2rem, 4vw, 4rem);
}

.site-footer__contacts strong {
	font-weight: 400;
	color: var(--wp--preset--color--sky);
}

.site-footer__title {
	margin-top: 0;
	color: var(--wp--preset--color--sky);
	font-weight: 400;
}

.site-footer__nav {
	gap: 0.6rem;
}

.site-footer__nav a::before {
	content: "›";
	margin-right: 0.6em;
	color: var(--wp--preset--color--sky);
}

.site-footer__posts .wp-block-post-template {
	display: grid;
	gap: 1.25rem;
}

.mini-post {
	gap: 1rem;
}

.mini-post .wp-block-post-featured-image {
	flex-shrink: 0;
	margin: 0;
}

.mini-post .wp-block-post-featured-image img {
	border-radius: 8px;
}

.mini-post .wp-block-post-title {
	margin: 0;
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-transform: capitalize;
}

.mini-post .wp-block-post-date {
	font-size: var(--wp--preset--font-size--x-small);
	opacity: 0.8;
}

.site-footer__social {
	color: var(--wp--preset--color--sky);
}

.site-footer__social.wp-block-social-links .wp-social-link {
	color: var(--wp--preset--color--sky);
}

.site-footer__bottom {
	gap: 1.5rem;
	padding-top: 0.75rem;
	border-top: 1px solid rgb(255 255 255 / 0.15);
	font-size: var(--wp--preset--font-size--x-small);
}

.site-footer__bottom p {
	margin: 0;
}

.site-footer__bottom a {
	text-decoration: underline;
}

.site-footer__bottom .site-footer__ai-note {
	margin-left: auto;
	opacity: 0.7;
}

.site-footer__bottom .site-footer__credits {
	opacity: 0.7;
}

/* Page banner (Notizie, pages, single post) ------------------------------- */

.site-main.section {
	padding-top: var(--wp--preset--spacing--40);
}

.page-banner.wp-block-cover,
.page-banner--plain {
	margin-bottom: var(--wp--preset--spacing--50);
	padding: clamp(1.25rem, 3vw, 2rem);
	overflow: hidden;
	border-radius: var(--sc-radius);
	/* Shown when a page has no featured image yet. */
	background-color: var(--wp--preset--color--navy);
}

.page-banner--plain {
	padding-top: 4rem;
}

.page-banner .wp-block-cover__inner-container {
	width: 100%;
}

.page-banner h1 {
	margin: 0;
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--xx-large);
}

/* News grid -------------------------------------------------------------- */

.news-grid .wp-block-post-template.is-layout-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: clamp(1.25rem, 3vw, 2.5rem);
	row-gap: var(--wp--preset--spacing--50);
}

.news-card__media {
	position: relative;
}

.news-card__media .wp-block-post-featured-image {
	margin: 0;
}

.news-card__media .wp-block-post-featured-image img {
	border-radius: var(--sc-radius);
	transition: transform 0.4s ease;
}

.news-card__media .wp-block-post-featured-image a {
	display: block;
	overflow: hidden;
	border-radius: var(--sc-radius);
}

.news-card:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

.news-card__media .news-card__cat {
	position: absolute;
	top: 0.6rem;
	left: 0.6rem;
}

.news-card__cat {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 0.75rem;
}

.news-card__cat a {
	padding: 0.45rem 1rem;
	border-radius: 999px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-decoration: none;
}

.news-card__cat a:hover {
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--base);
}

.news-card__title {
	margin: 1rem 0 0.25rem;
	padding: 0 0.5rem;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 500;
}

.news-card__title a {
	color: var(--wp--preset--color--navy);
	text-decoration: none;
}

.news-card__title a:hover {
	color: var(--wp--preset--color--primary);
}

.news-card__date {
	padding: 0 0.5rem;
	font-size: var(--wp--preset--font-size--x-small);
}

.news-grid .wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--50);
	gap: 1rem;
	font-family: var(--wp--preset--font-family--heading);
}

.news-grid .wp-block-query-pagination .current {
	color: var(--wp--preset--color--primary);
	font-weight: 700;
}

@media (max-width: 1023px) {
	.news-grid .wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.news-grid .wp-block-post-template.is-layout-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Gallery ---------------------------------------------------------------- */

.studio-gallery.wp-block-gallery.has-nested-images {
	--wp--style--unstable-gallery-gap: clamp(0.5rem, 1.2vw, 1rem);
	gap: var(--wp--style--unstable-gallery-gap);
}

.studio-gallery.wp-block-gallery.has-nested-images figure.wp-block-image {
	aspect-ratio: 16 / 15;
	overflow: hidden;
	border-radius: 14px;
}

.studio-gallery.wp-block-gallery.has-nested-images figure.wp-block-image img {
	transition: transform 0.4s ease;
}

.studio-gallery.wp-block-gallery.has-nested-images figure.wp-block-image:hover img {
	transform: scale(1.05);
}

@media (min-width: 600px) and (max-width: 1023px) {
	.studio-gallery.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
		width: calc(33.333% - var(--wp--style--unstable-gallery-gap, 16px) * 0.667);
	}
}

/* Image lightbox (core "expand on click"): dark backdrop to match the footer. */
.wp-lightbox-overlay .scrim {
	background-color: rgb(23 28 56 / 0.94) !important;
}

.wp-lightbox-overlay button {
	color: var(--wp--preset--color--base) !important;
	fill: currentColor;
}

/* Gallery thumbs are cropped: show the whole photo, whatever its format. */
.wp-lightbox-overlay .lightbox-image-container {
	width: 92vw !important;
	height: 82vh !important;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
}

.wp-lightbox-overlay .lightbox-image-container figure,
.wp-lightbox-overlay .lightbox-image-container img {
	width: 100% !important;
	height: 100% !important;
	object-fit: contain !important;
	border-radius: 0;
}

/* Contatti --------------------------------------------------------------- */

.contact-map {
	overflow: hidden;
	border-radius: var(--sc-radius);
	background: var(--wp--preset--color--light);
}

.contact-map iframe {
	display: block;
	width: 100%;
	height: clamp(260px, 32vw, 460px);
	border: 0;
}

.contact-cols {
	margin-top: var(--wp--preset--spacing--50) !important;
	gap: clamp(2rem, 6vw, 6rem);
}

.contact-info {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.35;
	color: var(--wp--preset--color--contrast);
}

.contact-info h1,
.contact-info h2 {
	margin-bottom: 1rem;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 500;
}

.contact-info h1 {
	margin-top: 0.83em;
}

.contact-info h2:not(:first-child) {
	margin-top: var(--wp--preset--spacing--50);
}

.contact-info strong {
	font-weight: 500;
	color: var(--wp--preset--color--primary);
}

.contact-info a {
	color: inherit;
	text-decoration: none;
}

/* Form switched off (Dati dello studio): the info column fills the row. */
.contact-cols:not(:has(.contact-form-box)) > .contact-info {
	flex-basis: 100% !important;
}

.contact-form-box {
	padding: clamp(1.5rem, 3vw, 2rem);
	border-radius: var(--sc-radius);
}

.contact-form p {
	margin: 0 0 1rem;
}

.contact-form label {
	display: block;
	margin-bottom: 0.4rem;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.7rem 0.9rem;
	border: 2px solid transparent;
	border-radius: 12px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: var(--wp--preset--font-size--medium);
}

.contact-form textarea {
	min-height: 160px;
	resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--sky);
}

.contact-form__privacy label {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 400;
	line-height: 1.5;
}

.contact-form__privacy input {
	flex-shrink: 0;
	width: 1.1rem;
	height: 1.1rem;
	margin-top: 0.1rem;
	accent-color: var(--wp--preset--color--sky);
}

.contact-form__privacy a {
	color: var(--wp--preset--color--sky);
}

.contact-form__submit {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 0 !important;
}

.contact-form__submit button {
	border: 0;
	cursor: pointer;
}

.contact-form__hp {
	position: absolute !important;
	left: -9999px;
}

.contact-form__notice {
	padding: 0.8rem 1rem;
	border-radius: 12px;
	font-size: var(--wp--preset--font-size--small);
}

.contact-form__notice--success {
	background: rgb(0 165 226 / 0.2);
}

.contact-form__notice--error {
	background: rgb(255 90 90 / 0.25);
}

/* Tecnologie ------------------------------------------------------------- */

/* Pages opening with a hero: no gap above it. */
.site-main.section:has(> .wp-block-post-content > .hero:first-child) {
	padding-top: 0;
}

.tec-intro__row {
	gap: clamp(1.5rem, 4vw, 4rem);
}

.tec-intro__img img {
	width: 100%;
	aspect-ratio: 5 / 4;
	object-fit: cover;
	object-position: 50% 50%;
	border-radius: var(--sc-radius);
}

.tec-intro .wp-block-heading {
	margin-top: 0;
	font-size: var(--wp--preset--font-size--xx-large);
}

.benefit-cards {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 1rem;
	margin-bottom: var(--wp--preset--spacing--40);
}

.benefit-cards > * {
	margin: 0 !important;
}

.benefit-card {
	padding: 1rem 1.1rem 1.5rem;
	border-radius: 12px;
	background: var(--wp--preset--color--light);
	color: var(--wp--preset--color--navy);
}

.benefit-card__title {
	position: relative;
	min-height: 2.6em;
	margin: 0 0 1rem;
	padding-right: 2rem;
	color: inherit;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 500;
	line-height: 1.3;
}

/* Plus icon; the dark variant hides the vertical bar to show a minus. */
.benefit-card__title::before,
.benefit-card__title::after {
	content: "";
	position: absolute;
	top: 0.55em;
	right: 0;
	width: 1.3rem;
	height: 3px;
	background: currentColor;
}

.benefit-card__title::after {
	transform: rotate(90deg);
}

.benefit-card__text {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.55;
}

.benefit-card--dark {
	background: var(--wp--preset--color--navy-dark);
	color: var(--wp--preset--color--base);
}

.benefit-card--dark .benefit-card__title::after {
	display: none;
}

.tec-grid-wrap > .wp-block-heading {
	font-size: var(--wp--preset--font-size--xx-large);
}

.tec-grid .wp-block-post-template.is-layout-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: clamp(1rem, 2vw, 1.5rem);
	row-gap: var(--wp--preset--spacing--50);
}

.tec-card__img {
	margin: 0;
}

.tec-card__img img {
	border-radius: var(--sc-radius);
}

.tec-card__title {
	margin: 1rem 0.25rem 0.25rem;
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 500;
	text-transform: uppercase;
}

.tec-card__text {
	margin: 0 0.25rem;
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--small);
}

.tec-card__text .wp-block-post-excerpt__more-text {
	display: none;
}

@media (max-width: 1023px) {
	.benefit-cards {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.tec-grid .wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.benefit-cards,
	.tec-grid .wp-block-post-template.is-layout-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.benefit-card__title {
		min-height: 0;
	}
}

/* Team ------------------------------------------------------------------- */

.team-group + .team-group {
	margin-top: var(--wp--preset--spacing--60);
}

.team-group__title {
	margin: 0 0 1rem;
	font-size: var(--wp--preset--font-size--xx-large);
}

.team-grid {
	display: grid;
	/* Fixed-width cards: as many per row as fit (6 on desktop), never stretched. */
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 190px));
	gap: 2rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.team-card__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	object-position: 50% 20%;
	border-radius: 12px;
	background: var(--wp--preset--color--light);
}

.team-card__name {
	margin: 0.9rem 0.5rem 0.3rem;
	color: var(--wp--preset--color--navy);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.team-card__role {
	margin: 0 0.5rem;
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--x-small);
	line-height: 1.5;
}

@media (max-width: 640px) {
	.team-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Single post ------------------------------------------------------------ */

.single-body {
	font-size: 1.0625rem;
}

.single-body .news-card__date {
	padding: 0;
	color: var(--wp--preset--color--muted);
}

/* Mobile ----------------------------------------------------------------- */

@media (max-width: 781px) {
	.site-header {
		inset: 0.75rem 0 auto;
	}

	.admin-bar .site-header {
		top: calc(46px + 0.75rem);
	}

	body:not(:has(.hero)) .wp-site-blocks > header.wp-block-template-part {
		height: 5rem;
	}

	.site-header__bar {
		padding: 0.5rem 0.75rem;
	}

	.site-header .wp-block-site-logo img {
		width: 110px !important;
	}

	.site-header .site-header__actions {
		display: none;
	}

	.site-header__nav {
		margin-left: auto;
	}

	/* backdrop-filter would trap the fixed overlay inside the bar. */
	.site-header__bar:has(.is-menu-open) {
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
		background: transparent;
		border-color: transparent;
	}

	/* Keep the logo visible above the open menu, as in the mockup. */
	.site-header .wp-block-site-logo {
		position: relative;
		z-index: 100001;
	}

	.site-header__nav .wp-block-navigation__responsive-container-open,
	.site-header__nav .wp-block-navigation__responsive-container-close {
		color: var(--wp--preset--color--sky);
	}

	.site-header__nav .wp-block-navigation__responsive-container-open svg,
	.site-header__nav .wp-block-navigation__responsive-container-close svg {
		width: 32px;
		height: 32px;
	}

	/* Padding = header offset (0.75rem) + bar padding (0.5rem / 0.75rem) + page
	   gutter, so the X lands exactly on the hamburger and the menu items line
	   up with the logo. */
	.site-header__nav .wp-block-navigation__responsive-container.is-menu-open {
		--sc-menu-side: calc(clamp(1rem, 4vw, 2.5rem) + 0.75rem);
		--sc-menu-top: 1.25rem;
		padding: var(--sc-menu-top) var(--sc-menu-side) 1.5rem;
		/* Same frosted white as the header bar, opaque enough that the video
		   behind doesn't tint it. */
		background: linear-gradient(160deg, rgb(255 255 255 / 0.94), rgb(231 232 242 / 0.9)) !important;
		-webkit-backdrop-filter: blur(24px) saturate(140%);
		backdrop-filter: blur(24px) saturate(140%);
		color: var(--wp--preset--color--primary) !important;
	}

	.admin-bar .site-header__nav .wp-block-navigation__responsive-container.is-menu-open {
		top: 46px;
	}

	/* Stretch the overlay's inner wrappers so the CTA can sit at the bottom. */
	.site-header__nav .is-menu-open .wp-block-navigation__responsive-close,
	.site-header__nav .is-menu-open .wp-block-navigation__responsive-dialog {
		display: flex;
		flex-direction: column;
		height: 100%;
		max-width: none;
		/* Core pushes the dialog down by the admin bar height; the container already sits below it. */
		margin-top: 0 !important;
	}

	.site-header__nav .is-menu-open .wp-block-navigation__responsive-container-close {
		top: 0;
		right: 0;
	}

	.site-header__nav .is-menu-open .wp-block-navigation__responsive-container-content {
		flex: 1;
		padding-top: clamp(5rem, 16vh, 8rem) !important;
		align-items: flex-start !important;
		gap: 0 !important;
	}

	.site-header__nav .is-menu-open .wp-block-navigation__container {
		flex: 1;
		width: 100%;
		align-items: flex-start !important;
		gap: 1.1rem !important;
	}

	/* Same type as the desktop menu and the headings. */
	.site-header__nav .is-menu-open .wp-block-navigation-item__content {
		font-family: var(--wp--preset--font-family--heading);
		font-size: clamp(2rem, 9.5vw, 2.5rem);
		font-weight: 600;
		line-height: 1.15;
		letter-spacing: -0.02em;
		padding-bottom: 0.08em;
		background-size: 0 3px;
	}

	.site-header__nav .is-menu-open .wp-block-navigation-item__content:hover,
	.site-header__nav .is-menu-open [aria-current="page"] {
		background-size: 100% 3px;
	}

	.site-header__nav .is-menu-open [aria-current="page"] {
		color: var(--wp--preset--color--navy);
	}

	/* Opening: the panel grows out of the hamburger as a circle, the X spins
	   in where the hamburger was, then the items slide in one after another. */
	@media (prefers-reduced-motion: no-preference) {
		.site-header__nav .wp-block-navigation__responsive-container.is-menu-open {
			animation: sc-menu-reveal 0.6s cubic-bezier(0.65, 0, 0.35, 1) both;
		}

		.site-header__nav .is-menu-open .wp-block-navigation__responsive-container-close svg {
			animation: sc-menu-x 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
		}

		.site-header__nav .wp-block-navigation__responsive-container-open svg {
			transition: transform 0.25s ease;
		}

		.site-header__nav .wp-block-navigation__responsive-container-open:active svg {
			transform: scale(0.85);
		}
	}

	/* Items slide in one after another, like the page content reveal. */
	@media (prefers-reduced-motion: no-preference) {
		.site-header__nav .is-menu-open .wp-block-navigation-item,
		.site-header__nav .is-menu-open .nav-footer {
			animation: sc-menu-item 0.55s cubic-bezier(0.22, 1, 0.36, 1) 250ms both;
		}

		/* Start once the circle has covered most of the screen. */
		.site-header__nav .is-menu-open .wp-block-navigation-item:nth-child(2) { animation-delay: 310ms; }
		.site-header__nav .is-menu-open .wp-block-navigation-item:nth-child(3) { animation-delay: 370ms; }
		.site-header__nav .is-menu-open .wp-block-navigation-item:nth-child(4) { animation-delay: 430ms; }
		.site-header__nav .is-menu-open .wp-block-navigation-item:nth-child(5) { animation-delay: 490ms; }
		.site-header__nav .is-menu-open .wp-block-navigation-item:nth-child(n+6) { animation-delay: 550ms; }
		.site-header__nav .is-menu-open .nav-footer { animation-delay: 610ms; }
	}

	/* Bottom row, mirroring the desktop header: WhatsApp number + Contattaci. */
	.site-header__nav .is-menu-open .nav-footer {
		display: flex;
		width: 100%;
		margin-top: auto;
		padding-top: 1.25rem;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		border-top: 1px solid rgb(0 106 154 / 0.15);
	}

	.site-header__nav .is-menu-open .nav-footer .site-header__phone {
		font-size: var(--wp--preset--font-size--medium);
	}

	/* Focus is moved into the menu on open: keep it visible for keyboards, but
	   distinct from the underline that marks the current page. */
	.site-header__nav .is-menu-open .wp-block-navigation-item__content:focus-visible {
		outline: 2px dashed rgb(0 106 154 / 0.5);
		outline-offset: 4px;
		border-radius: 4px;
	}

	.site-header__nav .is-menu-open .nav-cta {
		display: flex;
	}

	.site-header__nav .is-menu-open .nav-cta .wp-block-button__link {
		color: var(--wp--preset--color--base);
		font-size: var(--wp--preset--font-size--medium);
		font-weight: 600;
		padding: 0.8rem 1.4rem;
	}

	.hero.wp-block-cover {
		min-height: 360px !important;
	}

	.chi-siamo {
		padding-top: 2.5rem;
		padding-bottom: 2.5rem;
	}

	.chi-siamo .wp-block-heading {
		font-size: var(--wp--preset--font-size--x-large);
		font-weight: 600;
		text-transform: none;
	}

	.chi-siamo .wp-block-buttons {
		flex-direction: column;
	}

	/* Photos are decorative: the mobile mockup drops them. */
	.chi-siamo__photo {
		display: none;
	}

	.carousel__track > li {
		flex-basis: 78%;
	}

	.treatment-card__label {
		font-size: var(--wp--preset--font-size--small);
	}

	.sorriso .wp-block-heading:where(h2) {
		text-align: center;
	}
	.page-banner.wp-block-cover {
		min-height: 200px !important;
	}

	/* Footer posts stack image over title, as in the mobile mockup. */
	.mini-post {
		flex-direction: column;
		align-items: flex-start !important;
	}

	.mini-post .wp-block-post-featured-image,
	.mini-post .wp-block-post-featured-image img {
		width: 100% !important;
		height: auto !important;
		aspect-ratio: 16 / 9;
	}
}

/* Reveal on load/scroll (see main.js) ------------------------------------ */

.has-reveal:not(.reveal-ready) .site-main {
	opacity: 0;
}

.reveal {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
	transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-revealed {
	opacity: 1;
	transform: none;
}

/* Page entrance (on load) -------------------------------------------------
   Starts when main.js sets .reveal-ready, together with the content reveal.
   Gated by .has-reveal: skipped for reduced motion, and the 3s fallback in
   functions.php shows everything if main.js never runs. */

.has-reveal.sc-nav-intro:not(.reveal-ready) .site-header {
	opacity: 0;
}

/* Hero video/photo: pulls back from a strong, blurred zoom into focus. */
.has-reveal.reveal-ready .hero .wp-block-cover__video-background,
.has-reveal.reveal-ready .hero .wp-block-cover__image-background {
	animation: sc-hero-in 1.6s cubic-bezier(0.16, 1, 0.3, 1) var(--sc-intro-delay, 0s) both;
}

/* Header bar drops in with a small overshoot once the hero is settling
   (first home page load of the visit only). */
.has-reveal.sc-nav-intro.reveal-ready .site-header {
	animation: sc-header-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--sc-intro-delay, 0s) + 0.5s) both;
}

/* First page of the visit: a navy curtain with the white logo covers the
   page, then lifts upward to uncover the hero. */
.sc-intro {
	--sc-intro-delay: 1s;
}

.has-reveal.sc-intro body::before,
.has-reveal.sc-intro body::after {
	content: "";
	position: fixed;
	z-index: 1000;
	pointer-events: none;
}

.has-reveal.sc-intro body::before {
	inset: 0;
	background: var(--wp--preset--color--navy-dark);
}

.has-reveal.sc-intro body::after {
	top: 50%;
	left: 50%;
	width: min(240px, 60vw);
	aspect-ratio: 976 / 258;
	background: url(../images/logo-white.png) center / contain no-repeat;
	opacity: 0;
}

.has-reveal.sc-intro.reveal-ready body::before {
	animation: sc-curtain-up 0.9s cubic-bezier(0.76, 0, 0.24, 1) 0.75s both;
}

.has-reveal.sc-intro.reveal-ready body::after {
	animation: sc-logo 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sc-hero-in {
	from {
		opacity: 0;
		transform: scale(1.25);
		filter: blur(12px);
	}
	to {
		opacity: 1;
		transform: none;
		filter: none;
	}
}

@keyframes sc-header-in {
	from {
		opacity: 0;
		transform: translateY(-60px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes sc-curtain-up {
	from {
		clip-path: inset(0 0 0 0);
	}
	to {
		clip-path: inset(0 0 100% 0);
		visibility: hidden;
	}
}

@keyframes sc-logo {
	0% {
		opacity: 0;
		transform: translate(-50%, -30%) scale(0.92);
	}
	35%,
	65% {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}
	100% {
		opacity: 0;
		transform: translate(-50%, -80%) scale(1);
		visibility: hidden;
	}
}
