/*
 * SiteSetter - stile base delle pagine create con l'editor visuale
 * ------------------------------------------------------------------
 * Caricato sia dentro l'editor sia sul sito pubblico. Tutte le classi
 * iniziano con "ssb-" per non scontrarsi con il CSS del tema.
 * I colori principali si cambiano dalle variabili qui sotto (o dal
 * pannello Stili dell'editor sui singoli elementi).
 */
:root {
	--ssb-primary: #1f4fd8;
	--ssb-primary-dark: #163a9f;
	--ssb-accent: #f5a524;
	--ssb-text: #1e2430;
	--ssb-muted: #5d6676;
	--ssb-bg-soft: #f4f6fa;
	--ssb-radius: 14px;
	--ssb-max: 1160px;
}
.ssb-page:where(:not(.ss-theme)) {
	/* sfondo proprio: le pagine dell'editor non ereditano i colori del tema (es. body scuro) */
	background: #fff;
	color: var(--ssb-text);
	font-family: inherit;
	line-height: 1.6;
}
.ssb-page:where(:not(.ss-theme)) *, .ssb-page:where(:not(.ss-theme)) *::before, .ssb-page:where(:not(.ss-theme)) *::after { box-sizing: border-box; }
.ssb-page:where(:not(.ss-theme)) img { max-width: 100%; height: auto; display: block; }

/* Titoli e paragrafi: colori dell'editor anche se il tema ne imposta altri */
/* specificità bassa (:where) così le classi dei blocchi, es. .ssb-eyebrow, hanno la precedenza */
.ssb-page:where(:not(.ss-theme)) :where(h1, h2, h3, h4, h5, h6, p, li, span, small, strong) { color: inherit; }
.ssb-page:where(:not(.ss-theme)) :where(a:not(.ssb-btn)) { color: var(--ssb-primary); }

/* Con un tema installato attivo (Pagine › Temi: classe ss-theme su body e main) comanda il CSS del tema:
   sfondo, colori, caratteri, link, titoli e immagini restano quelli del tema (anche per temi convertiti
   da siti esterni). I blocchi dell'editor (classi ssb-) tengono le loro basi, senza peso sul tema. */
:where(.ss-theme) :where([class*="ssb-"]), :where(.ss-theme) :where([class*="ssb-"]) *,
:where(.ss-theme) :where([class*="ssb-"]) *::before, :where(.ss-theme) :where([class*="ssb-"]) *::after { box-sizing: border-box; }
:where(.ss-theme) :where([class*="ssb-"]) img { max-width: 100%; height: auto; display: block; }
.ssb-section--dark a:not(.ssb-btn), .ssb-section--primary a:not(.ssb-btn), .ssb-hero a:not(.ssb-btn) { color: inherit; }

/* Sezioni e contenitore */
.ssb-section { padding: 72px 20px; position: relative; }
.ssb-section--soft { background: var(--ssb-bg-soft); }
.ssb-section--dark { background: #121826; color: #fff; }
.ssb-section--dark .ssb-muted { color: rgba(255,255,255,.7); }
.ssb-section--primary { background: var(--ssb-primary); color: #fff; }
.ssb-container { max-width: var(--ssb-max); margin: 0 auto; }
.ssb-narrow { max-width: 760px; margin: 0 auto; }
.ssb-center { text-align: center; }
.ssb-muted { color: var(--ssb-muted); }

/* Tipografia */
.ssb-eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ssb-primary); margin: 0 0 12px; }
.ssb-section--dark .ssb-eyebrow, .ssb-section--primary .ssb-eyebrow, .ssb-hero .ssb-eyebrow { color: var(--ssb-accent); }
.ssb-h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.12; margin: 0 0 18px; font-weight: 800; }
.ssb-h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; margin: 0 0 16px; font-weight: 750; }
.ssb-h3 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 10px; font-weight: 700; }
.ssb-lead { font-size: 1.15rem; margin: 0 0 28px; }
.ssb-text { margin: 0 0 16px; }

