/* FOGLIO DI STILE WIDGET DI TRADUZIONE LEGGERA */

:root {
	--lt-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--lt-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
	--lt-shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.18);
	--lt-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	--lt-dropdown-height: 250px;
}

/* Contenitore Galleggiante */
.wp-light-translator-widget {
	position: fixed;
	z-index: 999999;
	font-family: var(--lt-font-family);
	display: inline-block;
}

/* Classi per il Posizionamento */
.lt-pos-bottom-right {
	bottom: 20px;
	right: 20px;
}
.lt-pos-bottom-left {
	bottom: 20px;
	left: 20px;
}
.lt-pos-top-right {
	top: 20px;
	right: 20px;
}
.lt-pos-top-left {
	top: 20px;
	left: 20px;
}

/* Pulsante Trigger */
.lt-widget-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background-color: var(--lt-bg-color);
	color: var(--lt-text-color);
	border: 1px solid rgba(0, 0, 0, 0.08);
	padding: var(--lt-padding);
	border-radius: var(--lt-border-radius);
	cursor: pointer;
	box-shadow: var(--lt-shadow);
	transition: var(--lt-transition);
	font-size: 14px;
	font-weight: 600;
	min-width: 110px;
	outline: none;
	user-select: none;
}

.lt-widget-btn:hover {
	transform: translateY(-2px);
	box-shadow: var(--lt-shadow-hover);
	background-color: var(--lt-hover-bg);
	color: var(--lt-hover-text) !important;
}

.lt-arrow-icon {
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 4px solid var(--lt-text-color);
}

.lt-widget-btn:hover .lt-arrow-icon {
	border-top-color: var(--lt-hover-text) !important;
}

.lt-widget-btn:active {
	transform: translateY(1px);
}

/* Rotazione freccia quando aperto */
.lt-open .lt-arrow-icon {
	transform: rotate(180deg);
}

/* Dropdown delle lingue */
.lt-languages-dropdown {
	position: absolute;
	background-color: var(--lt-bg-color);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	box-shadow: var(--lt-shadow);
	width: 200px;
	max-height: var(--lt-dropdown-height);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: var(--lt-transition);
	z-index: 1000000;
}

/* Posizionamento Dropdown rispetto al trigger */
.lt-pos-bottom-right .lt-languages-dropdown {
	bottom: calc(100% + 10px);
	right: 0;
}
.lt-pos-bottom-left .lt-languages-dropdown {
	bottom: calc(100% + 10px);
	left: 0;
}
.lt-pos-top-right .lt-languages-dropdown {
	top: calc(100% + 10px);
	right: 0;
}
.lt-pos-top-left .lt-languages-dropdown {
	top: calc(100% + 10px);
	left: 0;
}

/* Classe di apertura Dropdown */
.lt-open .lt-languages-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Intestazione Dropdown */
.lt-dropdown-header {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--lt-text-color);
	opacity: 0.6;
	padding: 12px 16px 6px 16px;
	font-weight: 700;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	background-color: rgba(0, 0, 0, 0.01);
}

/* Lista Lingue */
.lt-languages-list {
	list-style: none;
	margin: 0;
	padding: 4px 0;
	overflow-y: auto;
	flex-grow: 1;
}

/* Personalizzazione Scrollbar Dropdown */
.lt-languages-list::-webkit-scrollbar {
	width: 6px;
}
.lt-languages-list::-webkit-scrollbar-track {
	background: transparent;
}
.lt-languages-list::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.15);
	border-radius: 3px;
}
.lt-languages-list::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.25);
}

/* Elemento Lingua */
.lt-lang-item {
	display: flex;
	align-items: center;
	padding: 10px 16px;
	cursor: pointer;
	color: var(--lt-text-color);
	font-size: 13.5px;
	font-weight: 500;
	transition: background-color 0.2s ease;
	position: relative;
}

.lt-lang-item:hover {
	background-color: var(--lt-hover-bg);
}

.lt-lang-name {
	flex-grow: 1;
}

/* Lingua Attiva */
.lt-active-lang {
	font-weight: 700;
	background-color: rgba(0, 0, 0, 0.03);
}

.lt-active-lang .lt-checkmark::after {
	content: "";
	display: block;
	width: 4px;
	height: 8px;
	border: solid var(--lt-text-color);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	position: absolute;
	right: 16px;
	top: calc(50% - 6px);
}

/* Icone Bandiera (Embedding vettoriale ad altissima efficienza - 0 richieste HTTP) */
.lt-flag-icon {
	width: 18px;
	height: 12px;
	display: inline-block;
	border-radius: 2.5px;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	margin-right: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	flex-shrink: 0;
}

