/**
 * WPS Lang Switcher — lang-switcher.css
 *
 * Feuille de style dédiée au shortcode [survey_language_switcher].
 * Reprend l'apparence exacte du sélecteur de langue du formulaire de
 * sondage (classes .wps-lang-*), avec un conteneur inline neutre
 * (.wps-gls-wrap) qui n'impose aucun positionnement : la mise en page
 * relève du HTML de l'auteur.
 *
 * Chargée via wp_head priorité 1 (avant do_blocks sur Gutenberg/Blocksy).
 * Aucun CDN externe — fichier servi localement.
 *
 * @package WP_Survey
 */

/* ── Masquer la barre native Google Translate ─────────────────────── */
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-tooltip,
.skiptranslate { display: none !important; }
body { top: 0 !important; }

/* ── Conteneur inline neutre ──────────────────────────────────────── */
.wps-gls-wrap {
	display: inline-block;
	position: relative;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	vertical-align: middle;
	z-index: 100;
}

/* ── Bouton déclencheur (identique au formulaire de sondage) ──────── */
.wps-gls-wrap .wps-lang-details { display: block; }
.wps-gls-wrap .wps-lang-trigger {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 4px 14px 4px 12px;
	background: #fff;
	border: 1.5px solid #ddd;
	border-radius: 22px;
	cursor: pointer;
	color: #444;
	transition: border-color .13s, box-shadow .13s, color .13s;
	line-height: 1.3;
	white-space: nowrap;
	list-style: none;
	user-select: none;
	font-size: 13px;
}
.wps-gls-wrap .wps-lang-trigger::-webkit-details-marker { display: none; }
.wps-gls-wrap .wps-lang-details[open] .wps-lang-trigger,
.wps-gls-wrap .wps-lang-trigger:hover {
	border-color: #4285f4;
	box-shadow: 0 2px 8px rgba(66, 133, 244, .15);
	color: #4285f4;
}
.wps-gls-wrap .wps-lang-trigger-flag  { font-size: 18px; line-height: 1; }
.wps-gls-wrap .wps-lang-trigger-label { font-size: 13px; font-weight: 500; }
.wps-gls-wrap .wps-lang-chevron { flex-shrink: 0; transition: transform .2s ease; }
.wps-gls-wrap .wps-lang-details[open] .wps-lang-chevron { transform: rotate(180deg); }

/* Un seul drapeau visible : celui de la langue active */
.wps-gls-wrap .wps-flag-icon { display: none; line-height: 1; }
.wps-gls-wrap .wps-flag-icon.wps-flag-active { display: inline; }

/* ── Menu déroulant (sibling du <details>, affiché via [open] ~) ──── */
.wps-gls-wrap .wps-lang-menu {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 175px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
	list-style: none;
	margin: 0;
	padding: 6px 0;
	z-index: 99999;
}
.wps-gls-wrap .wps-lang-details[open] ~ .wps-lang-menu { display: block; }
.wps-gls-wrap .wps-lang-menu li { border-bottom: 1px solid #f0f0f0; }
.wps-gls-wrap .wps-lang-menu li:last-child { border-bottom: none; }

/* ── Options ──────────────────────────────────────────────────────── */
.wps-gls-wrap .wps-lang-option {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 0 16px;
	font-size: 13px;
	line-height: 2;
	color: #333;
	text-decoration: none;
	white-space: nowrap;
	transition: background .1s;
}
.wps-gls-wrap a.wps-lang-option:hover,
.wps-gls-wrap a.wps-lang-option:focus-visible {
	background: #f0f7ff;
	color: #4285f4;
	outline: none;
}
.wps-gls-wrap .wps-lang-option--active {
	font-weight: 600;
	color: #4285f4;
	background: #f0f7ff;
}

/* ── Accessibilité : focus visible au clavier sur le bouton ──────── */
.wps-gls-wrap .wps-lang-trigger:focus-visible {
	outline: 2px solid #4285f4;
	outline-offset: 2px;
}
