/*
 * Weltkugel-Menü.
 *
 * Bewusst zurückhaltend und ohne Farbwerte des Themes: Avada bringt eigene
 * Typografie und Farben mit, hier wird nur Struktur gesetzt. Alles unter .wlr
 * gekapselt, damit nichts ins Theme ausblutet.
 */

.wlr {
	display: inline-block;
}

/*
 * Freischwebende Variante: nur aktiv, solange der Auslöser nicht im
 * Avada-Header platziert ist (Filter `wlr_auto_inject`).
 */
.wlr--floating {
	position: fixed;
	top: .75rem;
	right: .75rem;
	z-index: 99990;
}

.wlr--floating .wlr__trigger {
	background: rgba(255, 255, 255, .92);
	color: #2b2b2b;
	border-radius: 2rem;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
	padding: .45em .85em;
}

@media (prefers-color-scheme: dark) {
	.wlr--floating .wlr__trigger {
		background: rgba(28, 28, 28, .92);
		color: #ededed;
	}
}

/* --- Auslöser ---------------------------------------------------------- */

.wlr__trigger {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	padding: .4em .6em;
	background: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	color: inherit;
	line-height: 1.2;
}

.wlr__trigger:hover .wlr__globe,
.wlr__trigger:focus-visible .wlr__globe {
	opacity: 1;
}

.wlr__globe {
	width: 1.35em;
	height: 1.35em;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	opacity: .75;
	transition: opacity .15s ease;
}

/* Auf schmalen Viewports nur das Symbol zeigen. */
@media (max-width: 782px) {
	.wlr__trigger-text {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
}

/* --- Overlay ----------------------------------------------------------- */

.wlr__overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: rgba(0, 0, 0, .35);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.wlr__overlay[hidden] {
	display: none;
}

.wlr__panel {
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 2.5rem clamp(1rem, 4vw, 3rem) 3rem;
	background: #fff;
	color: #2b2b2b;
	min-height: 100%;
	box-sizing: border-box;
}

.wlr__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 2rem;
}

.wlr__heading {
	margin: 0;
	font-size: clamp(1.15rem, 2.4vw, 1.6rem);
	font-weight: 700;
	line-height: 1.25;
}

.wlr__close {
	flex: 0 0 auto;
	width: 2.25rem;
	height: 2.25rem;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.9rem;
	line-height: 1;
	background: none;
	border: 0;
	cursor: pointer;
	color: inherit;
	opacity: .6;
}

.wlr__close:hover,
.wlr__close:focus-visible {
	opacity: 1;
}

/* --- Länderraster ------------------------------------------------------ */

.wlr__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 1.9rem 2rem;
}

.wlr__item {
	margin: 0;
	min-width: 0;
}

.wlr__country {
	display: block;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.3;
	margin-bottom: .35rem;
	overflow-wrap: break-word;
}

.wlr__langs {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
}

/* Trennstrich zwischen den Sprachen — wie in der Vorlage. */
.wlr__lang + .wlr__lang::before {
	content: "|";
	opacity: .35;
	margin: 0 .5em;
	font-weight: 400;
}

.wlr__lang {
	font-size: .95rem;
	color: inherit;
	opacity: .75;
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.wlr__lang:hover,
.wlr__lang:focus-visible {
	opacity: 1;
	border-bottom-color: currentColor;
}

.wlr__lang.is-current {
	opacity: 1;
	font-weight: 700;
	border-bottom-color: currentColor;
}

.wlr__item.is-current .wlr__country::after {
	content: "";
	display: inline-block;
	width: .45em;
	height: .45em;
	margin-left: .45em;
	border-radius: 50%;
	background: currentColor;
	vertical-align: middle;
	opacity: .55;
}

/* --- Rest of the world ------------------------------------------------- */

.wlr__neutral {
	margin-top: 2.5rem;
	padding-top: 1.6rem;
	border-top: 1px solid rgba(0, 0, 0, .15);
	max-width: 210px;
}

/* --- Dunkles Schema ---------------------------------------------------- */

@media (prefers-color-scheme: dark) {
	.wlr__panel {
		background: #1c1c1c;
		color: #ededed;
	}

	.wlr__neutral {
		border-top-color: rgba(255, 255, 255, .18);
	}
}

/* Bewegungsarme Darstellung respektieren. */
@media (prefers-reduced-motion: reduce) {
	.wlr__globe {
		transition: none;
	}
}
