/**
 * Sélecteur de langue — layout de base.
 *
 * Les couleurs, bordures, typographies et marges intérieures viennent des
 * contrôles Elementor : on ne fixe ici que la structure.
 */

.sonate-lang-switcher {
	--sls-gap: 8px;
	--sls-flag-size: 16px;
	display: flex;
	align-items: center;
	box-sizing: border-box;
}

.sonate-lang-switcher *,
.sonate-lang-switcher *::before,
.sonate-lang-switcher *::after {
	box-sizing: border-box;
}

.sonate-lang-switcher__list,
.sonate-lang-switcher__panel {
	display: flex;
	gap: var(--sls-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.sonate-lang-switcher--inline .sonate-lang-switcher__list {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
}

.sonate-lang-switcher--stack .sonate-lang-switcher__list {
	flex-direction: column;
	align-items: stretch;
}

.sonate-lang-switcher__item {
	margin: 0;
	list-style: none;
}

.sonate-lang-switcher__link,
.sonate-lang-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	text-decoration: none;
	line-height: 1.2;
	transition:
		color 0.2s ease,
		background-color 0.2s ease,
		border-color 0.2s ease;
}

.sonate-lang-switcher__link:hover,
.sonate-lang-switcher__link:focus-visible {
	text-decoration: none;
}

.sonate-lang-switcher__flag {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
}

.sonate-lang-switcher__flag img {
	display: block;
	width: var(--sls-flag-size);
	height: auto;
	max-width: none;
}

/* ---------- Menu déroulant (sans JavaScript) ---------- */

.sonate-lang-switcher__details {
	position: relative;
}

.sonate-lang-switcher__toggle {
	cursor: pointer;
	list-style: none;
	user-select: none;
}

/* Masque le triangle natif de <summary>. */
.sonate-lang-switcher__toggle::-webkit-details-marker {
	display: none;
}

.sonate-lang-switcher__toggle::marker {
	content: "";
}

.sonate-lang-switcher__arrow {
	width: 0.5em;
	height: 0.5em;
	flex: 0 0 auto;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-0.15em) rotate(45deg);
	transition: transform 0.2s ease;
}

.sonate-lang-switcher__details[open] .sonate-lang-switcher__arrow {
	transform: translateY(0.1em) rotate(-135deg);
}

.sonate-lang-switcher--dropdown .sonate-lang-switcher__panel {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	left: 0;
	flex-direction: column;
	align-items: stretch;
	padding: 4px;
}

.sonate-lang-switcher--dropdown .sonate-lang-switcher__panel .sonate-lang-switcher__link {
	width: 100%;
}

/* ---------- Message d'éditeur ---------- */

.sonate-lang-switcher--notice {
	padding: 12px 16px;
	border: 1px dashed currentColor;
	opacity: 0.7;
	font-size: 13px;
}

/* ---------- Accessibilité ---------- */

.sonate-lang-switcher .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
