/* ==========================================================================
   V6.4-BLUEPRINT-DRAWINGS-2026-07-10 — Disegni tecnici potenziati (ES)
   --------------------------------------------------------------------------
   Layer ADDITIVO sopra V6.2/V6.1/V6. Compiti CSS:
   - rimozione (failsafe) del blueprint dell'hero della HOME
     (.es-hbp / .es-hbp-back): il JS V6.4 li toglie dal DOM, questo è il
     doppio strato di sicurezza se la PATCH DB non fosse applicata;
   - disegno .v61-draw esteso ai <circle> (bolle/bulloni) e sequenza per-gruppo
     via --wt (struttura -> quote -> annotazioni).

   FIX 2026-07-10 (caricamento corretto desktop+mobile):
   Il disegno NON è più legato alla posizione di scroll (--v6-sp). La vecchia
   formula `stroke-dashoffset: clamp(0, 1-(--v6-sp - --wt)*1.9, 1)` raggiungeva
   il fine-corsa solo per --v6-sp ~0.58..0.95, valori che la sezione tocca solo
   quando è ormai quasi fuori dallo schermo: quote e annotazioni (--wt .30/.42)
   non finivano MAI di disegnarsi mentre il disegno era visibile -> appariva
   incompleto/sbiadito (peggio su mobile, sezioni più alte).
   Ora ogni gruppo si costruisce UNA volta, a tempo, quando la sezione entra nel
   viewport (classe one-shot .v6-lit già scritta dal motore V6, mai rimossa):
   deterministico, identico su desktop e mobile, e resta disegnato a riposo.
   Fine-corsa statico per prefers-reduced-motion + base no-JS tutta visibile.
   Rollback: eliminare questo file + v6-4-blueprint-drawings.js + blocco enqueue
   (la V6.2 riprende identica: i disegni tornano quelli semplici del DB).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HERO HOME — rimozione blueprint tecnico "al caricamento" (.es-hbp/back)
   Il JS li rimuove dal DOM; questa regola è la cintura di sicurezza.
   NON tocca la finestra dell'immagine (.es-fig / .es-narr / .tag): resta.
   -------------------------------------------------------------------------- */
html.es-v64 .es .hero .es-hbp,
html.es-v64 .es .hero .es-hbp-back { display: none !important; }

/* --------------------------------------------------------------------------
   2. .v61-draw — base disegnata + costruzione a reveal (one-shot)
   base: tutto disegnato (no-JS / no-motion / reduced-motion = tutto visibile)
   -------------------------------------------------------------------------- */
html.es-v64 .v61-draw path,
html.es-v64 .v61-draw line,
html.es-v64 .v61-draw polyline,
html.es-v64 .v61-draw circle {
	stroke-dasharray: 1;
	stroke-dashoffset: 0;
}

/* motion ON, PRIMA del reveal: tratto nascosto e pronto (etichette invisibili).
   Batte per source-order la regola scroll V6.1 di pari specificità: niente
   stato intermedio governato da --v6-sp. */
html.es-v64.es-v6-motion .s:not(.v6-lit) .v61-draw path,
html.es-v64.es-v6-motion .s:not(.v6-lit) .v61-draw line,
html.es-v64.es-v6-motion .s:not(.v6-lit) .v61-draw polyline,
html.es-v64.es-v6-motion .s:not(.v6-lit) .v61-draw circle {
	stroke-dashoffset: 1;
}
html.es-v64.es-v6-motion .s:not(.v6-lit) .v61-draw text { opacity: 0; }

/* motion ON, AL reveal: ogni gruppo si disegna in sequenza (ritardo = --wt) e
   resta disegnato (fill-mode both). L'animazione vince sempre sulle
   dichiarazioni normali V6.1/V6.4: nessun conflitto di specificità, nessun
   "cancella e ridisegna" quando la sezione esce ed entra di nuovo. */
