/*
 * Livada Translate — sélecteur de langue (D-091).
 *
 * Mise en page calquée sur celle de TranslatePress, pour qu'un site qui en change garde le même aspect :
 * onglet flottant sombre ou clair collé au bord de l'écran, menu déroulant du shortcode, élément de menu.
 * Tout est en CSS (survol et focus clavier) : aucun JavaScript. Les règles du sélecteur flottant passent par
 * son identifiant, comme celles de TranslatePress, pour ne pas être écrasées par les styles génériques
 * d'un thème sur `a` et `img`.
 */

/* ── Sélecteur flottant ───────────────────────────────────────────────────── */

#ltr-floater-ls {
	position: fixed;
	z-index: 9999999;
	bottom: 0;
	display: block;
	overflow: hidden;
	box-sizing: content-box;
	height: 58px;
	margin: 0;
	padding: 0;
	text-align: center;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
}

#ltr-floater-ls.ltr-color-dark {
	background: #1e1e1e;
}

#ltr-floater-ls.ltr-color-light {
	background: #fff;
}

/* Largeur : celle du drapeau seul ; 200 px pour les noms complets ; les codes s'ajustent à leur contenu. */
#ltr-floater-ls.ltr-floater-ls-flags {
	width: 66px;
}

#ltr-floater-ls.ltr-floater-ls-names {
	min-width: 200px;
}

@media screen and (max-width: 1000px) {
	#ltr-floater-ls.ltr-floater-ls-names.ltr-bottom-right,
	#ltr-floater-ls.ltr-floater-ls-names.ltr-bottom-left {
		min-width: 105px;
	}

	#ltr-floater-ls.ltr-floater-ls-codes.ltr-bottom-right,
	#ltr-floater-ls.ltr-floater-ls-codes.ltr-bottom-left {
		min-width: 66px;
	}

	#ltr-floater-ls.ltr-floater-ls-flags.ltr-bottom-right,
	#ltr-floater-ls.ltr-floater-ls-flags.ltr-bottom-left {
		min-width: 60px;
	}
}

/* Position : collé au bord, décalé de 10 % du côté choisi. */
#ltr-floater-ls.ltr-bottom-right {
	top: auto;
	right: 10%;
	bottom: 0;
	border-radius: 8px 8px 0 0;
}

#ltr-floater-ls.ltr-bottom-left {
	top: auto;
	bottom: 0;
	left: 10%;
	border-radius: 8px 8px 0 0;
}

#ltr-floater-ls.ltr-top-right {
	top: 0;
	right: 10%;
	bottom: auto;
	border-radius: 0 0 5px 5px;
}

#ltr-floater-ls.ltr-top-left {
	top: 0;
	bottom: auto;
	left: 10%;
	border-radius: 0 0 5px 5px;
}

/* La barre d'administration de WordPress occupe le haut de l'écran aux utilisateurs connectés. */
body.admin-bar #ltr-floater-ls.ltr-top-right,
body.admin-bar #ltr-floater-ls.ltr-top-left {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar #ltr-floater-ls.ltr-top-right,
	body.admin-bar #ltr-floater-ls.ltr-top-left {
		top: 46px;
	}
}

/* Replié : la langue courante seule. Déplié (survol, ou focus clavier) : toute la liste. */
#ltr-floater-ls-current-language {
	display: block;
	width: 100%;
	height: 100%;
	text-align: left;
}

#ltr-floater-ls.ltr-floater-ls-flags #ltr-floater-ls-current-language {
	padding-top: 3px;
}

#ltr-floater-ls-language-list {
	display: none;
	max-height: 300px;
	overflow-y: auto;
	text-align: left;
}

#ltr-floater-ls:hover,
#ltr-floater-ls:focus-within {
	height: auto;
}

#ltr-floater-ls:hover #ltr-floater-ls-current-language,
#ltr-floater-ls:focus-within #ltr-floater-ls-current-language {
	display: none;
}

#ltr-floater-ls:hover #ltr-floater-ls-language-list,
#ltr-floater-ls:focus-within #ltr-floater-ls-language-list {
	display: block;
}

/* Noms courts : centrés, avec un peu d'air au-dessus de la liste. */
#ltr-floater-ls.ltr-floater-ls-codes #ltr-floater-ls-current-language a,
#ltr-floater-ls.ltr-floater-ls-codes #ltr-floater-ls-language-list {
	margin-top: 6px;
	text-align: center;
}

/* Espacement de la liste selon l'affichage et le bord auquel l'onglet est collé. */
#ltr-floater-ls .ltr-language-wrap {
	padding: 11px;
}

#ltr-floater-ls.only-flags .ltr-language-wrap {
	padding: 11px 0;
}

#ltr-floater-ls.ltr-floater-ls-names.ltr-bottom-right .ltr-language-wrap,
#ltr-floater-ls.ltr-floater-ls-names.ltr-bottom-left .ltr-language-wrap {
	padding: 12px 12px 6px;
}

#ltr-floater-ls.ltr-floater-ls-names.ltr-top-right .ltr-language-wrap,
#ltr-floater-ls.ltr-floater-ls-names.ltr-top-left .ltr-language-wrap {
	padding: 0 12px 12px;
}

#ltr-floater-ls.ltr-floater-ls-codes.ltr-bottom-right .ltr-language-wrap,
#ltr-floater-ls.ltr-floater-ls-codes.ltr-bottom-left .ltr-language-wrap {
	padding: 9px 9px 6px;
}

#ltr-floater-ls.ltr-floater-ls-codes.ltr-top-right .ltr-language-wrap,
#ltr-floater-ls.ltr-floater-ls-codes.ltr-top-left .ltr-language-wrap {
	padding: 0 9px 9px;
}

