/* NGO custom language switcher (Google Translate backend) */

/* Safer fonts when GT is on: theme "Stack Sans" lacks full Latin/Devanagari/Tamil for replaced text */
html.translated-ltr,
html.translated-rtl,
html.ngo-gt-active {
	--default-font: "Noto Sans", "Noto Sans Devanagari", "Noto Sans Tamil", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html.translated-ltr body,
html.translated-rtl body,
html.ngo-gt-active body {
	font-family: var(--default-font) !important;
}

/* Right cluster: language dropdown + Donate (desktop); language only visible strip on mobile */
.ngo-header-actions {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	gap: 12px;
}

.ngo-header-toolbar {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.ngo-lang-switcher {
	position: relative;
	font-family: var(--default-font, "Stack Sans Headline", sans-serif);
}

.ngo-lang-switcher__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px 0 12px;
	border: 1px solid rgba(3, 53, 44, 0.18);
	border-radius: 8px;
	background: var(--white-color, #fff);
	color: var(--primary-color, #03352c);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ngo-lang-switcher__btn:hover,
.ngo-lang-switcher.open .ngo-lang-switcher__btn {
	border-color: var(--accent-color, #fad459);
	box-shadow: 0 2px 12px rgba(3, 53, 44, 0.08);
}

.ngo-lang-switcher__btn:focus {
	outline: 2px solid var(--accent-color, #fad459);
	outline-offset: 2px;
}

.ngo-lang-switcher__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	background: rgba(3, 53, 44, 0.06);
	color: var(--primary-color, #03352c);
	font-size: 14px;
	line-height: 1;
}

.ngo-lang-switcher__icon i {
	line-height: 1;
}

.ngo-lang-switcher__label {
	max-width: 120px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ngo-lang-switcher__chev {
	margin-left: 2px;
	font-size: 10px;
	opacity: 0.65;
	transition: transform 0.2s ease;
}

.ngo-lang-switcher.open .ngo-lang-switcher__chev {
	transform: rotate(180deg);
}

.ngo-lang-switcher__menu {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	min-width: 200px;
	padding: 6px;
	margin: 0;
	list-style: none;
	background: var(--white-color, #fff);
	border: 1px solid rgba(3, 53, 44, 0.12);
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(3, 53, 44, 0.14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	z-index: 9999;
}

.ngo-lang-switcher.open .ngo-lang-switcher__menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.ngo-lang-switcher__menu button {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 10px 12px;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: var(--primary-color, #03352c);
	font-size: 14px;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ngo-lang-switcher__menu button:hover {
	background: rgba(250, 212, 89, 0.25);
}

.ngo-lang-switcher__menu button.is-active {
	background: rgba(3, 53, 44, 0.08);
	font-weight: 600;
}

.ngo-lang-switcher__native {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: var(--primary-color, #03352c);
}

.ngo-lang-switcher__hint {
	display: block;
	font-size: 11px;
	font-weight: 400;
	color: var(--text-color, #6a6765);
	margin-top: 2px;
}

/* Hide Google Translate UI chrome; we drive translation via cookies + hidden widget */
#google_translate_element {
	position: absolute !important;
	width: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
	clip: rect(0, 0, 0, 0) !important;
}

.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
.goog-te-balloon-frame,
iframe.goog-te-banner-frame {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.skiptranslate,
body > .skiptranslate,
body > .goog-te-banner-frame,
body > iframe.skiptranslate,
body > iframe.goog-te-banner-frame {
	display: none !important;
	height: 0 !important;
	min-height: 0 !important;
	max-height: 0 !important;
	overflow: hidden !important;
	visibility: hidden !important;
}

/* Only reset GT layout on public pages with our switcher or active GT — avoids breaking fixed admin layout if this file is ever loaded there */
html.translated-ltr,
html.translated-rtl,
html.ngo-gt-active,
html:has(#ngo-lang-switcher) {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

html.translated-ltr body,
html.translated-rtl body,
html.ngo-gt-active body,
body:has(#ngo-lang-switcher) {
	top: 0 !important;
	position: static !important;
	margin-top: 0 !important;
	padding-top: 0 !important;
}

@media (max-width: 991px) {
	/* Push language + (hidden donate slot) next to hamburger */
	.ngo-header-actions {
		margin-left: auto;
	}

	.ngo-lang-switcher__menu {
		right: 0;
		min-width: 220px;
	}
}