/* Pulsanti */
.ssb-btn { display: inline-block; padding: 14px 26px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid var(--ssb-primary); background: var(--ssb-primary); color: #fff; transition: transform .15s ease, background .15s ease; cursor: pointer; font-size: 1rem; }
.ssb-btn:hover { background: var(--ssb-primary-dark); border-color: var(--ssb-primary-dark); transform: translateY(-1px); }
.ssb-btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
.ssb-btn--ghost:hover { background: rgba(255,255,255,.12); border-color: currentColor; }
.ssb-btn--accent { background: var(--ssb-accent); border-color: var(--ssb-accent); color: #1e2430; }
.ssb-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ssb-center .ssb-actions { justify-content: center; }

/* Hero */
.ssb-hero { padding: 120px 20px; color: #fff; background: #121826 center/cover no-repeat; position: relative; }
.ssb-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(10,16,30,.85), rgba(10,16,30,.35)); }
.ssb-hero > .ssb-container { position: relative; }
.ssb-hero .ssb-lead { max-width: 620px; color: rgba(255,255,255,.88); }
.ssb-hero--small { padding: 80px 20px; }

/* Griglie */
.ssb-grid { display: grid; gap: 28px; }
.ssb-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ssb-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ssb-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ssb-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.ssb-col { min-height: 40px; }

/* Card */
.ssb-card { background: #fff; border-radius: var(--ssb-radius); padding: 28px; box-shadow: 0 8px 30px rgba(20,30,60,.08); color: var(--ssb-text); }
.ssb-card-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--ssb-bg-soft); color: var(--ssb-primary); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; margin-bottom: 18px; }
.ssb-rounded { border-radius: var(--ssb-radius); }
.ssb-shadow { box-shadow: 0 18px 50px rgba(20,30,60,.16); }

/* Numeri */
.ssb-stat { text-align: center; }
.ssb-stat-number { font-size: 2.6rem; font-weight: 800; color: var(--ssb-primary); line-height: 1; margin: 0 0 8px; }
.ssb-section--dark .ssb-stat-number, .ssb-section--primary .ssb-stat-number { color: var(--ssb-accent); }

/* Testimonianze */
.ssb-quote { font-size: 1.05rem; font-style: italic; margin: 0 0 18px; }
.ssb-person { display: flex; align-items: center; gap: 12px; }
.ssb-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }

/* Elenchi */
.ssb-list { list-style: none; padding: 0; margin: 0 0 24px; }
.ssb-list li { padding: 6px 0 6px 30px; position: relative; }
.ssb-list li::before { content: "✓"; position: absolute; left: 0; top: 6px; color: var(--ssb-primary); font-weight: 800; }

/* FAQ */
.ssb-faq details { border-bottom: 1px solid rgba(0,0,0,.1); padding: 18px 0; }
.ssb-faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.ssb-faq summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--ssb-primary); }
.ssb-faq details[open] summary::after { content: "–"; }
.ssb-faq details p { margin: 12px 0 0; color: var(--ssb-muted); }

/* Galleria */
.ssb-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ssb-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }

