/*!
 * Mixt Multilingual — language switcher.
 * Every colour and size is a CSS variable on .mxml-switcher:
 *   .mxml-switcher { --mxml-color: #333; --mxml-bg-current: #eef; }
 */

.mxml-switcher {
	--mxml-gap: 6px;
	--mxml-inner-gap: 8px;
	--mxml-radius: 8px;
	--mxml-transition: 150ms;
	--mxml-color: inherit;
	--mxml-bg: transparent;
	--mxml-color-hover: inherit;
	--mxml-bg-hover: rgba(0, 0, 0, .05);
	--mxml-border-hover: transparent;
	--mxml-color-current: inherit;
	--mxml-bg-current: rgba(0, 0, 0, .06);
	--mxml-border-current: transparent;
	--mxml-weight-current: 600;
	--mxml-missing-opacity: .6;
	--mxml-flag-size: 1.15em;
	--mxml-flag-radius: 3px;
	--mxml-icon-size: 1.1em;
	--mxml-line-color: currentColor;
	--mxml-toggle-color: inherit;
	--mxml-toggle-bg: transparent;
	--mxml-btn-icon-size: 1.15em;
	--mxml-arrow-color: currentColor;
	--mxml-arrow-size: 14px;
	--mxml-arrow-gap: 0px;
	--mxml-arrow-open: rotate(180deg);
	--mxml-menu-bg: #ffffff;
	--mxml-menu-width: 180px;
	--mxml-menu-offset: 6px;
	--mxml-menu-radius: 10px;
	--mxml-menu-gap: 0px;
	--mxml-menu-x: 0;
	--mxml-anim: 180ms;

	position: relative;
	box-sizing: border-box;
	width: fit-content;
	max-width: 100%;
	font: inherit;
	line-height: 1.3;
}
.mxml-switcher *,
.mxml-switcher *::before,
.mxml-switcher *::after { box-sizing: border-box; }

.mxml-switcher .mxml-switcher__list,
.mxml-switcher .mxml-switcher__menu {
	margin: 0;
	padding: 0;
	list-style: none;
}
.mxml-switcher .mxml-switcher__item { margin: 0; padding: 0; }
.mxml-switcher .mxml-switcher__item::before,
.mxml-switcher .mxml-switcher__item::marker,
.mxml-switcher .mxml-switcher__sep::marker { content: none; }

.mxml-switcher--horizontal .mxml-switcher__list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mxml-gap); }
.mxml-switcher--vertical .mxml-switcher__list { display: flex; flex-direction: column; align-items: stretch; gap: var(--mxml-gap); }
.mxml-switcher .mxml-switcher__sep { display: flex; align-items: center; margin: 0; padding: 0; opacity: .5; line-height: 1; user-select: none; }
.mxml-switcher--vertical .mxml-switcher__sep { justify-content: center; }

/* Items */
.mxml-switcher .mxml-switcher__link,
.mxml-switcher .mxml-switcher__toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: var(--mxml-inner-gap);
	padding: 6px 10px;
	border: 1px solid transparent;
	border-radius: var(--mxml-radius);
	background: var(--mxml-bg);
	color: var(--mxml-color);
	font: inherit;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color var(--mxml-transition) ease, color var(--mxml-transition) ease, border-color var(--mxml-transition) ease, box-shadow var(--mxml-transition) ease, transform var(--mxml-transition) ease;
}
.mxml-switcher--vertical .mxml-switcher__link { display: flex; }
.mxml-switcher .mxml-switcher__link:hover,
.mxml-switcher .mxml-switcher__link:focus-visible {
	background: var(--mxml-bg-hover);
	border-color: var(--mxml-border-hover);
	color: var(--mxml-color-hover);
	text-decoration: none;
}
.mxml-switcher .mxml-switcher__link.is-current {
	background: var(--mxml-bg-current);
	border-color: var(--mxml-border-current);
	color: var(--mxml-color-current);
	font-weight: var(--mxml-weight-current);
}
.mxml-switcher .mxml-switcher__link.is-missing:not(.is-current) { opacity: var(--mxml-missing-opacity); }
.mxml-switcher .mxml-switcher__link:focus-visible,
.mxml-switcher .mxml-switcher__toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Hover effects */
.mxml-switcher--fx-lift .mxml-switcher__link:hover { transform: translateY(-2px); }
.mxml-switcher--fx-grow .mxml-switcher__link:hover { transform: scale(1.06); }
.mxml-switcher--fx-underline .mxml-switcher__link::after {
	content: "";
	position: absolute;
	left: 10%;
	right: 10%;
	bottom: 2px;
	height: 2px;
	border-radius: 2px;
	background: var(--mxml-line-color);
	transform: scaleX(0);
	transition: transform var(--mxml-transition) ease;
}
.mxml-switcher--fx-underline .mxml-switcher__link:hover::after,
.mxml-switcher--fx-underline .mxml-switcher__link.is-current::after { transform: scaleX(1); }