html.es-v64.es-v6-motion .s.v6-lit .v61-draw path,
html.es-v64.es-v6-motion .s.v6-lit .v61-draw line,
html.es-v64.es-v6-motion .s.v6-lit .v61-draw polyline,
html.es-v64.es-v6-motion .s.v6-lit .v61-draw circle {
	animation: esV64Draw var(--esv64-dur, 1.5s) cubic-bezier(.33, 0, .2, 1) both;
	animation-delay: calc(var(--wt, 0) * var(--esv64-stagger, 3.4s));
}
html.es-v64.es-v6-motion .s.v6-lit .v61-draw text {
	animation: esV64Fade .7s ease-out both;
	animation-delay: calc(var(--wt, 0) * var(--esv64-stagger, 3.4s) + .15s);
}
@keyframes esV64Draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes esV64Fade { from { opacity: 0; } to { opacity: 1; } }

/* colore etichette: oro leggibile su chiaro, oro caldo su scuro
   (batte l'attributo fill del markup: il CSS vince sui presentation attributes). */
html.es-v64 .v61-draw text { fill: #8a6d14; }
html.es-v64 .s.dark .v61-draw text { fill: #E9C87E; }

/* i disegni ricchi non devono mai generare scroll orizzontale né coprire il
   contenuto: sono decorazioni aria-hidden. */
html.es-v64 .v61-draw { max-width: 100%; height: auto; margin-top: clamp(34px, 5vw, 60px); }

/* --------------------------------------------------------------------------
   3. prefers-reduced-motion — fine-corsa statico completo (disegni fermi)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html.es-v64 .v61-draw path,
	html.es-v64 .v61-draw line,
	html.es-v64 .v61-draw polyline,
	html.es-v64 .v61-draw circle {
		stroke-dashoffset: 0 !important;
		animation: none !important;
	}
	html.es-v64 .v61-draw text { opacity: 1 !important; animation: none !important; }
}


/* ==========================================================================
   ES-POLISH 2026-07-11 — Link evidenziati + micro-animazioni universali
   Layer additivo (nessuna dipendenza JS). Rollback: eliminare questo blocco.
   ========================================================================== */
/* 1. Link nel corpo dei contenuti: sempre evidenziati e coerenti */
.es a.es-xlink,
.es p a:not(.btn), .es li a:not(.btn), .es .note a, .es .feat a:not(.btn),
.es .card a:not(.btn), .es .faq a, .es dd a, .es td a {
	color: #0B3D66; font-weight: 600; text-decoration: underline;
	text-decoration-color: rgba(201,155,75,.55); text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	transition: color .25s ease, text-decoration-color .25s ease;
}
.es a.es-xlink:hover, .es p a:not(.btn):hover, .es li a:not(.btn):hover,
.es .note a:hover, .es .feat a:not(.btn):hover, .es .card a:not(.btn):hover,
.es .faq a:hover, .es dd a:hover, .es td a:hover {
	color: #8a6d14; text-decoration-color: #8a6d14;
}
.es .s.dark a.es-xlink, .es .s.dark p a:not(.btn), .es .s.dark li a:not(.btn),
.es .s.dark .note a, .es .s.dark .feat a:not(.btn), .es .s.dark .card a:not(.btn) {
	color: #E9C87E; text-decoration-color: rgba(233,200,126,.45);
}
.es .s.dark a.es-xlink:hover, .es .s.dark p a:not(.btn):hover,
.es .s.dark li a:not(.btn):hover, .es .s.dark .note a:hover,
.es .s.dark .feat a:not(.btn):hover, .es .s.dark .card a:not(.btn):hover {
	color: #fff; text-decoration-color: #E9C87E;
}
/* 2. Micro-animazioni universali (bottoni, card, note, chip, step, moduli) */
.es .btn {
	transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s ease,
	            background-color .25s ease, color .25s ease, border-color .25s ease;
}
.es .card, .es .note, .es .feat > div, .es .step, .es .es-quick .qk,
.es .chips .chip, .es .es-mod, .es .agent, .es .es-hub a {
	transition: transform .3s cubic-bezier(.2,.7,.3,1), box-shadow .3s ease, border-color .3s ease;
}
@media (hover: hover) {
	.es .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px rgba(201,155,75,.55); }
	.es .btn:active { transform: translateY(0); transition-duration: .1s; }
	.es .card:hover, .es .feat > div:hover, .es .step:hover, .es .es-mod:hover,
	.es .agent:hover, .es .es-hub a:hover {
		transform: translateY(-3px);
		box-shadow: 0 14px 30px -18px rgba(11,61,102,.35);
		border-color: rgba(201,155,75,.55);
	}
	.es .note:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -18px rgba(11,61,102,.3); }
	.es .chips .chip:hover, .es .es-quick .qk:hover {
		transform: translateY(-2px); border-color: #C99B4B;
		box-shadow: 0 8px 18px -12px rgba(201,155,75,.5);
	}
}
/* 3. Campi modulo: focus curato */
.es input, .es textarea, .es select { transition: border-color .25s ease, box-shadow .25s ease; }
.es input:focus, .es textarea:focus, .es select:focus {
	border-color: #C99B4B; box-shadow: 0 0 0 3px rgba(201,155,75,.22); outline: none;
}
/* 4. Accessibilità: focus visibile coerente */
.es a:focus-visible, .es .btn:focus-visible, .es .chips .chip:focus-visible {
	outline: 2px solid #C99B4B; outline-offset: 2px;
}
/* 5. Reduced motion: niente trasformazioni */
@media (prefers-reduced-motion: reduce) {
	.es .btn, .es .card, .es .note, .es .feat > div, .es .step, .es .es-quick .qk,
	.es .chips .chip, .es .es-mod, .es .agent, .es .es-hub a { transition: none; }
	.es .btn:hover, .es .card:hover, .es .note:hover, .es .feat > div:hover,
	.es .step:hover, .es .chips .chip:hover, .es .es-quick .qk:hover,
	.es .es-mod:hover, .es .agent:hover, .es .es-hub a:hover { transform: none; }
}


