/**
 * Text-only language switcher (spec §122: text, no flags; §116: must not
 * disturb the theme layout). Inherits the theme's font and colours; the only
 * opinionated surface is the dropdown panel, which needs a readable background.
 */

.mlt-switcher {
	display: inline-block;
	font: inherit;
	color: inherit;
	line-height: inherit;
}

.mlt-switcher a {
	color: inherit;
	text-decoration: none;
}

.mlt-switcher a:hover,
.mlt-switcher a:focus {
	text-decoration: underline;
}

/* ------------------------------------------------------------------ *
 * Dropdown variant: current language + caret, absolutely-positioned list
 * ------------------------------------------------------------------ */

.mlt-switcher-dropdown {
	position: relative;
}

.mlt-switcher-toggle {
	background: none;
	border: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	line-height: inherit;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
}

.mlt-switcher-toggle:hover .mlt-switcher-label,
.mlt-switcher-toggle:focus .mlt-switcher-label {
	text-decoration: underline;
}

/* 2.3.22: globe before the current language. The toggle's flex gap already
 * spaces it, so the inline margin the menu variant needs is dropped here. */
.mlt-switcher-toggle .mlt-switcher-globe {
	margin-inline-end: 0 !important;
}

.mlt-switcher-caret {
	font-size: 0.75em;
	line-height: 1;
}

.mlt-switcher-list {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 99999;
	margin: 0.25em 0 0;
	padding: 0.25em 0;
	list-style: none;
	background: var(--mlt-switcher-bg, #fff);
	color: var(--mlt-switcher-color, #333);
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 3px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	min-width: 100%;
	white-space: nowrap;
	text-align: left;
}

.mlt-switcher-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mlt-switcher-list a,
.mlt-switcher-list .mlt-switcher-current {
	display: block;
	padding: 0.3em 1em;
	color: inherit;
}

.mlt-switcher-list a:hover,
.mlt-switcher-list a:focus {
	background: rgba(0, 0, 0, 0.06);
	text-decoration: none;
}

/* Current language inside the list: highlighted + check mark (UI P09). */
.mlt-switcher-list .mlt-switcher-current {
	font-weight: 600;
	color: var(--mlt-switcher-current-color, #2271b1);
}

.mlt-switcher-list .mlt-switcher-current::after {
	content: " \2713";
}

/* ------------------------------------------------------------------ *
 * Inline variant: "English | Español | 日本語", current bold, non-link
 * ------------------------------------------------------------------ */

.mlt-switcher-inline .mlt-switcher-sep {
	margin: 0 0.5em;
	opacity: 0.5;
}

.mlt-switcher-inline .mlt-switcher-current {
	font-weight: 700;
}

/* Optional automatic footer placement (Settings -> footer switcher). */
.mlt-switcher-footer {
	clear: both;
	text-align: center;
	padding: 1em 0;
}

/* Right-to-left pages (html[dir="rtl"], set by the plugin for ar/he/fa/ur…):
 * the dropdown list opens from the right edge. Theme icons and arrows are the
 * theme's own; mirror them with a [dir="rtl"] rule in the theme's CSS. */
html[dir="rtl"] .mlt-switcher-list {
	left: auto;
	right: 0;
}
