/**
 * Simple Multilang language switcher.
 *
 * Reset common theme rules inside the component so every presentation is
 * usable before site-specific styling is added.
 */
.sml-language-switcher {
	--sml-switcher-gap: .5rem;
	--sml-switcher-radius: .5rem;
	--sml-switcher-background: #fff;
	--sml-switcher-color: #334155;
	--sml-switcher-muted-background: #f1f5f9;
	--sml-switcher-border-color: #cbd5e1;
	--sml-switcher-active-background: #2563eb;
	--sml-switcher-active-color: #fff;
	--sml-switcher-focus-color: #2271b1;
	--sml-switcher-font-size: .875rem;
	display: inline-block;
	width: auto;
	max-width: 100%;
	margin: .125rem 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--sml-switcher-color);
	font-family: inherit;
	font-size: var(--sml-switcher-font-size);
	font-style: normal;
	font-weight: 400;
	line-height: 1.25;
	text-align: start;
	vertical-align: middle;
}

.sml-language-switcher *,
.sml-language-switcher *::before,
.sml-language-switcher *::after {
	box-sizing: border-box;
}

.sml-language-switcher .sml-switcher-list {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--sml-switcher-gap);
	width: auto;
	max-width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
}

.sml-language-switcher .sml-switcher-list > .sml-language {
	display: block;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	line-height: inherit;
}

.sml-language-switcher .sml-switcher-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	width: auto;
	min-width: 2.5rem;
	max-width: 100%;
	min-height: 2.5rem;
	margin: 0;
	padding: .6rem .8rem;
	border: 0;
	border-radius: var(--sml-switcher-radius);
	background: transparent;
	box-shadow: none;
	color: var(--sml-switcher-color);
	font: inherit;
	font-size: inherit;
	font-weight: 500;
	line-height: 1.1;
	text-align: center;
	text-decoration: none !important;
	text-transform: none;
	white-space: nowrap;
	overflow-wrap: normal;
	transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.sml-language-switcher .sml-switcher-flag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
	font-size: 1.2em;
	font-style: normal;
	font-weight: 400;
	line-height: 1;
	text-decoration: none;
}

.sml-language-switcher .sml-switcher-label-text {
	min-width: 0;
}

.sml-language-switcher.sml-switcher-label-flag .sml-switcher-link {
	min-width: 2.5rem;
	padding-inline: .65rem;
}

.sml-language-switcher .sml-switcher-link:hover {
	background: var(--sml-switcher-muted-background);
	color: var(--sml-switcher-color);
	text-decoration: none;
}

/* Inline links stay quiet and compact. */
.sml-switcher-mode-links .sml-switcher-link {
	min-width: 0;
	min-height: 2rem;
	padding: .35rem .25rem;
	border-radius: .25rem;
}

.sml-switcher-mode-links .is-current > .sml-switcher-link {
	box-shadow: inset 0 -2px 0 var(--sml-switcher-active-background);
	color: var(--sml-switcher-color);
	font-weight: 700;
}

/* Button presentation has a clear, theme-neutral selected state. */
.sml-switcher-mode-buttons .sml-switcher-link {
	border: 1px solid var(--sml-switcher-border-color);
	background: var(--sml-switcher-background);
}

.sml-switcher-mode-buttons .sml-switcher-link:hover {
	border-color: color-mix(in srgb, var(--sml-switcher-color) 45%, var(--sml-switcher-border-color));
}

.sml-switcher-mode-buttons .is-current > .sml-switcher-link {
	border-color: var(--sml-switcher-active-background);
	background: var(--sml-switcher-active-background);
	color: var(--sml-switcher-active-color);
}

.sml-language-switcher .sml-switcher-link:focus-visible,
.sml-language-switcher .sml-switcher-select:focus-visible,
.sml-language-switcher .sml-switcher-summary:focus-visible {
	outline: 3px solid var(--sml-switcher-focus-color);
	outline-offset: 2px;
}