/* ==========================================================================
   ES-LANG-SWITCHER v2 2026-07-11 — Selettore lingua GTranslate nell'header
   Chip SOLO bandiera; tendina solo verso il basso, alta, voci bandiera+nome
   con apertura a cascata. Rollback: rimuovere questo blocco.
   ========================================================================== */
.main-navigation .menu-item-gtranslate { position: relative; width: 58px; }
.menu-item-gtranslate [class*="gt_container"] {
	position: absolute !important; left: auto !important; right: 10px;
	top: 50%; transform: translateY(-50%);
}
.menu-item-gtranslate .gt_switcher {
	width: auto !important; height: auto !important;
	font-family: inherit !important; line-height: 1 !important;
}
/* --- chip: solo bandiera + freccia --- */
.menu-item-gtranslate .gt_switcher .gt_selected { background: transparent !important; }
.menu-item-gtranslate .gt_switcher .gt_selected a {
	display: flex !important; align-items: center; justify-content: center;
	width: 42px !important; height: 42px !important; box-sizing: border-box;
	padding: 0 !important; border-radius: 50% !important;
	border: none !important;
	background: transparent !important;
	font-size: 0 !important; color: transparent !important; /* nasconde il nome, resta la bandiera */
	position: relative;
	transition: border-color .3s ease, box-shadow .3s ease, background-color .3s ease;
}
.menu-item-gtranslate .gt_switcher .gt_selected a img {
	width: 36px !important; height: 36px !important; border-radius: 50%;
	object-fit: cover; box-shadow: 0 1px 5px rgba(7,26,47,.28);
	transition: transform .3s cubic-bezier(.2,.7,.3,1);
}
.menu-item-gtranslate .gt_switcher .gt_selected a:hover,
.menu-item-gtranslate .gt_switcher .gt_selected a.open {
	border: none !important; background: transparent !important;
	box-shadow: none;
}
.menu-item-gtranslate .gt_switcher .gt_selected a:hover img,
.menu-item-gtranslate .gt_switcher .gt_selected a.open img {
	transform: scale(1.12);
	box-shadow: 0 0 0 3px rgba(201,155,75,.5), 0 8px 20px -6px rgba(201,155,75,.55);
}
/* freccia animata */
.menu-item-gtranslate .gt_switcher .gt_selected a::after {
	content: none;
}
.menu-item-gtranslate .gt_switcher .gt_selected a.open::after {
	transform: translateY(-30%) rotate(225deg);
}
/* --- tendina: SOLO verso il basso, alta, ancorata a destra --- */
.menu-item-gtranslate .gt_switcher .gt_option {
	position: absolute !important; top: 100% !important; bottom: auto !important;
	left: auto !important; right: 0 !important;
	width: 214px !important; height: auto !important;
	max-height: min(72vh, 480px) !important; overflow-y: auto !important;
	margin-top: 12px; padding: 6px !important; box-sizing: border-box;
	border: 1px solid rgba(201,155,75,.45) !important; border-radius: 16px !important;
	background: #fff !important;
	box-shadow: 0 22px 48px -18px rgba(7,26,47,.4) !important;
	transform-origin: top right;
	animation: esLangDrop .32s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes esLangDrop {
	from { opacity: 0; transform: translateY(-10px) scale(.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* voci: bandiera tonda + nome, apertura a cascata */
.menu-item-gtranslate .gt_switcher .gt_option a {
	display: flex !important; align-items: center; gap: 10px;
	padding: 9px 12px !important; border-radius: 10px; border-bottom: 0 !important;
	font-size: 13.5px !important; font-weight: 500; color: #0B3D66 !important;
	line-height: 1.25 !important; height: auto !important;
	transition: background-color .2s ease, color .2s ease, padding-left .2s ease;
	animation: esLangItem .3s ease both;
}
.menu-item-gtranslate .gt_option a:nth-child(1) { animation-delay: .02s; }
.menu-item-gtranslate .gt_option a:nth-child(2) { animation-delay: .05s; }
.menu-item-gtranslate .gt_option a:nth-child(3) { animation-delay: .08s; }
.menu-item-gtranslate .gt_option a:nth-child(4) { animation-delay: .11s; }
.menu-item-gtranslate .gt_option a:nth-child(5) { animation-delay: .14s; }
.menu-item-gtranslate .gt_option a:nth-child(6) { animation-delay: .17s; }
.menu-item-gtranslate .gt_option a:nth-child(7) { animation-delay: .20s; }
.menu-item-gtranslate .gt_option a:nth-child(8) { animation-delay: .23s; }
.menu-item-gtranslate .gt_option a:nth-child(9) { animation-delay: .26s; }
@keyframes esLangItem {
	from { opacity: 0; transform: translateX(10px); }
	to   { opacity: 1; transform: translateX(0); }
}
.menu-item-gtranslate .gt_switcher .gt_option a img {
	width: 20px !important; height: 20px !important; border-radius: 50%;
	object-fit: cover; box-shadow: 0 0 0 1px rgba(11,61,102,.12);
	transition: transform .25s ease;
}
.menu-item-gtranslate .gt_switcher .gt_option a:hover {
	background: rgba(201,155,75,.13) !important; color: #8a6d14 !important;
	padding-left: 17px !important;
}
.menu-item-gtranslate .gt_switcher .gt_option a:hover img { transform: scale(1.12); }
.menu-item-gtranslate .gt_switcher .gt_option a.gt_current {
	background: rgba(201,155,75,.18) !important; font-weight: 700 !important;
}
/* scrollbar sottile e coerente */
.menu-item-gtranslate .gt_option::-webkit-scrollbar { width: 6px; }
.menu-item-gtranslate .gt_option::-webkit-scrollbar-thumb { background: rgba(201,155,75,.5); border-radius: 3px; }
.menu-item-gtranslate .gt_option::-webkit-scrollbar-track { background: transparent; }
/* mobile: dentro il menu hamburger, flusso statico */
@media (max-width: 768px) {
	.main-navigation .menu-item-gtranslate {
		width: 100%; padding: 12px 0;
		display: flex; justify-content: center;
		background: transparent !important;
	}
	.menu-item-gtranslate [class*="gt_container"] {
		position: static !important; transform: none;
		display: flex; flex-direction: column; align-items: center;
	}
	.menu-item-gtranslate .gt_switcher { display: flex !important; flex-direction: column; align-items: center; }
	.menu-item-gtranslate .gt_switcher .gt_option {
		position: static !important; width: min(280px, 80vw) !important;
		max-height: 340px !important; margin: 10px auto 0;
	}
}
/* accessibilità e reduced motion */
.menu-item-gtranslate .gt_switcher a:focus-visible { outline: 2px solid #C99B4B; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	.menu-item-gtranslate .gt_switcher .gt_option,
	.menu-item-gtranslate .gt_switcher .gt_option a { animation: none; }
	.menu-item-gtranslate .gt_switcher .gt_selected a::after,
	.menu-item-gtranslate .gt_switcher .gt_selected a img { transition: none; }
}
