/* ==========================================================================
   SHS Italia – pagine interne (vecchio kit Elementor)
   Lavora insieme a inc/normalize.php, che aggiunge le classi shs-eyebrow--auto
   e shs-title-auto ai titoli e rimuove animazioni/parallasse.
   ========================================================================== */

/* Niente animazioni, ovunque (rete di sicurezza lato CSS) ------------------ */
body.shs .elementor-invisible { visibility: visible !important; opacity: 1 !important; }
body.shs .elementor-element.animated,
body.shs .elementor-element .animated { animation: none !important; }
body.shs .elementor-motion-effects-layer { transform: none !important; }
body.shs [class*="elementor-animation-"]:hover { transform: none !important; }
body.shs .elementor-widget-lottie { display: none !important; }

/* Titoli ------------------------------------------------------------------ */
body.shs .elementor-widget.shs-eyebrow--auto .elementor-heading-title {
	display: inline-flex; align-items: center; gap: 10px; /* inline: segue l'allineamento del widget */
	font-size: 12px !important; font-weight: 600 !important; line-height: 1.3;
	letter-spacing: .08em !important; text-transform: uppercase; color: var(--shs-navy) !important;
}
body.shs .elementor-widget.shs-eyebrow--auto .elementor-heading-title::before {
	content: ""; flex-shrink: 0; width: 6px; height: 6px; background: currentColor;
}
body.shs .elementor-widget.shs-title-auto .elementor-heading-title {
	font-weight: 700 !important; line-height: 1.1; letter-spacing: -.03em !important; text-transform: none !important;
}