/* Flags, icons, images */
.mxml-switcher .mxml-switcher__flag { font-size: var(--mxml-flag-size); line-height: 1; }
.mxml-switcher .mxml-switcher__flag--img,
.mxml-switcher .mxml-switcher__icon img {
	display: block;
	width: auto;
	height: var(--mxml-flag-size);
	max-width: none;
	border-radius: var(--mxml-flag-radius);
	object-fit: cover;
}
.mxml-switcher .mxml-switcher__icon,
.mxml-switcher .mxml-switcher__btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	line-height: 1;
	transition: color var(--mxml-transition) ease;
}
.mxml-switcher .mxml-switcher__icon { font-size: var(--mxml-icon-size); color: var(--mxml-icon-color, currentColor); }
.mxml-switcher .mxml-switcher__link:hover .mxml-switcher__icon { color: var(--mxml-icon-color-hover, var(--mxml-icon-color, currentColor)); }
.mxml-switcher .mxml-switcher__link.is-current .mxml-switcher__icon { color: var(--mxml-icon-color-current, var(--mxml-icon-color, currentColor)); }
.mxml-switcher .mxml-switcher__icon svg,
.mxml-switcher .mxml-switcher__btn-icon svg { width: 1em; height: 1em; }
.mxml-switcher .mxml-switcher__icon svg:not([fill="none"]),
.mxml-switcher .mxml-switcher__btn-icon svg:not([fill="none"]) { fill: currentColor; }
.mxml-switcher .mxml-switcher__current { display: inline-flex; align-items: center; gap: var(--mxml-inner-gap); }

/* Dropdown button */
.mxml-switcher .mxml-switcher__toggle {
	margin: 0;
	background: var(--mxml-toggle-bg);
	color: var(--mxml-toggle-color);
	box-shadow: none;
	cursor: pointer;
	line-height: inherit;
	text-transform: none;
	letter-spacing: inherit;
	min-height: 0;
}
.mxml-switcher .mxml-switcher__toggle:hover,
.mxml-switcher.is-open .mxml-switcher__toggle {
	background: var(--mxml-toggle-bg-hover, var(--mxml-toggle-bg-auto, var(--mxml-bg-hover)));
	border-color: var(--mxml-toggle-border-hover, var(--mxml-border-hover));
	color: var(--mxml-toggle-color-hover, var(--mxml-toggle-color-auto, var(--mxml-color-hover)));
}
.mxml-switcher .mxml-switcher__btn-icon { font-size: var(--mxml-btn-icon-size); color: var(--mxml-btn-icon-color, currentColor); }
.mxml-switcher .mxml-switcher__toggle:hover .mxml-switcher__btn-icon,
.mxml-switcher.is-open .mxml-switcher__btn-icon { color: var(--mxml-btn-icon-color-hover, var(--mxml-btn-icon-color, currentColor)); }
.mxml-switcher .mxml-switcher__arrow {
	flex: none;
	width: var(--mxml-arrow-size);
	height: var(--mxml-arrow-size);
	margin-left: var(--mxml-arrow-gap);
	fill: none;
	stroke: var(--mxml-arrow-color);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform var(--mxml-transition) ease;
}
.mxml-switcher .mxml-switcher__arrow--icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	font-size: var(--mxml-arrow-size);
	line-height: 1;
	color: var(--mxml-arrow-color);
	stroke: none;
}
.mxml-switcher .mxml-switcher__arrow--icon svg { width: 1em; height: 1em; fill: currentColor; }
.mxml-switcher.is-open .mxml-switcher__arrow { transform: var(--mxml-arrow-open); }

