/* ==========================================================
   EX Site Translator — front end
   ========================================================== */

/* ---- Hide Google Translate chrome (top bar, tooltips, highlights) ---- */
.goog-te-banner-frame,
iframe.skiptranslate,
.skiptranslate > iframe,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-l4eHX-hSRGPd,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-te-spinner-pos {
	display: none !important;
	visibility: hidden !important;
}
html,
body {
	top: 0 !important;
}
body.translated-ltr,
body.translated-rtl {
	margin-top: 0 !important;
}
.goog-text-highlight,
.VIpgJd-yAWNEb-VIpgJd-fmcmS-sn54Q {
	background: none !important;
	box-shadow: none !important;
}
html.translated-ltr font,
html.translated-rtl font {
	background: transparent !important;
	box-shadow: none !important;
}
.exst-google-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
}

/* ---- Widget ---- */
.exst-widget {
	--exst-radius: 999px;
	--exst-h: 42px;
	--exst-font: 14px;
	position: relative;
	display: inline-block;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
	line-height: 1.3;
	text-align: left;
	direction: ltr;
}
.exst-widget *,
.exst-widget *::before,
.exst-widget *::after {
	box-sizing: border-box;
}
.exst-size-small  { --exst-h: 36px; --exst-font: 13px; }
.exst-size-large  { --exst-h: 50px; --exst-font: 15px; }

