/*
Theme Name: Officina
Author: PC Extreme
Version: 0.1.5
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: officina
Update URI: https://kit.wpfactory/officina
*/
/* 0.1.1 (18/11/2026): solo numero di versione, prova di aggiornamento dal listino interno di neo con MainWP. */

/* Contratto dei pezzi comuni (Fabbrica Core). Su body e non su :root: i valori globali di Elementor (--e-global-*) sono definiti sulla classe del kit, che sta sul body. */
body {
	--fc-accento: var(--of-accento, #333);
	--fc-scuro: var(--of-titolo, #222);
	--fc-chiaro: #fff;
	--fc-su-scuro: #fff;
	--fc-display: var(--of-h1-family, sans-serif);
	--fc-testo: var(--of-base-family, sans-serif);
	--fc-raggio: 0;
}
/* Margini letti con misure.mjs: valgono solo quando il kit porta le impostazioni da riprodurre (classe of-kit). */
body.of-kit {
	--of-margine-titolo: 0;
	--of-margine-p: 0 0 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Come sul sito di origine la pagina non scorre in orizzontale: un contenitore taglia ciò che esce di lato (su Ranucci la testata larga 103% per il CSS del cliente, il titolo decorativo «Advanced» a 390).
   clip e non hidden: hidden ne farebbe un contenitore di scorrimento e romperebbe la testata fissa. Su body o html il taglio non riduce body.scrollWidth. */
.of-sito { overflow-x: clip; max-width: var(--of-larghezza-sito, none); margin-inline: auto; }
body {
	margin: 0;
	background: var(--of-sfondo, #fff);
	color: var(--of-testo, #444);
	font-family: var(--of-base-family, sans-serif);
	font-size: var(--of-base-size, 16px);
	font-weight: var(--of-base-weight, 400);
	line-height: var(--of-base-lh, 1.6);
	text-transform: var(--of-base-transform, none);
	font-style: var(--of-base-style, normal);
	letter-spacing: var(--of-base-ls, normal);
}
img { max-width: 100%; height: auto; }
p { margin: var(--of-margine-p, 0 0 1em); }
a { color: var(--of-link, inherit); text-decoration: var(--of-link-deco, none); }
a:hover { color: var(--of-link-hover, inherit); text-decoration: var(--of-link-hover-deco, none); }

/* Titoli: ogni valore ha un ripiego, cosi' senza le impostazioni del kit h1...h6 restano distinti. */
h1, h2, h3, h4, h5, h6 { margin: var(--of-margine-titolo, 0 0 .5em); color: var(--of-titolo, inherit); }
h1 { font-family: var(--of-h1-family, inherit); font-size: var(--of-h1-size, 2em); font-weight: var(--of-h1-weight, 700); line-height: var(--of-h1-lh, 1.2); text-transform: var(--of-h1-transform, none); }
h2 { font-family: var(--of-h2-family, inherit); font-size: var(--of-h2-size, 1.5em); font-weight: var(--of-h2-weight, 700); line-height: var(--of-h2-lh, 1.2); text-transform: var(--of-h2-transform, none); }
h3 { font-family: var(--of-h3-family, inherit); font-size: var(--of-h3-size, 1.17em); font-weight: var(--of-h3-weight, 700); line-height: var(--of-h3-lh, 1.3); text-transform: var(--of-h3-transform, none); }
h4 { font-family: var(--of-h4-family, inherit); font-size: var(--of-h4-size, 1em); font-weight: var(--of-h4-weight, 700); line-height: var(--of-h4-lh, 1.4); text-transform: var(--of-h4-transform, none); }
h5 { font-family: var(--of-h5-family, inherit); font-size: var(--of-h5-size, .83em); font-weight: var(--of-h5-weight, 700); line-height: var(--of-h5-lh, 1.4); text-transform: var(--of-h5-transform, none); }
h6 { font-family: var(--of-h6-family, inherit); font-size: var(--of-h6-size, .67em); font-weight: var(--of-h6-weight, 700); line-height: var(--of-h6-lh, 1.4); text-transform: var(--of-h6-transform, none); }
/* Taglie per tablet e telefono: nel CSS del pannello (officina_pannello_css), ai punti di rottura letti da Elementor. */

/*
Pulsanti di Elementor. Solo quando il kit porta le impostazioni da riprodurre (classe of-kit sul body) o il pannello imposta qualcosa dei pulsanti (classe of-pulsanti): senza, valgono le Impostazioni sito di Elementor.
Colori: body:where(.of-kit, .of-pulsanti) .elementor-button vale (0,1,1): batte il .elementor-button di Elementor (0,1,0) anche se Elementor e' accodato dopo,
e perde contro le impostazioni di Elementor del kit (.elementor-kit-N .elementor-button, (0,2,0)) e del singolo pulsante, che devono vincere.
Collegamento gia' visitato: Elementor ha .elementor-button:visited { color: #fff } a (0,2,0), che batterebbe il colore sopra: serve la regola :visited sotto, a (0,2,1).
Batte anche le Impostazioni sito (0,2,0), quindi il tema mette la classe of-kit-visitato solo quando quelle impostazioni non hanno un colore del testo dei pulsanti: allora non c'e' nulla da battere.
Il colore scelto sul singolo pulsante (0,4,0) batte la regola :visited, come in Elementor.
Ogni variabile ha un ripiego uguale al valore predefinito di Elementor 3.10 (sfondo #818a91, testo #fff; per ogni taglia font, spazio interno e raggio; l'altezza minima solo nei moduli):
la classe of-kit compare anche con una sola chiave presente, e un pulsante non deve diventare trasparente.
Taglie: devono battere le regole delle taglie di Elementor e di PRO Elements per il modulo, per questo il selettore e' piu' lungo (0,3,1).
Quindi le taglie battono anche le Impostazioni sito di Elementor (carattere e spazio interno dei pulsanti), cosa che i colori non fanno. Verificato con un pulsante Elementor per taglia.
*/
body:where(.of-kit, .of-pulsanti) .elementor-button {
	background-color: var(--of-btn-sfondo, #818a91);
	border-color: var(--of-btn-bordo, transparent);
	color: var(--of-btn-testo, #fff);
}
body:where(.of-kit-visitato) .elementor-button:visited {
	color: var(--of-btn-testo, #fff);
}
body:where(.of-kit, .of-pulsanti) .elementor-button:hover, body:where(.of-kit, .of-pulsanti) .elementor-button:focus {
	background-color: var(--of-btn-sfondo-hover, var(--of-btn-sfondo, #818a91));
	border-color: var(--of-btn-bordo-hover, var(--of-btn-bordo, transparent));
	color: var(--of-btn-testo-hover, var(--of-btn-testo, #fff));
}
/* Pulsante premuto: senza colori del pannello resta com'è al passaggio del mouse, come oggi. */
body:where(.of-kit, .of-pulsanti) .elementor-button:active {
	background-color: var(--of-btn-sfondo-premuto, var(--of-btn-sfondo-hover, var(--of-btn-sfondo, #818a91)));
	border-color: var(--of-btn-bordo-premuto, var(--of-btn-bordo-hover, var(--of-btn-bordo, transparent)));
	color: var(--of-btn-testo-premuto, var(--of-btn-testo-hover, var(--of-btn-testo, #fff)));
}
body:is(.of-kit, .of-pulsanti) .elementor-button.elementor-size-xs,
body:is(.of-kit, .of-pulsanti) .elementor-form .elementor-button.elementor-size-xs {
	font-family: var(--of-btn-s-family, inherit);
	font-size: var(--of-btn-s-size, 13px);
	font-weight: var(--of-btn-s-weight, inherit);
	line-height: var(--of-btn-s-lh, 1);
	padding: var(--of-btn-s-padding, 10px 20px);
	min-height: var(--of-btn-s-altezza, 0);
	border-radius: var(--of-btn-s-raggio, 2px);
}

body:is(.of-kit, .of-pulsanti) .elementor-button.elementor-size-sm,
body:is(.of-kit, .of-pulsanti) .elementor-form .elementor-button.elementor-size-sm {
	font-family: var(--of-btn-m-family, inherit);
	font-size: var(--of-btn-m-size, 15px);
	font-weight: var(--of-btn-m-weight, inherit);
	line-height: var(--of-btn-m-lh, 1);
	padding: var(--of-btn-m-padding, 12px 24px);
	min-height: var(--of-btn-m-altezza, 0);
	border-radius: var(--of-btn-m-raggio, 3px);
}

body:is(.of-kit, .of-pulsanti) .elementor-button.elementor-size-md,
body:is(.of-kit, .of-pulsanti) .elementor-form .elementor-button.elementor-size-md {
	font-family: var(--of-btn-l-family, inherit);
	font-size: var(--of-btn-l-size, 16px);
	font-weight: var(--of-btn-l-weight, inherit);
	line-height: var(--of-btn-l-lh, 1);
	padding: var(--of-btn-l-padding, 15px 30px);
	min-height: var(--of-btn-l-altezza, 0);
	border-radius: var(--of-btn-l-raggio, 4px);
}

body:is(.of-kit, .of-pulsanti) .elementor-button.elementor-size-lg,
body:is(.of-kit, .of-pulsanti) .elementor-form .elementor-button.elementor-size-lg {
	font-family: var(--of-btn-lg-family, inherit);
	font-size: var(--of-btn-lg-size, 18px);
	font-weight: var(--of-btn-lg-weight, inherit);
	line-height: var(--of-btn-lg-lh, 1);
	padding: var(--of-btn-lg-padding, 20px 40px);
	min-height: var(--of-btn-lg-altezza, 0);
	border-radius: var(--of-btn-lg-raggio, 5px);
}

body:is(.of-kit, .of-pulsanti) .elementor-button.elementor-size-xl,
body:is(.of-kit, .of-pulsanti) .elementor-form .elementor-button.elementor-size-xl {
	font-family: var(--of-btn-xl-family, inherit);
	font-size: var(--of-btn-xl-size, 20px);
	font-weight: var(--of-btn-xl-weight, inherit);
	line-height: var(--of-btn-xl-lh, 1);
	padding: var(--of-btn-xl-padding, 25px 50px);
	min-height: var(--of-btn-xl-altezza, 0);
	border-radius: var(--of-btn-xl-raggio, 6px);
}

/* Nei moduli di Elementor l'altezza minima della taglia ha un valore proprio: il ripiego vale solo li. */
body:is(.of-kit, .of-pulsanti) .elementor-form .elementor-button.elementor-size-xs { min-height: var(--of-btn-s-altezza, 33px); }
body:is(.of-kit, .of-pulsanti) .elementor-form .elementor-button.elementor-size-sm { min-height: var(--of-btn-m-altezza, 40px); }
body:is(.of-kit, .of-pulsanti) .elementor-form .elementor-button.elementor-size-md { min-height: var(--of-btn-l-altezza, 47px); }
body:is(.of-kit, .of-pulsanti) .elementor-form .elementor-button.elementor-size-lg { min-height: var(--of-btn-lg-altezza, 59px); }
body:is(.of-kit, .of-pulsanti) .elementor-form .elementor-button.elementor-size-xl { min-height: var(--of-btn-xl-altezza, 72px); }

/* Testi: l'ultimo paragrafo di un widget non lascia spazio sotto; i titoli dei widget non hanno margini. */
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }
body .elementor-widget-heading .elementor-heading-title { margin: 0; }

/* Icone SVG caricate (inc/svg.php): le parti senza colore proprio prendono il colore del widget, quelle col loro colore lo tengono. */
.of-svg-utente:not([fill]) { fill: currentColor; }

/* Ripiego senza Elementor o senza modello scelto */
.of-salta { position: absolute; left: -9999px; }
.of-salta:focus { left: 8px; top: 8px; z-index: 9999; background: #fff; color: #000; padding: 8px 12px; }
.of-testata, .of-piede { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; }
.of-testata__marchio { font-size: 20px; font-weight: 700; color: inherit; }
.of-testata__menu ul, .of-piede ul { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; }
.of-pannello summary { display: none; cursor: pointer; }
.of-pannello > nav { display: block; }
.of-pagina { max-width: var(--of-contenuto, 1140px); margin: 0 auto; padding: 32px 16px; }
@media (max-width: 767px) {
	.of-pannello summary { display: block; }
	.of-pannello:not([open]) > nav { display: none; }
	.of-testata__menu ul { flex-direction: column; }
}