/* Dropdown menu: hidden with visibility so it can animate and is never focusable while closed. */
.mxml-switcher .mxml-switcher__menu {
	position: absolute;
	top: calc(100% + var(--mxml-menu-offset));
	left: 0;
	z-index: 999;
	display: flex;
	flex-direction: column;
	gap: var(--mxml-menu-gap);
	min-width: min(var(--mxml-menu-width), calc(100vw - 16px));
	max-width: calc(100vw - 16px);
	padding: 6px;
	border-radius: var(--mxml-menu-radius);
	background: var(--mxml-menu-bg);
	box-shadow: 0 12px 32px -8px rgba(15, 23, 42, .25), 0 0 0 1px rgba(15, 23, 42, .06);
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transform: translateX(var(--mxml-menu-x));
	transition: opacity var(--mxml-anim) ease, transform var(--mxml-anim) ease, visibility 0s linear var(--mxml-anim);
}
/* Invisible bridge over the gap, so a hover menu does not close on the way down. */
.mxml-switcher .mxml-switcher__menu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: var(--mxml-menu-offset);
}
.mxml-switcher--anim-none .mxml-switcher__menu { transition: none; }
.mxml-switcher--anim-slide .mxml-switcher__menu { transform: translate(var(--mxml-menu-x), -8px); }
.mxml-switcher--anim-zoom .mxml-switcher__menu { transform: translateX(var(--mxml-menu-x)) scale(.94); transform-origin: top center; }

.mxml-switcher.is-open .mxml-switcher__menu,
.mxml-switcher--open-hover:hover .mxml-switcher__menu,
.mxml-switcher--open-hover:focus-within .mxml-switcher__menu,
.mxml-switcher--dropdown:not([data-mxml-ready]):hover .mxml-switcher__menu,
.mxml-switcher--dropdown:not([data-mxml-ready]):focus-within .mxml-switcher__menu {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transform: translateX(var(--mxml-menu-x));
	transition: opacity var(--mxml-anim) ease, transform var(--mxml-anim) ease, visibility 0s;
}
.mxml-switcher--anim-none.is-open .mxml-switcher__menu,
.mxml-switcher--anim-none.mxml-switcher--open-hover:hover .mxml-switcher__menu { transition: none; }
.mxml-switcher--open-hover:hover .mxml-switcher__arrow,
.mxml-switcher--open-hover:focus-within .mxml-switcher__arrow { transform: var(--mxml-arrow-open); }

.mxml-switcher .mxml-switcher__menu .mxml-switcher__link {
	display: flex;
	width: 100%;
	background: var(--mxml-menu-item-bg, var(--mxml-bg));
	/* The menu has its own (white) background, so it must not inherit a header's white text. */
	color: var(--mxml-menu-color, #1f2937);
}
.mxml-switcher .mxml-switcher__menu .mxml-switcher__link:hover,
.mxml-switcher .mxml-switcher__menu .mxml-switcher__link:focus-visible {
	background: var(--mxml-menu-bg-hover, var(--mxml-bg-hover));
	color: var(--mxml-menu-color-hover, var(--mxml-menu-color, #111827));
}
.mxml-switcher .mxml-switcher__menu .mxml-switcher__link.is-current {
	background: var(--mxml-menu-bg-current, var(--mxml-bg-current));
	color: var(--mxml-menu-color-current, var(--mxml-menu-color, #111827));
}

.mxml-switcher-empty { padding: 8px 12px; border: 1px dashed #c3c4c7; color: #50575e; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
	.mxml-switcher *,
	.mxml-switcher .mxml-switcher__menu { transition: none !important; }
}

/* Kept on screen: the script flips the menu when it would run off an edge. */
.mxml-switcher.mxml-flip-right .mxml-switcher__menu { left: auto !important; right: 0 !important; --mxml-menu-x: 0 !important; }
.mxml-switcher.mxml-flip-left .mxml-switcher__menu { left: 0 !important; right: auto !important; --mxml-menu-x: 0 !important; }
[dir="rtl"] .mxml-switcher .mxml-switcher__menu { left: auto; right: 0; }
.mxml-switcher .mxml-switcher__flag--img.mxml-flag-win { height: calc(var(--mxml-flag-size) * .8); }
.mxml-switcher.mxml-switcher--no-rotate { --mxml-arrow-open: none !important; }