.exst-widget .exst-toggle {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: var(--exst-h);
	padding: 0 14px 0 12px;
	border-radius: var(--exst-radius);
	background: var(--exst-bg, #1e3a8a);
	color: var(--exst-fg, #fff);
	font-size: var(--exst-font);
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 18px -6px rgba(15, 23, 42, .45), 0 1px 2px rgba(15, 23, 42, .2);
	transition: transform .15s ease, box-shadow .15s ease;
	white-space: nowrap;
	-webkit-tap-highlight-color: transparent;
}
.exst-widget .exst-toggle:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px -8px rgba(15, 23, 42, .5), 0 1px 2px rgba(15, 23, 42, .2);
}
.exst-widget .exst-toggle:focus-visible {
	outline: 3px solid var(--exst-bg, #1e3a8a);
	outline-offset: 3px;
}
.exst-widget .exst-globe { flex: 0 0 auto; }
.exst-widget .exst-caret { flex: 0 0 auto; opacity: .8; transition: transform .2s ease; }
.exst-widget.is-open .exst-caret { transform: rotate(180deg); }
.exst-widget .exst-current { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

/* icon only → round button */
.exst-style-icon .exst-toggle {
	width: var(--exst-h);
	padding: 0;
	justify-content: center;
}
.exst-style-icon .exst-current,
.exst-style-icon .exst-caret {
	display: none;
}
.exst-style-code .exst-current {
	letter-spacing: .03em;
}

/* ---- Floating positions ---- */
.exst-floating {
	position: fixed;
	z-index: var(--exst-z, 99999);
}
.exst-pos-bottom-right { right: var(--exst-x); bottom: calc(var(--exst-y) + env(safe-area-inset-bottom, 0px)); }
.exst-pos-bottom-left  { left: var(--exst-x);  bottom: calc(var(--exst-y) + env(safe-area-inset-bottom, 0px)); }
.exst-pos-top-right    { right: var(--exst-x); top: var(--exst-y); }
.exst-pos-top-left     { left: var(--exst-x);  top: var(--exst-y); }
.exst-pos-middle-right { right: 0; top: 50%; transform: translateY(-50%); }
.exst-pos-middle-left  { left: 0;  top: 50%; transform: translateY(-50%); }

/* edge tabs for middle positions */
.exst-pos-middle-right .exst-toggle { border-radius: 12px 0 0 12px; }
.exst-pos-middle-left  .exst-toggle { border-radius: 0 12px 12px 0; }

body.admin-bar .exst-pos-top-right,
body.admin-bar .exst-pos-top-left { top: calc(var(--exst-y) + 32px); }

/* ---- Panel ---- */
.exst-panel {
	position: absolute;
	width: 260px;
	max-width: calc(100vw - 24px);
	background: #fff;
	color: #1f2937;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	box-shadow: 0 24px 48px -16px rgba(15, 23, 42, .35);
	padding: 8px;
	z-index: 2;
	transform-origin: var(--exst-origin, bottom right);
	animation: exst-in .16s ease-out;
}
.exst-panel[hidden] { display: none; }

@keyframes exst-in {
	from { opacity: 0; transform: scale(.96) translateY(4px); }
	to   { opacity: 1; transform: none; }
}

.exst-pos-bottom-right .exst-panel { bottom: calc(100% + 10px); right: 0; --exst-origin: bottom right; }
.exst-pos-bottom-left  .exst-panel { bottom: calc(100% + 10px); left: 0;  --exst-origin: bottom left; }
.exst-pos-top-right    .exst-panel { top: calc(100% + 10px);    right: 0; --exst-origin: top right; }
.exst-pos-top-left     .exst-panel { top: calc(100% + 10px);    left: 0;  --exst-origin: top left; }
.exst-pos-middle-right .exst-panel { right: calc(100% + 10px); top: 50%; margin-top: -170px; --exst-origin: right center; }
.exst-pos-middle-left  .exst-panel { left: calc(100% + 10px);  top: 50%; margin-top: -170px; --exst-origin: left center; }
.exst-inline .exst-panel           { top: calc(100% + 8px); left: 0; --exst-origin: top left; }
.exst-inline.exst-flip .exst-panel { left: auto; right: 0; }

.exst-panel-head {
	padding: 6px 8px 8px;
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
}
.exst-widget .exst-search {
	display: block;
	width: 100%;
	height: 36px;
	margin: 0 0 6px;
	padding: 0 10px;
	border: 1px solid #d1d5db;
	border-radius: 9px;
	background: #f9fafb;
	color: #111827;
	font: inherit;
	font-size: 14px;
	box-shadow: none;
}
.exst-widget .exst-search:focus {
	outline: none;
	border-color: var(--exst-bg, #1e3a8a);
	background: #fff;
}
.exst-widget .exst-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 300px;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.exst-widget .exst-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}
.exst-widget .exst-lang {
	all: unset;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 7px 8px;
	border-radius: 9px;
	cursor: pointer;
	font-size: 14px;
	color: #1f2937;
}
.exst-widget .exst-lang:hover,
.exst-widget .exst-lang:focus-visible {
	background: #f3f4f6;
}
.exst-widget .exst-lang:focus-visible {
	outline: 2px solid var(--exst-bg, #1e3a8a);
	outline-offset: -2px;
}
.exst-widget .exst-lang.is-active {
	background: color-mix(in srgb, var(--exst-bg, #1e3a8a) 10%, #fff);
}
.exst-widget .exst-badge {
	flex: 0 0 34px;
	height: 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	background: #eef2f7;
	color: #374151;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
}
.exst-widget .exst-lang.is-active .exst-badge {
	background: var(--exst-bg, #1e3a8a);
	color: var(--exst-fg, #fff);
}
.exst-widget .exst-names {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}
.exst-widget .exst-native { font-weight: 600; }
.exst-widget .exst-en { font-size: 12px; color: #6b7280; }
.exst-widget .exst-orig {
	font-size: 11px;
	color: #6b7280;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	padding: 1px 7px;
}
.exst-widget .exst-empty {
	margin: 8px;
	font-size: 13px;
	color: #6b7280;
}

/* ---- Mobile ---- */
@media (max-width: 767px) {
	.exst-hide-mobile { display: none !important; }
	.exst-floating .exst-panel { width: 240px; }
	.exst-pos-middle-right .exst-panel,
	.exst-pos-middle-left .exst-panel { margin-top: -150px; }
}

@media (prefers-reduced-motion: reduce) {
	.exst-panel { animation: none; }
	.exst-widget .exst-toggle,
	.exst-widget .exst-caret { transition: none; }
}
