/* =========================================================================
   Statella: base comune a tutte le pagine.
   Colori, font e misure vengono dalla bozza "Home B v2" (Claude Design).
   ========================================================================= */

@font-face {
	font-family: "Bodoni Moda";
	src: url("../fonts/bodoni-moda.woff2") format("woff2");
	font-style: normal;
	font-weight: 400 600;
	font-display: swap;
}
@font-face {
	font-family: "Bodoni Moda";
	src: url("../fonts/bodoni-moda-italic.woff2") format("woff2");
	font-style: italic;
	font-weight: 400 500;
	font-display: swap;
}
@font-face {
	font-family: "Hanken Grotesk";
	src: url("../fonts/hanken-grotesk.woff2") format("woff2");
	font-style: normal;
	font-weight: 300 600;
	font-display: swap;
}

:root {
	--bg: oklch(0.17 0.006 70);
	--bg-2: oklch(0.21 0.007 70);
	--line: oklch(0.34 0.008 70);
	--text: oklch(0.95 0.012 85);
	--muted: oklch(0.75 0.012 80);
	--brass: oklch(0.77 0.085 80);
	--brass-hi: oklch(0.83 0.085 80);
	--display: "Bodoni Moda", Didot, "Bodoni 72", serif;
	--sans: "Hanken Grotesk", system-ui, sans-serif;
	--ease: cubic-bezier(0.16, 0.8, 0.12, 1);
	--gut: clamp(20px, 5vw, 80px);
	--max: 1360px;
	--head-h: 88px;
	color-scheme: dark;
}

/* ---------- Reset e tipografia ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 300 18px/1.65 var(--sans);
	font-size-adjust: from-font;
	-webkit-font-smoothing: antialiased;
}
img, video, svg { max-width: 100%; height: auto; }
a { color: var(--text); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--brass); }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
	position: fixed; left: 16px; top: -100px; z-index: 100;
	padding: 12px 18px; background: var(--brass); color: var(--bg); font-weight: 500;
}
.skip-link:focus { top: 16px; color: var(--bg); }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gut); }

/* Componenti tipografici condivisi */
.eyebrow {
	display: inline-flex; align-items: center; gap: 14px;
	font: 500 11px/1 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--brass);
}
.eyebrow::before { content: ""; width: 36px; height: 1px; background: var(--brass); }
.h1-page { font: 400 clamp(40px, 5.6vw, 88px)/1.04 var(--display); letter-spacing: -0.02em; }
.h1-page em, .h2 em { font-style: italic; color: var(--brass); }
.h2 { font: 400 clamp(36px, 4.6vw, 72px)/1.02 var(--display); letter-spacing: -0.02em; }
.h3 { font: 400 clamp(24px, 2.2vw, 32px)/1.2 var(--display); }
.lede { font: 300 clamp(17px, 1.3vw, 19px)/1.65 var(--sans); color: var(--muted); max-width: 62ch; }
.lede strong { color: var(--text); font-weight: 500; }

.btn {
	display: inline-flex; align-items: center; gap: 14px;
	font: 500 14px/1 var(--sans); letter-spacing: 0.04em; padding: 19px 26px;
	border: 1px solid transparent; cursor: pointer;
	transition: background 0.4s var(--ease), color 0.4s var(--ease), gap 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn-brass { background: var(--brass); color: var(--bg); }
.btn-brass:hover { color: var(--bg); gap: 20px; background: var(--brass-hi); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--brass); gap: 20px; }
.more {
	display: inline-flex; gap: 10px; font: 500 12px/1 var(--sans); letter-spacing: 0.18em;
	text-transform: uppercase; color: var(--muted); transition: gap 0.4s var(--ease), color 0.3s;
}
.more:hover { gap: 16px; }

.sec { padding-block: clamp(72px, 10vw, 160px); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: clamp(36px, 5vw, 64px); flex-wrap: wrap; }

/* ---------- Intestazione ---------- */

