/* ── Globe toggle button ─────────────────────────────────────────────── */
.gt-lang-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	background: none;
	border: none;
	cursor: pointer;
	color: #4b5563;
	border-radius: 4px;
	line-height: 1;
	transition: color .15s ease;
}
.gt-lang-toggle:hover,
.gt-lang-toggle:focus-visible {
	color: var(--color-primary, #18407A);
	outline: none;
}
.gt-lang-globe { display: block; width: 24px; height: 24px; }

/* ── Backdrop overlay ────────────────────────────────────────────────── */
.gt-lang-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, .48);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	/* Hidden state */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .2s ease, visibility .2s ease;
}
.gt-lang-overlay.gt-lang-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Prevent body scroll when modal is open */
body.gt-lang-no-scroll { overflow: hidden; }

/* ── Modal panel ─────────────────────────────────────────────────────── */
.gt-lang-panel {
	background: #fff;
	border-radius: 12px;
	padding: 24px;
	width: 100%;
	max-width: 560px;
	max-height: 80vh;
	overflow-y: auto;
	box-shadow: 0 24px 64px rgba(0, 0, 0, .22);
	/* Slide-up entrance */
	transform: translateY(12px);
	transition: transform .2s ease;
}
.gt-lang-overlay.gt-lang-open .gt-lang-panel {
	transform: translateY(0);
}

/* Panel header row */
.gt-lang-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}
.gt-lang-panel-title {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	color: #111827;
}
.gt-lang-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	color: #6b7280;
	padding: 6px;
	border-radius: 6px;
	line-height: 1;
	transition: color .15s, background .15s;
}
.gt-lang-close:hover { color: #111827; background: #f3f4f6; }
.gt-lang-close:focus-visible {
	outline: 2px solid var(--color-primary, #18407A);
	outline-offset: 2px;
}

/* ── Language grid ───────────────────────────────────────────────────── */
.gt-lang-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 6px;
}

/* Individual language link */
.gt-lang-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 8px;
	text-decoration: none !important;
	color: #374151;
	font-size: 14px;
	font-weight: 500;
	border: 1.5px solid transparent;
	transition: background .12s, color .12s, border-color .12s;
}
.gt-lang-item:hover {
	background: #f9fafb;
	color: #111827;
	border-color: #e5e7eb;
	text-decoration: none !important;
}
.gt-lang-item.gt-lang-active {
	background: rgba(24, 64, 122, .07);
	border-color: var(--color-primary, #18407A);
	color: var(--color-primary, #18407A);
	font-weight: 600;
}
.gt-lang-item:focus-visible {
	outline: 2px solid var(--color-primary, #18407A);
	outline-offset: 2px;
}

/* Label: English name + native name */
.gt-lang-name {
	flex: 1;
	min-width: 0;
	line-height: 1.3;
}

/* Native script part — separator dash + native name in slightly muted colour */
.gt-lang-native::before { content: ' \2013\00a0'; } /* " – " en-dash */
.gt-lang-native { opacity: .72; }

/* Checkmark for the active language */
.gt-lang-check {
	display: inline-flex;
	flex-shrink: 0;
	margin-left: auto;
	color: var(--color-primary, #18407A);
}

/* ── Mobile: bottom sheet ────────────────────────────────────────────── */
@media (max-width: 640px) {
	.gt-lang-overlay {
		align-items: flex-end;
		padding: 0;
	}
	.gt-lang-panel {
		border-radius: 16px 16px 0 0;
		max-height: 72vh;
		padding: 20px 16px 32px;
		/* Slide up from bottom on mobile */
		transform: translateY(100%);
	}
	.gt-lang-overlay.gt-lang-open .gt-lang-panel {
		transform: translateY(0);
	}
	.gt-lang-grid {
		grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
		gap: 5px;
	}
}
