/* WhoSpeak – selettore di lingua e avviso. Variabili sovrascrivibili dal tema. */
.whospeak-switcher {
	--ws-gap: .5em;
	--ws-radius: 6px;
	--ws-fg: inherit;
	/* Colori della tendina (tema chiaro). */
	--ws-bg: #fff;
	--ws-text: #222;
	--ws-hover: rgba(0, 0, 0, .05);
	--ws-border: rgba(0, 0, 0, .12);
	--ws-shadow: 0 8px 24px rgba(0, 0, 0, .15);
	--ws-pad: .35em;
	--ws-item-pad: .45em .6em;
	--ws-item-radius: 4px;
	--ws-flag-ring: rgba(0, 0, 0, .08);
	display: inline-block;
	font-size: inherit;
	line-height: 1.2;
}
.whospeak-switcher .ws-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--ws-gap); align-items: center; }
.whospeak-switcher.ws-vertical .ws-list { flex-direction: column; align-items: flex-start; }
.whospeak-switcher .ws-item { margin: 0; padding: 0; }
.whospeak-switcher a { display: inline-flex; align-items: center; gap: .4em; text-decoration: none; color: var(--ws-fg); opacity: .85; }
.whospeak-switcher a:hover, .whospeak-switcher a:focus-visible, .whospeak-switcher .ws-current a { opacity: 1; }
.whospeak-switcher .ws-current a { font-weight: 600; }
.whospeak-switcher .ws-untranslated a { opacity: .5; }
.whospeak-flag { display: inline-block; vertical-align: middle; border-radius: 2px; box-shadow: 0 0 0 1px var(--ws-flag-ring, rgba(0, 0, 0, .08)); object-fit: cover; flex: none; }

/* Tendina senza JavaScript (details/summary). */
.whospeak-switcher .ws-dd { position: relative; }
.whospeak-switcher .ws-dd > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .4em; user-select: none; }
.whospeak-switcher .ws-dd > summary::-webkit-details-marker { display: none; }
.whospeak-switcher .ws-dd > summary::after { content: ""; width: .4em; height: .4em; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); margin-left: .15em; }
.whospeak-switcher .ws-dd > .ws-list { position: absolute; z-index: 9999; top: calc(100% + 6px); right: 0; min-width: 11em; flex-direction: column; align-items: stretch; gap: 0; padding: var(--ws-pad); background: var(--ws-bg); color: var(--ws-text); border: 1px solid var(--ws-border); border-radius: var(--ws-radius); box-shadow: var(--ws-shadow); }
.whospeak-switcher .ws-dd > .ws-list a { display: flex; padding: var(--ws-item-pad); border-radius: var(--ws-item-radius); color: var(--ws-text); white-space: nowrap; }
.whospeak-switcher .ws-dd > .ws-list a:hover, .whospeak-switcher .ws-dd > .ws-list a:focus-visible { background: var(--ws-hover); }
/* Nella tendina le voci non ereditano maiuscolo e spaziatura del menu (come i sottomenu dei temi). */
.whospeak-switcher .ws-dd > .ws-list a { text-transform: none; letter-spacing: normal; font-size: var(--ws-item-size, 14px); }

.whospeak-switcher select { font: inherit; padding: .3em .5em; border-radius: var(--ws-radius); }

/* Tema scuro (Impostazioni › Selettore › Colori): stessi colori dei sottomenu del tema Cantina Sbusto, se ci sono
   le sue variabili, altrimenti un grigio scuro neutro. «Automatico» segue il dispositivo del visitatore. */
.whospeak-switcher.ws-theme-dark {
	--ws-bg: var(--sb-bg3, #131218);
	--ws-text: var(--sb-text, #E9E4D8);
	--ws-hover: #1E1D24;
	--ws-border: var(--sb-line2, #2A2924);
	--ws-shadow: 0 20px 50px rgba(0, 0, 0, .6);
	--ws-radius: 14px;
	--ws-pad: 10px;
	--ws-item-pad: 10px 12px;
	--ws-item-radius: 8px;
	--ws-flag-ring: rgba(255, 255, 255, .12);
}
@media (prefers-color-scheme: dark) {
	.whospeak-switcher.ws-theme-auto {
		--ws-bg: var(--sb-bg3, #131218);
		--ws-text: var(--sb-text, #E9E4D8);
		--ws-hover: #1E1D24;
		--ws-border: var(--sb-line2, #2A2924);
		--ws-shadow: 0 20px 50px rgba(0, 0, 0, .6);
		--ws-flag-ring: rgba(255, 255, 255, .12);
	}
}

/* Voce nei menu del tema. */
.whospeak-menu > a img, .whospeak-menu-lang > a img { margin-right: .35em; vertical-align: -2px; }

/* Barra negli agganci del tema (sotto l'intestazione, sopra il piè di pagina…). */
.whospeak-bar { --ws-bar-max: 1280px; --ws-bar-pad: clamp(16px, 4vw, 40px); font-size: 13px; }
.whospeak-bar__in { max-width: var(--ws-bar-max); margin: 0 auto; padding: 6px var(--ws-bar-pad); display: flex; justify-content: flex-end; }
.whospeak-bar .whospeak-switcher .ws-list { gap: .9em; }

/* Pulsante flottante. */
.whospeak-float { position: fixed; z-index: 9998; }
.whospeak-float.ws-bottom-left { left: 16px; bottom: 16px; }
.whospeak-float.ws-bottom-right { right: 16px; bottom: 16px; }
.whospeak-float.ws-top-left { left: 16px; top: 16px; }
.whospeak-float.ws-top-right { right: 16px; top: 16px; }
.whospeak-float .ws-dd > summary { background: var(--ws-bg); color: var(--ws-text); border: 1px solid var(--ws-border); padding: .5em .7em; border-radius: 999px; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); }
.whospeak-float.ws-bottom-left .ws-dd > .ws-list, .whospeak-float.ws-bottom-right .ws-dd > .ws-list { top: auto; bottom: calc(100% + 8px); }
.whospeak-float.ws-bottom-left .ws-dd > .ws-list, .whospeak-float.ws-top-left .ws-dd > .ws-list { right: auto; left: 0; }

/* Avviso lingua del browser. */
.whospeak-banner { position: fixed; z-index: 99999; left: 50%; bottom: 16px; transform: translate(-50%, 140%); transition: transform .35s ease; display: flex; align-items: center; gap: .7em; max-width: calc(100vw - 32px); padding: .7em .8em .7em 1em; background: #1d1d1f; color: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); font: 14px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; }
.whospeak-banner.is-in { transform: translate(-50%, 0); }
.whospeak-banner img { border-radius: 2px; flex: none; }
.whospeak-banner .whospeak-go { flex: none; background: #fff; color: #1d1d1f; padding: .45em .8em; border-radius: 8px; font-weight: 600; text-decoration: none; }
.whospeak-banner .whospeak-x { flex: none; background: transparent; border: 0; color: #fff; font-size: 20px; line-height: 1; padding: 0 .2em; cursor: pointer; opacity: .7; }
.whospeak-banner .whospeak-x:hover { opacity: 1; }
@media (max-width: 520px) {
	.whospeak-banner { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "f t x" "g g g"; row-gap: .6em; width: calc(100vw - 24px); bottom: 12px; }
	.whospeak-banner img { grid-area: f; }
	.whospeak-banner span { grid-area: t; }
	.whospeak-banner .whospeak-x { grid-area: x; align-self: start; }
	.whospeak-banner .whospeak-go { grid-area: g; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .whospeak-banner { transition: none; } }
.whospeak-switcher .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
