/**
 * MaxMultilingualPro — language switcher (front-end).
 *
 * Self contained: no external font, no framework, RTL aware.
 */

.maxmlp-switcher-wrap {
	display: inline-block;
	max-width: 100%;
}

.maxmlp-switcher-wrap .maxmlp-switcher__title {
	font-size: 1em;
	margin: 0 0 8px;
}

.maxmlp-switcher {
	display: inline-block;
}

.maxmlp-switcher--dropdown {
	max-width: 100%;
	padding: 6px 8px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background-color: #fff;
	color: #1e1e1e;
	line-height: 1.6;
}

.maxmlp-switcher--list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
}

.maxmlp-switcher--list .maxmlp-switcher__item {
	margin: 0;
	padding: 0;
}

.maxmlp-switcher__name {
	white-space: nowrap;
}

.maxmlp-switcher--list .maxmlp-switcher__item a {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	text-decoration: none;
	color: inherit;
	padding: 2px 0;
	opacity: 0.72;
}

.maxmlp-switcher--list .maxmlp-switcher__item a:hover,
.maxmlp-switcher--list .maxmlp-switcher__item a:focus {
	opacity: 1;
	text-decoration: underline;
}

.maxmlp-switcher--list .maxmlp-switcher__item.is-current > a {
	opacity: 1;
	font-weight: 700;
}

.maxmlp-switcher--list .maxmlp-switcher__item.is-missing > a {
	opacity: 0.42;
	text-decoration: line-through;
}

.maxmlp-flag {
	display: inline-block;
	vertical-align: middle;
	width: 18px;
	height: 12px;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.maxmlp-flag--small {
	width: 16px;
	height: 11px;
}

.maxmlp-flag--missing {
	filter: grayscale(1);
	opacity: 0.5;
}

[dir="rtl"] .maxmlp-switcher--list,
.rtl .maxmlp-switcher--list {
	flex-direction: row-reverse;
}


/* Keep the current flag INSIDE the native dropdown control. This avoids
 * changing the theme's select styling or pushing the flag outside the field. */
.maxmlp-switcher__control {
	position: relative;
	display: inline-block;
	max-width: 100%;
	line-height: 1;
}

.maxmlp-switcher__control .maxmlp-switcher--dropdown {
	position: relative;
	z-index: 1;
}

.maxmlp-switcher__current-flag {
	position: absolute;
	top: 50%;
	inset-inline-start: 10px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 12px;
	transform: translateY(-50%);
	pointer-events: none;
}

/* Sized without the priority tier on purpose: the selector is already specific
 * enough for a standalone site, and staying out of that tier lets a theme
 * (which loads either side of this sheet) restyle the flag. */
.maxmlp-switcher__current-flag .maxmlp-flag {
	display: block;
	width: 18px;
	height: 12px;
	max-width: 18px;
	max-height: 12px;
}

/* Flags-only mode: the native <select> is not the trigger any more but the
 * clipped no-JS fallback further down, so it needs no text/padding tweaks —
 * the visual trigger centres its own flag and draws its caret with
 * currentColor. */

/* Flags-only dropdown: visual flag menu, without language names. */
.maxmlp-switcher__control--flags {
	position: relative;
	display: inline-block;
	max-width: 100%;
}

/* Two classes deep rather than one rule plus an RTL twin: `padding-inline-end`
 * leaves room for the caret on whichever side the document direction puts it,
 * and keeping the whole thing out of the priority tier lets a theme decide the
 * trigger's final shape (a header icon, a pill, …) from its own stylesheet. */
.maxmlp-switcher__control--flags .maxmlp-switcher--flags-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 40px;
	min-width: 40px;
	height: 32px;
	min-height: 32px;
	margin: 0;
	padding: 0;
	padding-inline-end: 18px;
	border: 0;
	cursor: pointer;
	font: inherit;
	line-height: 1;
	text-align: center;
}

.maxmlp-switcher--flags-button .maxmlp-switcher__current-flag {
	position: static;
	transform: none;
	display: inline-flex;
	flex: 0 0 18px;
	width: 18px;
	height: 12px;
	margin: 0;
	padding: 0;
}

.maxmlp-switcher__arrow {
	position: absolute;
	top: 50%;
	inset-inline-end: 8px;
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-65%) rotate(45deg);
	pointer-events: none;
}

.maxmlp-switcher__flags-menu {
	position: absolute;
	top: calc(100% + 4px);
	inset-inline-start: 0;
	z-index: 99999;
	display: none;
	box-sizing: border-box;
	width: 40px;
	min-width: 40px;
	margin: 0;
	padding: 4px;
	list-style: none;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.maxmlp-switcher__control--flags.is-open .maxmlp-switcher__flags-menu {
	display: block;
}

.maxmlp-switcher__flag-option {
	margin: 0;
	padding: 0;
}

.maxmlp-switcher__flag-option a {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 32px;
	height: 28px;
	min-width: 32px;
	min-height: 28px;
	margin: 0 auto;
	padding: 0;
	border-radius: 3px;
	text-decoration: none;
}

.maxmlp-switcher__flag-option a:hover,
.maxmlp-switcher__flag-option.is-current a {
	background: rgba(0, 0, 0, .06);
}

/* Keyboard users need to see where they are: never drop the focus ring inside
 * the flags menu. */
.maxmlp-switcher__flag-option a:focus-visible {
	background: rgba(0, 0, 0, .06);
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.maxmlp-switcher__flag-option.is-missing a {
	opacity: .5;
}

.maxmlp-switcher--native-fallback {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