.top-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 60px; pointer-events: none; }
.site-head {
	position: fixed; inset: 0 0 auto 0; z-index: 20;
	border-bottom: 1px solid transparent;
	transition: background 0.5s var(--ease), border-color 0.5s var(--ease);
	view-transition-name: site-head;
}
.site-head.scrolled, body:not(.home) .site-head {
	background: color-mix(in oklch, var(--bg) 88%, transparent);
	backdrop-filter: blur(14px);
	border-color: var(--line);
}
.head-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--head-h); }
.brand { display: flex; flex-direction: column; gap: 6px; }
.brand-name { font: 400 26px/1 var(--display); letter-spacing: 0.01em; color: var(--text); }
.brand-sub { font: 500 10px/1 var(--sans); letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.nav-list { display: flex; gap: clamp(16px, 2.2vw, 34px); list-style: none; font: 400 14px/1 var(--sans); }
.nav-list a { color: var(--muted); position: relative; padding-block: 6px; }
.nav-list a::after {
	content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--brass);
	transform: scaleX(0); transform-origin: right; transition: transform 0.6s var(--ease);
}
.nav-list a:hover, .nav-list .current-menu-item > a, .nav-list .current-menu-ancestor > a, .nav-list .current-page-ancestor > a { color: var(--text); }
.nav-list a:hover::after, .nav-list .current-menu-item > a::after, .nav-list .current-page-ancestor > a::after { transform: scaleX(1); transform-origin: left; }
.head-phone {
	font: 500 13px/1 var(--sans); letter-spacing: 0.06em; padding: 13px 20px;
	border: 1px solid var(--brass); color: var(--brass); white-space: nowrap;
	transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
.head-phone:hover { background: var(--brass); color: var(--bg); }
.menu-btn { display: none; width: 48px; height: 48px; border: 1px solid var(--line); background: transparent; cursor: pointer; place-items: center; }
.menu-btn-lines, .menu-btn-lines::before, .menu-btn-lines::after { display: block; width: 20px; height: 1px; background: var(--text); content: ""; }
.menu-btn-lines { position: relative; }
.menu-btn-lines::before { position: absolute; top: -6px; }
.menu-btn-lines::after { position: absolute; top: 6px; }

body:not(.home) .site-main { padding-top: var(--head-h); }

@media (max-width: 1000px) {
	.nav, .head-phone { display: none; }
	.menu-btn { display: grid; }
	:root { --head-h: 72px; }
	.brand-name { font-size: 22px; }
}

/* ---------- Menu mobile (guida navigation-drawer) ---------- */

.Drawer {
	--drawer-width: min(22em, 84dvw);
	--drawer-backdrop: 0;
	width: auto; height: auto; max-width: none; max-height: none;
	inset: 0; margin: 0; padding: 0;
	background: transparent; border: 0; overflow: visible;
}
.Drawer::backdrop { background: #000; opacity: calc(var(--drawer-backdrop) / 1.6); }
.Drawer-scroller {
	position: relative; display: grid; grid-template-columns: var(--drawer-width) 100%;
	height: 100%; overflow-x: scroll; overscroll-behavior: none; scrollbar-width: none;
	scroll-snap-type: x mandatory;
}
@media (prefers-reduced-motion: no-preference) {
	.Drawer-scroller { scroll-behavior: smooth; }
}
.Drawer-scroller::after { content: ""; scroll-snap-align: end; scroll-initial-target: nearest; }
.Drawer-sheet {
	display: flex; flex-direction: column; gap: 28px; height: 100svh; padding: 28px 24px;
	background: var(--bg-2); border-right: 1px solid var(--line);
	overflow-y: auto; scroll-snap-align: start; scrollbar-width: none;
}
.drawer-list { list-style: none; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.drawer-list a { display: block; padding: 18px 0; border-bottom: 1px solid var(--line); font: 400 24px/1.2 var(--display); }
.Drawer-sheet .btn { justify-content: center; margin-top: auto; }

@supports (animation-timeline: scroll()) {
	.Drawer { timeline-scope: --drawer-fade; animation: fade-drawer-backdrop linear both; animation-timeline: --drawer-fade; }
	.Drawer-scroller { scroll-timeline: --drawer-fade x; }
	@property --drawer-backdrop { syntax: "<number>"; inherits: true; initial-value: 0; }
	@keyframes fade-drawer-backdrop { 0% { --drawer-backdrop: 1; } 100% { --drawer-backdrop: 0; } }
}

/* ---------- Testata delle pagine interne ---------- */

.page-head { padding-block: clamp(56px, 8vw, 120px) clamp(32px, 4vw, 56px); }
.page-head .h1-page { margin-top: 24px; max-width: 20ch; }
.page-head .lede { margin-top: 28px; }
.crumbs { font: 500 11px/1.6 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brass); }
.crumbs .breadcrumb_last { color: var(--brass); }

/* ---------- Testo dei contenuti (articoli e pagine) ---------- */

.prose { max-width: 720px; font: 300 19px/1.75 var(--sans); color: color-mix(in oklch, var(--text) 88%, var(--muted)); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font: 400 clamp(28px, 2.6vw, 38px)/1.15 var(--display); color: var(--text); margin-top: 2em; }
.prose h3 { font: 500 21px/1.35 var(--sans); color: var(--text); margin-top: 1.8em; }
.prose h4 { font: 500 18px/1.4 var(--sans); color: var(--text); margin-top: 1.6em; }
.prose a { color: var(--brass); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--brass-hi); }
.prose strong, .prose b { font-weight: 500; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--brass); }
.prose blockquote { margin: 1.6em 0; padding-left: 24px; border-left: 1px solid var(--brass); font: italic 400 24px/1.45 var(--display); color: var(--text); }
.prose img, .prose figure { margin-block: 1.6em; }
.prose figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.4em; }

