/* Delmain Translate - language switcher
   Deliberately minimal: inherits the theme's font and colours so it looks
   native in a Divi header without any per-site overrides. */

.dlmt-switcher__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	margin: 0;
	padding: 0;
	list-style: none;
	align-items: center;
}

.dlmt-switcher__item {
	margin: 0;
	padding: 0;
	line-height: 1.2;
}

.dlmt-switcher__item a {
	text-decoration: none;
	color: inherit;
	opacity: 0.7;
	transition: opacity 0.15s ease;
}

.dlmt-switcher__item a:hover,
.dlmt-switcher__item a:focus-visible {
	opacity: 1;
	text-decoration: underline;
}

.dlmt-switcher__item.is-current a {
	opacity: 1;
	font-weight: 600;
	cursor: default;
}

.dlmt-switcher__sep {
	opacity: 0.35;
	list-style: none;
}

.dlmt-switcher__select {
	font: inherit;
	color: inherit;
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 3px;
	padding: 0.25em 1.75em 0.25em 0.5em;
	cursor: pointer;
}

.dlmt-switcher__noscript {
	margin: 0.25em 0 0;
	font-size: 0.85em;
}

/* Switcher added as a menu item. Kept deliberately light so it inherits the
   theme's nav styling instead of fighting it. */

.dlmt-switcher-item > a {
	text-transform: none;
}

.dlmt-switcher-item > a::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: 0.4em;
	vertical-align: -0.12em;
	background-color: currentColor;
	-webkit-mask: var(--dlmt-globe) center / contain no-repeat;
	mask: var(--dlmt-globe) center / contain no-repeat;
	opacity: 0.75;
}

:root {
	--dlmt-globe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18a14 14 0 0 1 0-18'/%3E%3C/svg%3E");
}

/* Flags. Sized in ems so the flag tracks the surrounding font size. */

.dlmt-flag {
	display: inline-block;
	width: 1.5em;
	height: 1em;
	vertical-align: -0.1em;
	border-radius: 2px;
	overflow: hidden;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
	line-height: 0;
}

.dlmt-flag svg {
	display: block;
	width: 100%;
	height: 100%;
}

.dlmt-flag--badge {
	width: auto;
	min-width: 1.9em;
	height: auto;
	padding: 0.1em 0.35em;
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.5;
	text-align: center;
	border-radius: 3px;
	background: currentColor;
	box-shadow: none;
}

.dlmt-flag + .dlmt-switcher__label {
	margin-left: 0.45em;
}

/* A flag-only switcher in a menu should not inherit the nav's letter spacing. */
.dlmt-switcher-item > a .dlmt-flag {
	margin-right: 0;
}

/* Several languages mean several menu items, so the theme's gap between menu
   items lands between the flags and they stop reading as one control. Close it
   up, but only between switcher items: the gap to the menu item before them is
   the theme's business. */
:root {
	--dlmt-switcher-gap: 0.4em;
}

.dlmt-switcher-item:has( + .dlmt-switcher-item ) {
	padding-right: 0 !important;
	margin-right: 0 !important;
}

.dlmt-switcher-item + .dlmt-switcher-item {
	margin-left: var(--dlmt-switcher-gap);
}

.dlmt-switcher-item + .dlmt-switcher-item > a {
	padding-left: 0 !important;
}

/* Stacked menus put one language per line; the horizontal nudge would only
   push them out of alignment. */
@media screen and (max-width: 980px) {
	.dlmt-switcher-item + .dlmt-switcher-item {
		margin-left: 0;
	}

	.dlmt-switcher-item + .dlmt-switcher-item > a {
		padding-left: inherit !important;
	}
}

.dlmt-switcher-item > a:has(.dlmt-flag)::before {
	display: none;
}
