/*
 * Multilanguage translation UI.
 *
 * The Google Website Translator widget is the engine but is kept out of sight;
 * `#lang-switcher` (built in js/translate.js) is the visible control: a
 * flag + language button in the header that opens a searchable, scrollable
 * language list.
 */

/* ---- Hide Google's own chrome ------------------------------------------- */

/* The injected "Translated into… / Show original" top banner (legacy and
   current widget), plus the little gadget icon. */
.goog-te-banner-frame.skiptranslate,
iframe.skiptranslate,
.goog-te-gadget-icon {
	display: none !important;
	visibility: hidden !important;
}

.skiptranslate iframe {
	display: none !important;
}

/* Keep the page flush to the top; Google tries to push <body> down. */
body {
	top: 0 !important;
	position: static !important;
}

/* The brief translating spinner pinned to the top-left corner. */
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.goog-te-spinner-pos {
	display: none !important;
}

/* The "rate this translation" hover tooltip and the translated-text
   highlight/box. */
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-tooltip:hover {
	display: none !important;
}

.goog-text-highlight {
	background: none !important;
	box-shadow: none !important;
}

/* The engine <select> stays in the DOM (we drive it programmatically) but is
   never shown; `display:none` still lets it receive the change event. */
#google_translate_element {
	display: none !important;
}

/* ---- Header placement -------------------------------------------------- */

.header-translate {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	margin-left: auto;
	padding-left: 14px;
}

#lang-switcher {
	position: relative;
	font-family: inherit;
}

/* ---- The button (flag + language + caret) ----------------------------- */

.lang-switcher__btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	max-width: 190px;
	padding: 5px 9px;
	font: inherit;
	font-size: 13px;
	line-height: 1;
	color: #3a79a0;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}

.lang-switcher__btn:hover {
	background: #fff;
	border-color: #7a99bb;
}

.lang-switcher__btn:focus-visible {
	outline: 2px solid #3a79a0;
	outline-offset: 1px;
}

.lang-switcher__flag {
	font-size: 15px;
	line-height: 1;
	flex: 0 0 auto;
}

.lang-switcher__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lang-switcher__caret {
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	margin: -3px 0 0 1px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
}

/* ---- The dropdown panel --------------------------------------------- */

.lang-switcher__panel {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 1200;
	width: 250px;
	background: #fff;
	border: 1px solid #cdd9e5;
	border-radius: 8px;
	box-shadow: 0 12px 34px rgba(0, 0, 0, .17);
	overflow: hidden;
}

.lang-switcher__panel[hidden] {
	display: none;
}

.lang-switcher__search {
	padding: 8px;
	background: #fff;
	border-bottom: 1px solid #eef2f6;
}

.lang-switcher__input {
	width: 100%;
	box-sizing: border-box;
	padding: 7px 10px;
	font: inherit;
	font-size: 13px;
	color: #1a1a1a;
	border: 1px solid #cdd9e5;
	border-radius: 6px;
}

.lang-switcher__input:focus {
	outline: none;
	border-color: #3a79a0;
	box-shadow: 0 0 0 2px rgba(58, 121, 160, .25);
}

.lang-switcher__list {
	margin: 0;
	padding: 4px;
	list-style: none;
	max-height: 300px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.lang-switcher__option {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 8px 10px;
	font-size: 13px;
	color: #1a1a1a;
	border-radius: 6px;
	cursor: pointer;
}

.lang-switcher__option:hover {
	background: #eef4f8;
}

.lang-switcher__option.is-active {
	background: #e0ece4;
	font-weight: 700;
	color: #2f6a4f;
}

.lang-switcher__empty {
	padding: 14px 10px;
	text-align: center;
	font-size: 13px;
	color: #8a8a8a;
}

/* Slim scrollbar for the list. */
.lang-switcher__list::-webkit-scrollbar {
	width: 8px;
}
.lang-switcher__list::-webkit-scrollbar-thumb {
	background: #cdd9e5;
	border-radius: 4px;
}

/* ---- Keep icon + label together when translated ---------------------- */

/* The long email address has no break points, so it spills past the viewport
   on narrow phones (and further once Google wraps it in <font> tags). Let it
   wrap at any width. */
p.contact a {
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* Google Translate rewraps every text run in <font> tags, which lets the
   inline contact links break between their icon and their (now longer)
   translated label, orphaning the icon onto its own line. Make each link an
   inline-flex unit so the icon always stays glued to its text. Below 781px
   theme.css already lays these links out as their own flex rows. */
@media (min-width: 782px) {
	p.contact {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 4px 10px;
	}

	/* inline-flex makes the icon and label flex siblings, so the icon can
	   never line-break away from its text; a long label just wraps inside. */
	p.contact a {
		display: inline-flex;
		align-items: center;
	}

	p.contact a svg {
		flex: 0 0 auto;
	}
}

/* ---- Small screens -------------------------------------------------- */

@media (max-width: 781px) {
	/* Below 781px WP collapses the nav to a single hamburger button, so the
	   header row can safely wrap and let the switcher fall onto its own line
	   (right-aligned) instead of overflowing on narrow phones. */
	.header-grid.container-core-columns-is-layout-f56f613f {
		flex-wrap: nowrap;
		row-gap: 8px;
	}

	.header-translate {
		width: 100%;
		justify-content: flex-end;
		margin-left: 0;
		padding-left: 0;
	}

	.lang-switcher__panel {
		width: min(84vw, 250px);
	}
}