/* ---------- Elenco articoli (home, archivi, box correlati) ---------- */

.post-list { border-top: 1px solid var(--line); }
.post-row {
	position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr) 30px;
	gap: 28px; align-items: baseline; padding: 28px 0; border-bottom: 1px solid var(--line);
}
.post-row::after {
	content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--brass);
	transform: scaleX(0); transform-origin: left; transition: transform 0.9s var(--ease);
}
.post-row:hover::after { transform: scaleX(1); }
.post-row-d { font: 500 12px/1 var(--sans); letter-spacing: 0.14em; color: var(--muted); }
.post-row-t { font: 400 clamp(20px, 1.8vw, 27px)/1.28 var(--display); transition: translate 0.6s var(--ease); }
.post-row:hover .post-row-t { translate: 10px 0; }
.post-row-a { justify-self: end; color: var(--brass); }
@media (max-width: 760px) {
	.post-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
	.post-row-a { display: none; }
}

.pagination .nav-links, .nav-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 48px; }
.page-numbers { display: inline-grid; place-items: center; min-width: 48px; height: 48px; padding: 0 14px; border: 1px solid var(--line); font: 500 14px/1 var(--sans); color: var(--muted); }
.page-numbers.current { border-color: var(--brass); color: var(--brass); }
a.page-numbers:hover { border-color: var(--brass); color: var(--text); }

/* ---------- Pie' di pagina ---------- */