#ltr-floater-ls.only-flags.ltr-top-right .ltr-language-wrap,
#ltr-floater-ls.only-flags.ltr-top-left .ltr-language-wrap {
	padding: 9px;
}

/* Un lien de langue. */
#ltr-floater-ls a {
	display: flex;
	flex-flow: row wrap;
	align-items: center;
	padding: 10px 12px;
	font-size: 90%;
	white-space: nowrap;
	text-decoration: none;
	box-shadow: none;
}

#ltr-floater-ls.ltr-color-dark a {
	color: #bdbdbd;
}

#ltr-floater-ls.ltr-color-light a {
	color: #404040;
}

#ltr-floater-ls.ltr-color-dark .ltr-language-wrap a:hover,
#ltr-floater-ls.ltr-color-dark .ltr-language-wrap a:focus {
	color: #fff;
	background: #4f4f4f;
	border-radius: 2px;
}

#ltr-floater-ls.ltr-color-light .ltr-language-wrap a:hover,
#ltr-floater-ls.ltr-color-light .ltr-language-wrap a:focus {
	color: #1e1e1e;
	background: #f0f0f0;
	border-radius: 2px;
}

/* La langue courante : affichée, mais pas cliquable. */
#ltr-floater-ls a.ltr-ls-disabled-language {
	cursor: default;
	pointer-events: none;
}

#ltr-floater-ls-current-language a {
	margin-top: 6px;
	padding: 10px 24px;
}

#ltr-floater-ls .ltr-language-wrap a.ltr-ls-disabled-language {
	margin-top: 6px;
}

#ltr-floater-ls.ltr-floater-ls-flags #ltr-floater-ls-current-language a {
	margin-top: 12px;
}

/* Petits écrans : le drapeau replié descend de 3 px sur une tablette, remonte d'autant sur un téléphone. */
@media screen and (max-width: 1000px) {
	#ltr-floater-ls.ltr-floater-ls-flags #ltr-floater-ls-current-language a {
		margin-top: 15px;
	}
}

@media screen and (max-width: 500px) {
	#ltr-floater-ls-current-language a,
	#ltr-floater-ls.ltr-floater-ls-codes #ltr-floater-ls-current-language a {
		margin-top: 0;
		padding-top: 16px;
	}

	#ltr-floater-ls.ltr-floater-ls-flags #ltr-floater-ls-current-language a {
		margin-top: 5px;
	}

	#ltr-floater-ls .ltr-language-wrap a.ltr-ls-disabled-language {
		margin-top: 0;
		padding-top: 16px;
	}
}

/* Drapeaux : 18 × 12, seuls (centrés) ou suivis du texte. */
#ltr-floater-ls .ltr-flag-image {
	width: 18px;
	max-width: none;
	height: 12px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	vertical-align: middle;
}

#ltr-floater-ls.only-flags .ltr-flag-image {
	display: block;
	margin: 0 auto;
}

#ltr-floater-ls.ltr-with-flags .ltr-flag-image {
	display: inline;
	margin-right: 5px;
}

@media print {
	#ltr-floater-ls {
		display: none;
	}
}

/* ── Menu déroulant du shortcode ──────────────────────────────────────────── */

/*
 * Une boîte montre la langue courante ; au survol (ou au focus clavier) la liste de toutes les langues la
 * recouvre, au moins aussi large qu'elle. Sans JavaScript : la boîte a la largeur de son contenu.
 */
.ltr-language-switcher {
	position: relative;
	box-sizing: border-box;
	width: max-content;
	max-width: 100%;
	height: 42px;
	white-space: nowrap;
}

.ltr-language-switcher > div {
	box-sizing: border-box;
	padding: 4px 36px 3px 13px;
	border: 1.5px solid #949494;
	border-radius: 2px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1 2.5l3 3 3-3' fill='none' stroke='%231e1e1e' stroke-width='1.2'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: calc(100% - 20px) calc(1em + 2px);
	background-size: 8px 8px;
}

.ltr-language-switcher > div:hover {
	background-image: none;
}

.ltr-language-switcher > div > a {
	display: block;
	padding: 7px 12px;
	border-radius: 3px;
	color: #1e1e1e;
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	text-decoration: none;
}

.ltr-language-switcher > div > a:hover,
.ltr-language-switcher > div > a:focus {
	background: #f0f0f0;
	border-radius: 2px;
}

.ltr-language-switcher > div > a.ltr-ls-disabled-language {
	cursor: default;
}

.ltr-language-switcher > div > a.ltr-ls-disabled-language:hover {
	background: none;
}

.ltr-language-switcher > div > a > img {
	display: inline;
	width: 18px;
	height: 12px;
	margin: 0 3px;
	border-radius: 0;
}

.ltr-language-switcher .ltr-ls-shortcode-language {
	position: absolute;
	z-index: 1;
	top: 0;
	left: 0;
	display: none;
	overflow-y: auto;
	min-width: 100%;
	max-height: 250px;
}

.ltr-language-switcher:hover .ltr-ls-shortcode-current-language,
.ltr-language-switcher:focus-within .ltr-ls-shortcode-current-language {
	visibility: hidden;
}

.ltr-language-switcher:hover .ltr-ls-shortcode-language,
.ltr-language-switcher:focus-within .ltr-ls-shortcode-language {
	display: block;
	padding: 4px 13px;
}
/* ── Élément de menu ──────────────────────────────────────────────────────── */

.ltr-menu-item .ltr-flag-image {
	display: inline-block;
	width: 18px;
	height: 12px;
	margin: -1px 5px;
	padding: 0;
	border: 0;
	border-radius: 0;
	vertical-align: baseline;
}
