/*
 * The language switch in the header.
 *
 * Sizes are driven by two custom properties the widget's own controls set,
 * so the same markup sits in a header, a menu or a footer without being
 * told about any of them.
 */

/*
 * Elementor hands a widget inside a container the container's own width
 * variable, which in this header works out at nothing at all; the flag then
 * hangs outside a box of no width and drifts away from the button beside it.
 * Three classes are named so the rule outweighs Elementor's, whichever
 * stylesheet the browser reads first.
 */
.elementor-element.elementor-widget.elementor-widget-diamonds-language-switcher {
	display: flex;
	align-items: center;
	align-self: center;
	width: auto;
}

.db-lang {
	--db-lang-size: 32px;
	--db-lang-color: currentColor;

	display: flex;
	align-items: center;
	gap: 0.75rem;
}

/* On a wide screen the flag sits beside a large button and can carry a
   little more size. */
@media (min-width: 1025px) {
	.db-lang {
		--db-lang-size: 40px;
	}
}

.db-lang__link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--db-lang-color);
	line-height: 1;
	text-decoration: none;
}

.db-lang__link:hover,
.db-lang__link:focus {
	color: var(--db-lang-color);
	opacity: 0.75;
}

.db-lang__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.db-lang__link > svg,
.db-lang__icon svg,
.db-lang__icon i {
	display: block;
	width: var(--db-lang-size);
	height: var(--db-lang-size);
	font-size: var(--db-lang-size);
}

/* Polylang's own flag, which comes at its own aspect ratio. */
.db-lang__link img {
	display: block;
	width: var(--db-lang-size);
	height: auto;
	max-width: none;
}

.db-lang__label {
	font-size: 0.9em;
}

.db-lang__note {
	font-size: 12px;
	opacity: 0.7;
}