.site-foot { border-top: 1px solid var(--line); padding: clamp(48px, 6vw, 80px) 0 40px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.foot-addr { margin-top: 16px; font: 300 14px/1.7 var(--sans); color: var(--muted); }
.foot-addr a { color: var(--muted); }
.foot-h { font: 500 11px/1 var(--sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass); margin-bottom: 18px; }
.foot-l { list-style: none; display: flex; flex-direction: column; gap: 10px; font: 400 14px/1.4 var(--sans); }
.foot-l a { color: var(--muted); }
.foot-l a:hover { color: var(--text); }
.foot-legal { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font: 400 12.5px/1.7 var(--sans); color: var(--muted); }
/* Il telefono qui lo rende cliccabile Statella Core: sottolineato, per distinguerlo dal testo. */
.foot-legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) {
	.foot-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Comparsa allo scroll (guida scroll-entry-exit-effects) ----------
   Dove il browser supporta le animazioni legate allo scroll, le fa il CSS.
   Altrove (Firefox) site.js aggiunge html.rv-js e un IntersectionObserver
   mette la classe .in. Senza JavaScript il contenuto resta visibile. */

@keyframes rv-in { from { opacity: 0; translate: 0 32px; } }

@media (prefers-reduced-motion: no-preference) {
	@supports ((animation-timeline: view()) and (animation-range: entry)) {
		.rv {
			animation: rv-in linear backwards;
			animation-timeline: view();
			animation-range: entry 0% entry 85%;
		}
	}
	html.rv-js .rv { transition: opacity 1.1s var(--ease), translate 1.1s var(--ease); }
	html.rv-js .rv:not(.in) { opacity: 0; translate: 0 32px; }
}

/* Parole che si accendono scorrendo (site.js, elementi [data-scrub]) */
.sw { transition: opacity 0.45s linear; }
.scrub-on .sw { opacity: 0.16; }
.scrub-on .sw.lit { opacity: 1; }

/* ---------- Transizioni tra pagine (guida cross-document-transitions) ---------- */

@media (prefers-reduced-motion: no-preference) {
	@view-transition { navigation: auto; }
	::view-transition-old(root) { animation: 0.35s var(--ease) both vt-out; }
	::view-transition-new(root) { animation: 0.6s var(--ease) both vt-in; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; translate: 0 18px; } }

/* ---------- Banner cookie (Complianz) ----------
   Complianz disegna il banner con le sue variabili CSS: qui si sovrascrivono
   (doppia classe per vincere sul suo foglio di stile), senza toccare le
   impostazioni del plugin. "Accetta" e "Nega" hanno lo stesso aspetto: il
   Garante chiede che rifiutare sia facile ed evidente quanto accettare. */

.cmplz-cookiebanner.cmplz-cookiebanner {
	--cmplz_banner_background_color: oklch(0.21 0.007 70);
	--cmplz_banner_border_color: oklch(0.34 0.008 70);
	--cmplz_banner_border_width: 1px;
	--cmplz_banner_border_radius: 0;
	--cmplz_text_color: oklch(0.86 0.012 82);
	--cmplz_hyperlink_color: oklch(0.77 0.085 80);
	--cmplz_button_border_radius: 0;
	--cmplz_button_accept_background_color: transparent;
	--cmplz_button_accept_border_color: oklch(0.77 0.085 80);
	--cmplz_button_accept_text_color: oklch(0.77 0.085 80);
	--cmplz_button_deny_background_color: transparent;
	--cmplz_button_deny_border_color: oklch(0.77 0.085 80);
	--cmplz_button_deny_text_color: oklch(0.77 0.085 80);
	--cmplz_button_settings_background_color: transparent;
	--cmplz_button_settings_border_color: oklch(0.34 0.008 70);
	--cmplz_button_settings_text_color: oklch(0.95 0.012 85);
	--cmplz_slider_active_color: oklch(0.77 0.085 80);
	--cmplz_slider_inactive_color: oklch(0.34 0.008 70);
	--cmplz_slider_bullet_color: oklch(0.95 0.012 85);
	--cmplz_category_header_always_active_color: oklch(0.77 0.085 80);
	--cmplz_text_font_size: 13px;
	--cmplz_link_font_size: 12.5px;
	font-family: var(--sans);
	box-shadow: 0 24px 60px oklch(0 0 0 / 0.45);
}
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-title { font: 400 20px/1.2 var(--display); color: var(--text); }
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-btn {
	font: 500 13px/1 var(--sans); letter-spacing: 0.06em;
	transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.cmplz-cookiebanner.cmplz-cookiebanner :is(.cmplz-accept, .cmplz-deny):hover { background: var(--brass); color: var(--bg); }
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-view-preferences:hover,
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-save-preferences:hover { border-color: var(--brass); }
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-close { color: var(--text); }
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-category { background: var(--bg); }
.cmplz-cookiebanner.cmplz-cookiebanner :is(.cmplz-category-title, .cmplz-description) { color: var(--text); }
/* Il pulsante "Gestisci consenso" che resta in basso dopo la scelta. */
#cmplz-manage-consent .cmplz-manage-consent { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-bottom: 0; font: 500 12px/1 var(--sans); letter-spacing: 0.06em; }

/* ---------- Moduli (Contact Form 7 e ricerca) ---------- */

input[type="text"], input[type="email"], input[type="tel"], input[type="search"], textarea, select {
	width: 100%; padding: 16px 18px; background: var(--bg-2); color: var(--text);
	border: 1px solid var(--line); border-radius: 0; font: 300 17px/1.4 var(--sans);
	transition: border-color 0.3s;
}
input:focus, textarea:focus, select:focus { border-color: var(--brass); outline: none; }
.search-form { display: flex; gap: 0; }
.search-form .search-field { flex: 1 1 auto; min-width: 0; }
.search-form .search-field::-webkit-search-cancel-button { filter: grayscale(1); }
.search-form .search-submit { flex: none; }
input[type="submit"], button[type="submit"] {
	padding: 19px 30px; background: var(--brass); color: var(--bg); border: 0; cursor: pointer;
	font: 500 14px/1 var(--sans); letter-spacing: 0.06em; transition: background 0.3s;
}
input[type="submit"]:hover, button[type="submit"]:hover { background: var(--brass-hi); }