/* SVGs delle bandiere (correttamente URL-encoded con %23 per il carattere cancelletto) */
.lt-flag-it { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='1' height='2' fill='%23009246'/><rect x='1' width='1' height='2' fill='%23ffffff'/><rect x='2' width='1' height='2' fill='%23ce2b37'/></svg>"); }
.lt-flag-en { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 60 40' xmlns='http://www.w3.org/2000/svg'><rect width='60' height='40' fill='%23012169'/><path d='M0,0 L60,40 M60,0 L0,40' stroke='%23ffffff' stroke-width='6'/><path d='M0,0 L60,40 M60,0 L0,40' stroke='%23C8102E' stroke-width='2'/><path d='M30,0 V40 M0,20 H60' stroke='%23ffffff' stroke-width='10'/><path d='M30,0 V40 M0,20 H60' stroke='%23C8102E' stroke-width='6'/></svg>"); }
.lt-flag-es { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='2' fill='%23c60b1e'/><rect y='0.5' width='3' height='1' fill='%23ffc400'/></svg>"); }
.lt-flag-fr { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='1' height='2' fill='%23002395'/><rect x='1' width='1' height='2' fill='%23ffffff'/><rect x='2' width='1' height='2' fill='%23ed2939'/></svg>"); }
.lt-flag-de { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='0.67' fill='%23000000'/><rect y='0.67' width='3' height='0.67' fill='%23dd0000'/><rect y='1.33' width='3' height='0.67' fill='%23ffce00'/></svg>"); }
.lt-flag-pt { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='1.2' height='2' fill='%23006600'/><rect x='1.2' width='1.8' height='2' fill='%23ff0000'/></svg>"); }
.lt-flag-nl { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='0.67' fill='%23ae1c28'/><rect y='0.67' width='3' height='0.67' fill='%23ffffff'/><rect y='1.33' width='3' height='0.67' fill='%2321468b'/></svg>"); }
.lt-flag-ru { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='0.67' fill='%23ffffff'/><rect y='0.67' width='3' height='0.67' fill='%230039a6'/><rect y='1.33' width='3' height='0.67' fill='%23d52b1e'/></svg>"); }
.lt-flag-zh-CN { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='2' fill='%23de2110'/><polygon points='0.5,0.4 0.58,0.7 0.5,0.55 0.42,0.7' fill='%23ffde00'/></svg>"); }
.lt-flag-ja { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='2' fill='%23ffffff'/><circle cx='1.5' cy='1' r='0.6' fill='%23bc002d'/></svg>"); }
.lt-flag-ar { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='2' fill='%23006c35'/><circle cx='1.5' cy='1' r='0.5' fill='%23ffffff'/><circle cx='1.65' cy='1' r='0.45' fill='%23006c35'/></svg>"); }
.lt-flag-pl { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='1' fill='%23ffffff'/><rect y='1' width='3' height='1' fill='%23dc143c'/></svg>"); }
.lt-flag-ro { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='1' height='2' fill='%23002b7f'/><rect x='1' width='1' height='2' fill='%23fcd116'/><rect x='2' width='1' height='2' fill='%23ce1126'/></svg>"); }
.lt-flag-tr { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='2' fill='%23e30a17'/><circle cx='1.3' cy='1' r='0.45' fill='%23ffffff'/><circle cx='1.45' cy='1' r='0.36' fill='%23e30a17'/></svg>"); }
.lt-flag-sv { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='2' fill='%23006aa7'/><rect x='0.8' width='0.4' height='2' fill='%23fecc00'/><rect y='0.8' width='3' height='0.4' fill='%23fecc00'/></svg>"); }
.lt-flag-el { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='2' fill='%230d5eaf'/><rect y='0.22' width='3' height='0.22' fill='%23ffffff'/><rect y='0.66' width='3' height='0.22' fill='%23ffffff'/><rect y='1.1' width='3' height='0.22' fill='%23ffffff'/><rect y='1.54' width='3' height='0.22' fill='%23ffffff'/><rect width='1.1' height='1.1' fill='%230d5eaf'/><rect x='0.44' width='0.22' height='1.1' fill='%23ffffff'/><rect y='0.44' width='1.1' height='0.22' fill='%23ffffff'/></svg>"); }
.lt-flag-da { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='2' fill='%23c8102e'/><rect x='0.9' width='0.3' height='2' fill='%23ffffff'/><rect y='0.85' width='3' height='0.3' fill='%23ffffff'/></svg>"); }
.lt-flag-fi { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='2' fill='%23ffffff'/><rect x='0.9' width='0.4' height='2' fill='%23003580'/><rect y='0.8' width='3' height='0.4' fill='%23003580'/></svg>"); }
.lt-flag-no { background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 3 2' xmlns='http://www.w3.org/2000/svg'><rect width='3' height='2' fill='%23ba0c2f'/><rect x='0.8' width='0.6' height='2' fill='%23ffffff'/><rect y='0.7' width='3' height='0.6' fill='%23ffffff'/><rect x='0.95' width='0.4' height='2' fill='%2300205b'/><rect y='0.8' width='3' height='0.4' fill='%2300205b'/></svg>"); }


/* ==========================================================================
   STILI DI OTTIMIZZAZIONE PER MOBILE (Responsive Drawer UI)
   ========================================================================== */
@media screen and (max-width: 600px) {
	/* Posiziona sempre il widget trigger negli angoli ma con padding minore */
	.lt-pos-bottom-right, .lt-pos-bottom-left {
		bottom: 15px;
	}
	.lt-pos-bottom-right { right: 15px; }
	.lt-pos-bottom-left { left: 15px; }
	.lt-pos-top-right, .lt-pos-top-left {
		top: 15px;
	}
	.lt-pos-top-right { right: 15px; }
	.lt-pos-top-left { left: 15px; }

	/* Trasforma il dropdown in un Drawer dal basso per una UX mobile premium (stile iOS/Android sheet) */
	.lt-languages-dropdown {
		position: fixed !important;
		bottom: 0 !important;
		left: 0 !important;
		right: 0 !important;
		top: auto !important;
		width: 100vw !important;
		max-height: 70vh !important;
		height: 380px !important;
		border-radius: 20px 20px 0 0 !important;
		transform: translateY(100%) !important;
		border: none !important;
		box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.2) !important;
		transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
	}

	.lt-open .lt-languages-dropdown {
		transform: translateY(0) !important;
	}

	/* Sfondo oscurato sotto il drawer (Overlay) */
	.wp-light-translator-widget::before {
		content: "";
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		height: 100vh;
		background: rgba(0, 0, 0, 0.4);
		backdrop-filter: blur(2px);
		z-index: -1;
		opacity: 0;
		visibility: hidden;
		transition: var(--lt-transition);
	}

	.lt-open::before {
		opacity: 1;
		visibility: visible;
	}

	/* Intestazione Drawer Mobile più pronunciata e con barretta di trascinamento */
	.lt-dropdown-header {
		padding: 20px 24px 10px 24px;
		font-size: 13px;
		letter-spacing: 1px;
		position: relative;
	}
	
	.lt-dropdown-header::before {
		content: "";
		width: 40px;
		height: 4px;
		background-color: rgba(0, 0, 0, 0.15);
		border-radius: 2px;
		position: absolute;
		top: 8px;
		left: calc(50% - 20px);
	}

	/* Elementi della lista mobile più grandi ed ergonomici per il tocco */
	.lt-lang-item {
		padding: 15px 24px;
		font-size: 15.5px;
	}
	
	.lt-active-lang .lt-checkmark::after {
		right: 24px;
	}
}

/* Nasconde gli elementi indesiderati aggiunti nativamente da Google Translate */
body {
	top: 0 !important; /* Impedisce a Google di spostare in basso l'intero body */
}
#google_translate_element {
	position: absolute !important;
	top: -9999px !important;
	left: -9999px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}
iframe.goog-te-banner-frame, .goog-te-banner-frame, #goog-gt-tt {
	display: none !important; /* Nasconde la barra di traduzione nativa di Google in alto e i tooltip */
	visibility: hidden !important;
}
.goog-te-gadget {
	font-size: 0 !important; /* Rimuove i testi parassiti di Google */
}
.goog-te-gadget .goog-te-combo {
	margin: 0 !important;
}
.goog-tooltip, .goog-tooltip:hover {
	display: none !important; /* Rimuove i tooltip di Google al passaggio del mouse */
	box-shadow: none !important;
}
.goog-text-highlight {
	background-color: transparent !important; /* Rimuove l'evidenziazione gialla del testo tradotto */
	box-shadow: none !important;
}

/* Impedisce la perdita di spazi o allineamenti strani intorno alle parole escluse, ereditando al 100% lo stile del padre (bold, italic, colori) */
span.notranslate, .notranslate {
	display: inline !important;
	white-space: normal !important;
	font-weight: inherit !important;
	font-style: inherit !important;
	color: inherit !important;
	font-size: inherit !important;
	text-transform: inherit !important;
	text-decoration: inherit !important;
	letter-spacing: inherit !important;
	margin-left: 3px !important;
	margin-right: 3px !important;
}

/* Se la parola protetta si trova all'inizio di una riga/blocco (es. primo elemento), azzera il margine sinistro per un allineamento perfetto a sinistra */
span.notranslate:first-child, .notranslate:first-child {
	margin-left: 0 !important;
}