/* Testi -------------------------------------------------------------------- */
body.shs:not(.home) .elementor-widget-text-editor.elementor-widget { line-height: 1.7; }
body.shs:not(.home) .elementor-widget-text-editor h1,
body.shs:not(.home) .elementor-widget-text-editor h2,
body.shs:not(.home) .elementor-widget-text-editor h3,
body.shs:not(.home) .elementor-widget-text-editor h4 {
	font-weight: 700; line-height: 1.2; letter-spacing: -.025em;
	margin: 1.4em 0 .5em; color: var(--shs-ink);
}
body.shs:not(.home) .elementor-widget-text-editor h1 { font-size: clamp(28px, 3vw, 40px); }
body.shs:not(.home) .elementor-widget-text-editor h2 { font-size: clamp(24px, 2.5vw, 32px); }
body.shs:not(.home) .elementor-widget-text-editor h3 { font-size: clamp(20px, 2vw, 24px); }
body.shs:not(.home) .elementor-widget-text-editor h1:first-child,
body.shs:not(.home) .elementor-widget-text-editor h2:first-child,
body.shs:not(.home) .elementor-widget-text-editor h3:first-child { margin-top: 0; }
body.shs:not(.home) .elementor-widget-text-editor img { max-width: 100%; height: auto; border-radius: var(--shs-radius); }
body.shs:not(.home) .elementor-widget-text-editor ul { padding-left: 1.2em; }
body.shs:not(.home) .elementor-widget-text-editor li { margin-bottom: .35em; }
body.shs:not(.home) .elementor-widget-text-editor a { text-decoration: underline; text-underline-offset: 3px; }
body.shs:not(.home) .elementor-widget-text-editor table {
	display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse;
	margin: 1.2em 0; font-size: 15px;
}
body.shs:not(.home) .elementor-widget-text-editor th,
body.shs:not(.home) .elementor-widget-text-editor td { padding: 10px 12px; border: 1px solid var(--shs-line); text-align: left; vertical-align: top; }
body.shs:not(.home) .elementor-widget-text-editor th { background: var(--shs-bg); font-weight: 600; }
/* Tabelle incollate da Excel/Sheets: via altezze e larghezze fisse, scorrimento interno */
body.shs:not(.home) .elementor-widget-text-editor table { width: 100% !important; height: auto !important; max-height: 75vh; }
body.shs:not(.home) .elementor-widget-text-editor table tr,
body.shs:not(.home) .elementor-widget-text-editor table td,
body.shs:not(.home) .elementor-widget-text-editor table th { height: auto !important; width: auto !important; }
body.shs:not(.home) .elementor-widget-text-editor table tbody { display: table; width: 100%; }
body.shs:not(.home) .elementor-widget-text-editor table td:first-child { font-weight: 600; color: var(--shs-ink); white-space: nowrap; }
body.shs:not(.home) .elementor-widget-text-editor table tr:nth-child(even) td { background: #fafbfc; }

/* Pulsanti del vecchio kit ------------------------------------------------ */
body.shs:not(.home) .elementor-widget-button:not([class*="shs-btn-"]) .elementor-button {
	min-height: 48px; padding: 14px 24px;
	border-radius: var(--shs-radius-sm) !important; box-shadow: none !important;
	font-weight: 600; font-size: 15px; letter-spacing: 0; text-transform: none;
}

/* Box (icon box, image box, flip box) ------------------------------------ */
body.shs:not(.home) .elementor-icon-box-title,
body.shs:not(.home) .elementor-image-box-title,
body.shs:not(.home) .elementor-flip-box__layer__title { font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
body.shs:not(.home) .elementor-icon-box-description,
body.shs:not(.home) .elementor-image-box-description { line-height: 1.6; }
body.shs:not(.home) .elementor-image-box-img img { border-radius: var(--shs-radius); }
body.shs:not(.home) .elementor-flip-box__layer { border-radius: var(--shs-radius); }

/* Moduli (contatti, telefonia) ------------------------------------------- */
body.shs .elementor-form .elementor-field-textual,
body.shs .elementor-form select { min-height: 48px; border-radius: var(--shs-radius-sm); }
body.shs .elementor-form .elementor-button { min-height: 48px; border-radius: var(--shs-radius-sm); font-weight: 600; }
body.shs .elementor-widget-google_maps iframe { border-radius: var(--shs-radius); }

/* Mobile ------------------------------------------------------------------- */
@media (max-width: 767px) {
	/* Titoli principali: niente misure desktop su schermi piccoli */
	body.shs .elementor-widget.shs-title-auto h1.elementor-heading-title { font-size: clamp(28px, 8vw, 34px) !important; line-height: 1.12 !important; }
	body.shs .elementor-widget.shs-title-auto h2.elementor-heading-title,
	body.shs .elementor-widget.shs-title-auto .elementor-heading-title { font-size: clamp(24px, 7vw, 30px) !important; line-height: 1.15 !important; }
	body.shs:not(.home) .elementor-widget-heading .elementor-heading-title { letter-spacing: 0 !important; overflow-wrap: anywhere; }
	body.shs .elementor-widget.shs-eyebrow--auto .elementor-heading-title { font-size: 11px !important; }

	/* Spaziatori enormi del vecchio kit */
	body.shs:not(.home) .elementor-widget-spacer .elementor-spacer-inner { max-height: 48px; }

	/* Testi leggibili e margini laterali costanti */
	body.shs:not(.home) .elementor-widget-text-editor.elementor-widget { font-size: 16px !important; line-height: 1.65 !important; }
	body.shs:not(.home) .elementor-section > .elementor-container > .elementor-column > .elementor-widget-wrap { padding-left: 16px; padding-right: 16px; }
	body.shs:not(.home) .elementor-section .elementor-inner-section > .elementor-container > .elementor-column > .elementor-widget-wrap { padding-left: 0; padding-right: 0; }

	/* Niente sfondi "fixed" (su iOS vengono sgranati) */
	body.shs .elementor-section,
	body.shs .elementor-column > .elementor-widget-wrap { background-attachment: scroll !important; }

	/* Tabelle: la prima colonna può andare a capo */
	body.shs:not(.home) .elementor-widget-text-editor table td:first-child { white-space: normal; }
	body.shs:not(.home) .elementor-widget-text-editor table { font-size: 14px; }

	/* Pulsanti a tutta larghezza */
	body.shs:not(.home) .elementor-widget-button:not([class*="shs-btn-"]) .elementor-button { width: 100%; justify-content: center; }
}

/* ==========================================================================
   Formato editoriale (inc/editorial.php): capitoli numerati e indice
   ========================================================================== */
body.shs .shs-prose { counter-reset: shs-ch; font-size: 17px; line-height: 1.75; color: var(--shs-text); }
body.shs .shs-prose--articolo { max-width: 780px; margin-left: auto; margin-right: auto; }
body.shs .shs-prose--articolo > p:first-of-type { font-size: 20px; line-height: 1.6; color: var(--shs-ink); }
body.shs .shs-prose p { margin: 0 0 1.1em; }

/* Capitoli */
body.shs .shs-prose h2.shs-ch {
	counter-increment: shs-ch;
	position: relative;
	margin: 2.6em 0 .7em; padding-top: 1.4em;
	border-top: 1px solid var(--shs-line);
	font-weight: 700;
	font-size: clamp(24px, 2.6vw, 32px); line-height: 1.2; letter-spacing: -.03em;
	color: var(--shs-ink); text-transform: none; scroll-margin-top: 110px;
}
body.shs .shs-prose h2.shs-ch::before {
	content: counter(shs-ch, decimal-leading-zero);
	display: block; margin-bottom: .6em;
	font-size: 13px; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums;
	color: var(--shs-navy);
}
body.shs .shs-prose .shs-toc + h2.shs-ch,
body.shs .shs-prose > h2.shs-ch:first-child { margin-top: 1.4em; }
body.shs .shs-prose h3 {
	margin: 1.8em 0 .5em;
	font-weight: 600; font-size: clamp(19px, 2vw, 22px); line-height: 1.3; letter-spacing: -.02em !important;
	color: var(--shs-ink); text-transform: none; letter-spacing: 0;
}
body.shs .shs-prose h4 { margin: 1.5em 0 .4em; font-weight: 600; font-size: 18px; color: var(--shs-ink); }

/* Elenchi puliti (al posto delle emoji) */
body.shs .shs-prose ul { list-style: none; padding-left: 0 !important; margin: 0 0 1.3em; }
body.shs .shs-prose ul > li { position: relative; padding-left: 26px; margin-bottom: .55em; }
body.shs .shs-prose ul > li::before {
	content: ""; position: absolute; left: 4px; top: .7em;
	width: 6px; height: 6px; background: var(--shs-navy);
}
body.shs .shs-prose ol:not(.shs-toc__list) { padding-left: 1.4em; margin: 0 0 1.3em; }
body.shs .shs-prose ol:not(.shs-toc__list) > li { margin-bottom: .55em; padding-left: .3em; }
body.shs .shs-prose ol:not(.shs-toc__list) > li::marker { font-weight: 600; color: var(--shs-navy); }
body.shs .shs-prose strong { color: var(--shs-ink); font-weight: 600; }
body.shs .shs-prose blockquote {
	margin: 1.6em 0; padding: 4px 0 4px 24px; border-left: 2px solid var(--shs-navy);
	background: none; font-size: 19px; line-height: 1.6; color: var(--shs-ink);
}
body.shs .shs-prose blockquote p:last-child { margin-bottom: 0; }
body.shs .shs-prose img { border-radius: var(--shs-radius); }

/* Indice */
body.shs .shs-toc {
	margin: 0 0 2.2em; padding: 24px 28px;
	background: #fff; border: 1px solid var(--shs-line); border-top: 2px solid var(--shs-navy); border-radius: var(--shs-radius);
}
body.shs .shs-toc__title {
	display: flex; align-items: center; gap: 10px; margin: 0 0 16px !important;
	font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--shs-muted);
}
body.shs .shs-toc__list { counter-reset: shs-toc; list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
body.shs .shs-toc__list li { counter-increment: shs-toc; break-inside: avoid; margin: 0 0 8px; padding: 0; }
body.shs .shs-toc__list li::before { display: none; }
body.shs .shs-toc__list a {
	display: flex; gap: 10px; align-items: baseline;
	font-size: 15px; line-height: 1.4; font-weight: 500; color: var(--shs-ink) !important; text-decoration: none !important;
}
body.shs .shs-toc__list a::before {
	content: counter(shs-toc, decimal-leading-zero);
	flex-shrink: 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--shs-navy);
}
body.shs .shs-toc__list a:hover { color: var(--shs-navy) !important; text-decoration: underline !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media (max-width: 767px) {
	body.shs .shs-prose { font-size: 16px; }
	body.shs .shs-prose--articolo > p:first-of-type { font-size: 18px; }
	body.shs .shs-toc { padding: 18px 18px; }
	body.shs .shs-toc__list { columns: 1; }
	body.shs .shs-prose h2.shs-ch { scroll-margin-top: 80px; }
}

/* Sottotitolo di apertura degli articoli (ex H1 nel testo) */
body.shs .shs-prose h2.shs-intro,
body.shs h2.shs-intro {
	margin: 0 0 .8em; padding: 0; border: 0;
	font-weight: 600; font-size: clamp(21px, 2.2vw, 26px); line-height: 1.35;
	color: var(--shs-ink); text-transform: none; letter-spacing: -.025em;
}
body.shs .shs-prose h2.shs-intro::before { display: none; }