/* Video e mappa */
.ssb-embed { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: var(--ssb-radius); overflow: hidden; background: #000; }
.ssb-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Moduli */
.ssb-form { display: grid; gap: 14px; }
.ssb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ssb-form label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: 4px; }
.ssb-form input[type=text], .ssb-form input[type=email], .ssb-form input[type=tel], .ssb-form textarea, .ssb-form select { width: 100%; padding: 12px 14px; border: 1px solid #cfd5df; border-radius: 10px; font: inherit; background: #fff; color: var(--ssb-text); }
.ssb-form textarea { min-height: 140px; resize: vertical; }
.ssb-form .ssb-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.ssb-form-msg { font-weight: 600; min-height: 1.4em; }
.ssb-form-msg.is-ok { color: #1f7a3d; }
.ssb-form-msg.is-error { color: #c62828; }
.ssb-hidden { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Separatori */
.ssb-divider { border: 0; border-top: 1px solid rgba(0,0,0,.12); margin: 32px 0; }
.ssb-spacer { height: 60px; }

/* Responsive */
@media (max-width: 992px) {
	.ssb-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ssb-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
	.ssb-section { padding: 52px 18px; }
	.ssb-hero { padding: 84px 18px; }
	.ssb-split, .ssb-grid-2, .ssb-grid-3, .ssb-grid-4, .ssb-form-row { grid-template-columns: 1fr; }
	.ssb-split { gap: 28px; }
	.ssb-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ================= Header, footer e menu comuni ================= */
/* il contenitore di header e footer non crea un box: "position: sticky" dell'header del tema resta
   relativo alla pagina intera (altrimenti si fermerebbe dopo l'altezza dell'header) */
.ssb-part { display: contents; }
.ssb-header { background: #fff; border-bottom: 1px solid rgba(0,0,0,.08); position: relative; z-index: 50; }
.ssb-header--sticky { position: sticky; top: 0; }
.ssb-header-inner { max-width: var(--ssb-max); margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 24px; }
.ssb-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--ssb-text); text-decoration: none; margin-right: auto; }
.ssb-logo img { height: 40px; width: auto; }
.ssb-header .ssb-btn { padding: 10px 20px; }
.ssb-header--center .ssb-header-inner { flex-direction: column; gap: 10px; }
.ssb-header--center .ssb-logo { margin: 0; }

/* Menu (generato da Admin > Pagine > Menu) */
.ssb-menu, .ssb-submenu { list-style: none; margin: 0; padding: 0; }
.ssb-menu { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ssb-menu-item { position: relative; }
.ssb-menu-item > a, .ssb-menu-item > span { display: block; padding: 8px 12px; border-radius: 8px; color: inherit; text-decoration: none; font-weight: 600; }
.ssb-page .ssb-menu-item > a { color: inherit; }
.ssb-menu-item > a:hover, .ssb-menu-item.is-active > a { background: var(--ssb-bg-soft); color: var(--ssb-primary); }
.ssb-menu-item.has-children > a::after { content: "▾"; margin-left: 6px; font-size: .8em; }
.ssb-submenu { display: none; position: absolute; top: 100%; left: 0; min-width: 210px; background: #fff; border-radius: 10px; box-shadow: 0 12px 30px rgba(20,30,60,.14); padding: 6px; z-index: 60; }
.ssb-submenu .ssb-submenu { top: 0; left: 100%; }
.ssb-menu-item:hover > .ssb-submenu, .ssb-menu-item:focus-within > .ssb-submenu { display: block; }
.ssb-submenu .ssb-menu-item > a { font-weight: 500; }
.ssb-menu-empty { color: var(--ssb-muted); font-size: .9rem; padding: 8px 12px; border: 1px dashed currentColor; border-radius: 8px; }
.ssb-lang-switcher { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.ssb-lang-switcher a { display: block; padding: 6px 8px; border-radius: 6px; font-size: .85rem; font-weight: 700; text-decoration: none; color: inherit; opacity: .8; /* .65 non raggiungeva il contrasto minimo 4.5:1 */ }
.ssb-lang-switcher a.active, .ssb-lang-switcher a:hover { opacity: 1; background: var(--ssb-bg-soft); }
.ssb-burger { display: none; background: none; border: 0; width: 42px; height: 42px; cursor: pointer; padding: 9px; border-radius: 8px; }
.ssb-burger span { display: block; height: 2px; background: currentColor; margin: 5px 0; border-radius: 2px; }

/* Footer */
.ssb-footer { background: #121826; color: rgba(255,255,255,.82); padding: 56px 20px 24px; }
.ssb-footer-inner { max-width: var(--ssb-max); margin: 0 auto; }
.ssb-footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
.ssb-footer h3, .ssb-footer h4 { color: #fff; margin: 0 0 14px; }
.ssb-footer .ssb-menu { flex-direction: column; align-items: flex-start; gap: 0; }
.ssb-footer .ssb-menu-item > a { padding: 4px 0; font-weight: 500; }
.ssb-footer .ssb-menu-item > a:hover { background: none; color: #fff; text-decoration: underline; }
.ssb-footer .ssb-submenu { display: none !important; }
.ssb-footer a { color: #fff; }
.ssb-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 36px; padding-top: 18px; font-size: .9rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 768px) {
	.ssb-burger { display: block; }
	.ssb-header-inner { flex-wrap: wrap; }
	.ssb-header [data-ss-menu], .ssb-header .ssb-header-actions { display: none; width: 100%; }
	.ssb-header.is-menu-open [data-ss-menu], .ssb-header.is-menu-open .ssb-header-actions { display: block; }
	.ssb-header .ssb-menu { flex-direction: column; align-items: stretch; }
	.ssb-submenu { position: static; display: block; box-shadow: none; padding: 0 0 0 14px; }
	.ssb-footer-cols { grid-template-columns: 1fr; }
}

/* ================= Moduli personalizzati (blocco "Modulo", ass_site/config/forms.php) ================= */
.ssb-form input[type=number], .ssb-form input[type=date], .ssb-form input[type=file] { width: 100%; padding: 12px 14px; border: 1px solid #8a93a3; border-radius: 10px; font: inherit; background: #fff; color: var(--ssb-text); }
.ssb-form input[type=text], .ssb-form input[type=email], .ssb-form input[type=tel], .ssb-form textarea, .ssb-form select { border-color: #8a93a3; } /* bordo con contrasto 3:1 (WCAG 1.4.11) */
.ssb-field { display: grid; gap: 4px; }
.ssb-field .ssb-label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: 0; }
.ssb-req { color: #b3261e; margin-left: 2px; }
.ssb-options { display: grid; gap: 6px; }
.ssb-form .ssb-options .ssb-check, .ssb-form .ssb-field--privacy .ssb-check { margin: 0; }
.ssb-form .ssb-check input { width: 18px; height: 18px; margin-top: 3px; flex: 0 0 auto; accent-color: var(--ssb-primary); }
.ssb-hint { color: var(--ssb-muted); font-size: .85rem; }
.ssb-field.is-invalid input:not([type=checkbox]):not([type=radio]), .ssb-field.is-invalid textarea, .ssb-field.is-invalid select { border-color: #b3261e; box-shadow: 0 0 0 1px #b3261e; }
.ssb-field-error { color: #b3261e; font-size: .88rem; font-weight: 600; margin: 2px 0 0; }
.ssb-form-msg.is-error { color: #b3261e; }
.ssb-cform .ssb-btn { justify-self: start; }

/* ================= Accessibilità ================= */
/* focus sempre visibile da tastiera (anche se il tema lo toglie) */
.ssb-page a:focus-visible, .ssb-page button:focus-visible, .ssb-page input:focus-visible, .ssb-page select:focus-visible,
.ssb-page textarea:focus-visible, .ssb-page summary:focus-visible, .ssb-page [tabindex]:focus-visible {
	outline: 3px solid var(--ssb-primary); outline-offset: 2px; box-shadow: 0 0 0 5px #fff;
}
.ssb-section--dark :focus-visible, .ssb-section--primary :focus-visible, .ssb-hero :focus-visible, .ssb-footer :focus-visible { outline-color: var(--ssb-accent) !important; box-shadow: none !important; }
/* link "Vai al contenuto": nascosto finché non riceve il focus */
.ss-skip-link { position: absolute; left: 12px; top: -200px; z-index: 100000; background: #111; color: #fff !important; padding: 12px 18px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.ss-skip-link:focus { top: 12px; outline: 3px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	.ssb-btn, .ssb-btn:hover { transition: none; transform: none; }
}

/* ================= Blocchi degli articoli (Blog › editor a blocchi) ================= */
/* basi leggere (:where = peso zero): il CSS del tema o del modello dell'articolo comanda */
:where(.ssb-callout) { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px; margin: 24px 0; border-radius: 10px; border: 1px solid rgba(31,79,216,.18); border-left: 4px solid var(--ssb-primary); background: rgba(31,79,216,.06); }
:where(.ssb-callout--warn) { border-color: #f0d090; border-left-color: #f0a030; background: #fff8f0; }
:where(.ssb-callout--ok) { border-color: #90d0a8; border-left-color: #28a060; background: #f0fff5; }
:where(.ssb-callout-icon) { flex: 0 0 auto; font-size: 1.2rem; line-height: 1.4; }
:where(.ssb-callout-body) > :where(:last-child) { margin-bottom: 0; }
:where(.ssb-callout-body) > :where(strong:first-child) { display: block; margin-bottom: 4px; }
:where(.ssb-steps) { display: grid; gap: 14px; margin: 24px 0; counter-reset: ssb-step; }
:where(.ssb-step) { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; border-radius: 10px; background: var(--ssb-bg-soft); }
:where(.ssb-step-num) { flex: 0 0 auto; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--ssb-primary); color: #fff; }
:where(.ssb-step) :where(h4) { margin: 0 0 4px; }
:where(.ssb-step) :where(p) { margin: 0; }
:where(.ssb-figure) { margin: 28px 0; }
:where(.ssb-figure) img { max-width: 100%; height: auto; display: block; border-radius: 10px; }
:where(.ssb-figure) figcaption { font-size: .9rem; opacity: .75; margin-top: 8px; text-align: center; }
:where(.ssb-table-wrap) { overflow-x: auto; margin: 24px 0; }
:where(.ssb-table-wrap) table { width: 100%; border-collapse: collapse; }
:where(.ssb-table-wrap) :where(th, td) { padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,.1); text-align: left; vertical-align: top; }
:where(.ssb-table-wrap) th { font-weight: 700; background: var(--ssb-bg-soft); }
:where(.ssb-pullquote) { margin: 28px 0; padding: 6px 0 6px 22px; border-left: 4px solid var(--ssb-accent); font-size: 1.15rem; font-style: italic; }
:where(.ssb-pullquote) cite { display: block; margin-top: 8px; font-size: .9rem; font-style: normal; opacity: .7; }
:where(.ssb-chips) { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; padding: 0; list-style: none; }
:where(.ssb-chips) > * { padding: 4px 12px; border-radius: 999px; background: var(--ssb-bg-soft); font-size: .9rem; }
:where(.ssb-chips) > *::before { content: none !important; }
:where(.ssb-cta) { margin: 32px 0; padding: 24px; border-radius: var(--ssb-radius); background: var(--ssb-bg-soft); text-align: center; }
:where(.ssb-cta) > :where(:last-child) { margin-bottom: 0; }