/* Fixed component sizing prevents oversized theme form rules. */
.sml-language-switcher .sml-switcher-select {
	display: block;
	width: auto;
	max-width: min(100%, 18rem);
	height: 2.5rem;
	min-height: 2.5rem;
	margin: 0;
	padding-block: 0;
	padding-inline: .75rem 2rem;
	border: 1px solid var(--sml-switcher-border-color);
	border-radius: var(--sml-switcher-radius);
	background-color: var(--sml-switcher-background);
	box-shadow: none;
	color: var(--sml-switcher-color);
	font: inherit;
	font-size: inherit;
	font-weight: 500;
	line-height: normal;
	text-indent: 0;
	text-transform: none;
	vertical-align: middle;
}

/* Dropdown stays compact and opens above the page as an overlay panel. */
.sml-language-switcher .sml-switcher-dropdown {
	position: relative;
	display: block;
	width: max-content;
	min-width: 10rem;
	max-width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

.sml-language-switcher .sml-switcher-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	width: 100%;
	min-width: 10rem;
	max-width: 18rem;
	min-height: 2.5rem;
	margin: 0;
	padding: .6rem .75rem;
	border: 1px solid var(--sml-switcher-border-color);
	border-radius: var(--sml-switcher-radius);
	background: var(--sml-switcher-background);
	box-shadow: none;
	color: var(--sml-switcher-color);
	font: inherit;
	font-size: inherit;
	font-weight: 500;
	line-height: 1.1;
	text-align: start;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	list-style: none;
}

.sml-language-switcher .sml-switcher-summary-label {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	min-width: 0;
}

.sml-language-switcher.sml-switcher-label-flag .sml-switcher-summary {
	width: auto;
	min-width: 4.25rem;
}

.sml-language-switcher .sml-switcher-summary::-webkit-details-marker {
	display: none;
}

.sml-language-switcher .sml-switcher-summary::after {
	width: .5rem;
	height: .5rem;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	content: "";
	flex: 0 0 auto;
	transform: rotate(45deg) translateY(-.125rem);
	transition: transform .16s ease;
}

.sml-language-switcher .sml-switcher-dropdown[open] > .sml-switcher-summary::after {
	transform: rotate(225deg) translate(-.125rem, -.125rem);
}

.sml-language-switcher .sml-switcher-dropdown[open] > .sml-switcher-list {
	position: absolute;
	z-index: 9999;
	top: calc(100% + .375rem);
	inset-inline-start: 0;
	display: grid;
	align-items: stretch;
	gap: .125rem;
	width: max-content;
	min-width: 100%;
	max-width: min(90vw, 18rem);
	margin: 0;
	padding: .35rem;
	border: 1px solid var(--sml-switcher-border-color);
	border-radius: calc(var(--sml-switcher-radius) + .125rem);
	background: var(--sml-switcher-background);
	box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
}

.sml-language-switcher .sml-switcher-dropdown:not([open]) > .sml-switcher-list {
	display: none;
}

.sml-language-switcher .sml-switcher-dropdown .sml-switcher-link {
	justify-content: flex-start;
	width: 100%;
	min-height: 2.25rem;
	padding: .55rem .65rem;
	border: 0;
	border-radius: max(.25rem, calc(var(--sml-switcher-radius) - .125rem));
	background: transparent;
	color: var(--sml-switcher-color);
	text-align: start;
}

.sml-language-switcher .sml-switcher-dropdown .is-current > .sml-switcher-link {
	background: var(--sml-switcher-muted-background);
	color: var(--sml-switcher-color);
	font-weight: 700;
}

.sml-menu-switcher-item {
	min-width: 0;
}

.sml-switcher-placement {
	margin-block: .5rem;
}

@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
	.sml-switcher-mode-buttons .sml-switcher-link:hover {
		border-color: var(--sml-switcher-color);
	}
}

@media (max-width: 480px) {
	.sml-language-switcher {
		--sml-switcher-gap: .375rem;
	}

	.sml-language-switcher .sml-switcher-link {
		padding-inline: .7rem;
	}

	.sml-language-switcher .sml-switcher-dropdown[open] > .sml-switcher-list {
		max-width: calc(100vw - 2rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sml-language-switcher *,
	.sml-language-switcher *::before,
	.sml-language-switcher *::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
