/* Accessibilità WP – pannello preferenze di lettura */

/* ---------- Preferenze applicate alla pagina ---------- */

/* I temi Elementor usano dimensioni in px: zoom scala tutto in modo uniforme. */
html.awp-fs-1 body > :not(.awp-widget):not(script):not(style) { zoom: 1.15; }
html.awp-fs-2 body > :not(.awp-widget):not(script):not(style) { zoom: 1.3; }

html.awp-contrast body :not(.awp-widget):not(.awp-widget *):not(img):not(video):not(svg):not(svg *) {
	background-color: #000 !important;
	background-image: none !important;
	color: #fff !important;
	border-color: #fff !important;
	text-shadow: none !important;
	box-shadow: none !important;
}
html.awp-contrast body { background: #000 !important; }
html.awp-contrast body a:not(.awp-widget a),
html.awp-contrast body a:not(.awp-widget a) * { color: #ffe14d !important; }
html.awp-contrast body button:not(.awp-widget button),
html.awp-contrast body input,
html.awp-contrast body select,
html.awp-contrast body textarea { border: 2px solid #fff !important; }
html.awp-contrast body svg:not(.awp-widget svg) { fill: currentColor; }
html.awp-contrast .elementor-background-overlay,
html.awp-contrast .elementor-background-video-container { display: none !important; }

html.awp-spacing body :not(.awp-widget):not(.awp-widget *) {
	line-height: 1.8 !important;
	letter-spacing: .04em !important;
	word-spacing: .12em !important;
}
html.awp-spacing body p:not(.awp-widget *) { margin-bottom: 1.5em !important; }

html.awp-links body a:not(.awp-widget a) {
	text-decoration: underline !important;
	text-underline-offset: .18em;
	text-decoration-thickness: 2px !important;
}

html.awp-font body :not(.awp-widget *):not(i):not([class*="icon"]):not([class*="fa-"]):not(svg):not(svg *) {
	font-family: Verdana, Tahoma, "DejaVu Sans", system-ui, sans-serif !important;
}

html.awp-motion *,
html.awp-motion *::before,
html.awp-motion *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}
/* Gli elementi con animazione d'ingresso Elementor devono comunque comparire. */
html.awp-motion .elementor-invisible { visibility: visible !important; }

/* ---------- Pannello ---------- */

.awp-widget {
	--awp-color: #0b4f8a;
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font: 400 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: #1a1a1a;
	letter-spacing: normal;
	word-spacing: normal;
	text-align: left;
}
.awp-widget--right { right: 20px; }
.awp-widget--left { left: 20px; }

.awp-widget *,
.awp-widget *::before,
.awp-widget *::after { box-sizing: border-box; }

/* I temi (es. il kit globale di Elementor) danno stile a tutti i <button>:
   si parte da zero con un selettore a id, più forte delle loro regole. */
#awp-widget button {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	margin: 0;
	cursor: pointer;
}
#awp-widget button:hover,
#awp-widget button:focus {
	text-decoration: none;
}

.awp-widget :focus-visible {
	outline: 3px solid #1a1a1a !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 5px #fff !important;
}

#awp-widget .awp-widget__toggle {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--awp-color);
	color: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
#awp-widget .awp-widget__toggle:hover { filter: brightness(1.15); }

.awp-widget__panel {
	position: absolute;
	bottom: 68px;
	width: min(340px, calc(100vw - 40px));
	max-height: min(600px, calc(100vh - 110px));
	overflow-x: hidden;
	overflow-y: auto;
	padding: 18px;
	background: #fff;
	border: 2px solid #1a1a1a;
	border-radius: 8px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}
.awp-widget--right .awp-widget__panel { right: 0; }
.awp-widget--left .awp-widget__panel { left: 0; }
.awp-widget__panel[hidden] { display: none; }

.awp-widget__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}
.awp-widget__title {
	margin: 0;
	font-family: inherit !important;
	font-size: 19px !important;
	font-weight: 700 !important;
	line-height: 1.25 !important;
	color: #1a1a1a;
	text-transform: none;
	letter-spacing: normal;
}
#awp-widget .awp-widget__close {
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 2px solid #1a1a1a;
	border-radius: 6px;
	background: #fff;
	color: #1a1a1a;
	font-size: 24px !important;
	line-height: 1 !important;
}

.awp-widget__label {
	margin: 0 0 8px;
	font-weight: 700;
	font-size: 15px;
}
.awp-widget__sizes {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	margin-bottom: 16px;
}
#awp-widget .awp-widget__sizes button {
	min-width: 0;
	min-height: 44px;
	text-align: center;
	padding: 6px 4px;
	border: 2px solid #555;
	border-radius: 6px;
	background: #fff;
	color: #1a1a1a;
	font-size: 14px;
	line-height: 1.2;
}
#awp-widget .awp-widget__sizes button[data-awp-fs="1"] { font-size: 16px; }
#awp-widget .awp-widget__sizes button[data-awp-fs="2"] { font-size: 18px; }
#awp-widget .awp-widget__sizes button[aria-pressed="true"] {
	background: var(--awp-color);
	border-color: var(--awp-color);
	color: #fff;
	font-weight: 700;
}

.awp-widget__toggles,
.awp-widget__links {
	list-style: none;
	margin: 0;
	padding: 0;
}
.awp-widget__toggles li { margin: 0; padding: 0; border-top: 1px solid #ddd; }
.awp-widget__toggles li:last-child { border-bottom: 1px solid #ddd; }

#awp-widget .awp-switch {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: 48px;
	padding: 8px 2px;
	border: 0;
	background: transparent;
	color: #1a1a1a;
	text-align: left;
}
.awp-switch__track {
	flex: none;
	position: relative;
	width: 46px;
	height: 26px;
	border: 2px solid #555;
	border-radius: 13px;
	background: #fff;
}
.awp-switch__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #555;
}
#awp-widget .awp-switch[aria-pressed="true"] .awp-switch__track {
	background: var(--awp-color);
	border-color: var(--awp-color);
}
#awp-widget .awp-switch[aria-pressed="true"] .awp-switch__thumb {
	left: 23px;
	background: #fff;
}

#awp-widget .awp-widget__reset {
	width: 100%;
	min-height: 44px;
	margin-top: 14px;
	border: 2px solid #1a1a1a;
	border-radius: 6px;
	background: #fff;
	color: #1a1a1a;
	font-weight: 600;
}

.awp-widget__note {
	margin: 10px 0 0;
	font-size: 13px;
	color: #4a4a4a;
}

.awp-widget__links {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #ddd;
}
.awp-widget__links li { margin: 0 0 6px; }
.awp-widget__links a {
	color: var(--awp-color);
	text-decoration: underline;
	font-size: 15px;
}

@media (prefers-reduced-motion: no-preference) {
	.awp-switch__thumb { transition: left .15s ease; }
}

@media print {
	.awp-widget { display: none !important; }
}
