/* HMP Translate: the language picker, the language by the copyright line, and the message at the bottom. */

.hmp-tr {
	--hmp-tr-ink: var(--wp--preset--color--ink, #1d1b2c);
	--hmp-tr-muted: var(--wp--preset--color--muted, #5d5a70);
	--hmp-tr-line: var(--wp--preset--color--line, #e2e0eb);
	--hmp-tr-mist: var(--wp--preset--color--mist, #f3f2f7);
	--hmp-tr-accent: var(--wp--preset--color--magenta, #b03a8c);
	position: relative;
	display: inline-flex;
	vertical-align: middle;
	line-height: 1.2;
}
.hmp-tr-block { display: flex; align-items: center; flex-shrink: 0; }

/* The button: a globe and the language's own name. */
.hmp-tr__button {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 6px 12px 6px 10px;
	border: 1px solid rgba(29, 27, 44, .14);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	font-weight: 550;
	letter-spacing: -.005em;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.hmp-tr__button:hover { background: rgba(29, 27, 44, .05); border-color: rgba(29, 27, 44, .22); }
.hmp-tr__button:focus-visible { outline: 2px solid var(--hmp-tr-accent); outline-offset: 2px; }
.hmp-tr__globe { width: 17px; height: 17px; flex-shrink: 0; }
.hmp-tr__chevron { width: 10px; height: 10px; flex-shrink: 0; opacity: .55; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.hmp-tr.is-open .hmp-tr__chevron { transform: rotate(180deg); }
.hmp-tr__sr {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}
/* While a page is being translated the globe turns. */
.hmp-tr-busy .hmp-tr__globe { animation: hmp-tr-spin 1.6s linear infinite; }
@keyframes hmp-tr-spin { to { transform: rotate(360deg); } }

/* The list of languages: a frosted card, like the menu's drop-downs. */
.hmp-tr__panel {
	position: absolute;
	z-index: 1000;
	top: calc(100% + 10px);
	right: 0;
	width: 280px;
	max-width: calc(100vw - 24px);
	max-height: min(70vh, 520px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 6px;
	border: 1px solid var(--hmp-tr-line);
	border-radius: 18px;
	background: rgba(255, 255, 255, .94);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
	box-shadow: 0 18px 50px rgba(12, 10, 32, .16);
	color: var(--hmp-tr-ink);
	font-size: 15px;
	text-align: left;
	transform-origin: top right;
	animation: hmp-tr-pop .2s cubic-bezier(.2, .8, .2, 1);
}
.hmp-tr__panel[hidden] { display: none; }
@keyframes hmp-tr-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.hmp-tr__menu { list-style: none; margin: 0; padding: 0; }
.hmp-tr__option {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 9px 12px;
	border-radius: 11px;
	cursor: pointer;
	outline: none;
}
.hmp-tr__option:hover, .hmp-tr__option:focus { background: var(--hmp-tr-mist); }
.hmp-tr__option:focus-visible { box-shadow: inset 0 0 0 2px var(--hmp-tr-accent); }
.hmp-tr__native { flex: 1; font-weight: 550; letter-spacing: -.005em; }
.hmp-tr__english { color: var(--hmp-tr-muted); font-size: 13px; }
.hmp-tr__check { width: 14px; height: 14px; flex-shrink: 0; color: var(--hmp-tr-accent); visibility: hidden; }
.hmp-tr__option[aria-selected="true"] .hmp-tr__check { visibility: visible; }
.hmp-tr__option[aria-selected="true"] .hmp-tr__native { color: var(--hmp-tr-accent); }
.hmp-tr__credit {
	display: block;
	margin: 4px 6px 2px;
	padding: 9px 6px 5px;
	border-top: 1px solid var(--hmp-tr-line);
	color: var(--hmp-tr-muted) !important;
	font-size: 12px;
	text-align: center;
	text-decoration: none !important;
}
.hmp-tr__credit:hover { color: var(--hmp-tr-ink) !important; }

/* By the copyright line: plain text in the footer's own colour, the list opening upwards. */
.hmp-tr-foot { display: inline; }
.hmp-tr-foot__lang, .hmp-tr-foot__credit { display: inline-flex; align-items: center; white-space: nowrap; vertical-align: middle; }
.hmp-tr-foot__sep { margin: 0 .55em; opacity: .6; }
.hmp-tr-foot__credit[hidden] { display: none; }
.hmp-tr-foot__credit a { color: inherit; }
.hmp-tr--footer .hmp-tr__button {
	gap: 5px;
	padding: 2px 6px;
	margin: -2px -6px;
	border: 0;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
}
.hmp-tr--footer .hmp-tr__button:hover { background: rgba(255, 255, 255, .1); }
.hmp-tr--footer .hmp-tr__globe { width: 1.1em; height: 1.1em; }
.hmp-tr--footer .hmp-tr__chevron { transform: rotate(180deg); }
.hmp-tr--footer.is-open .hmp-tr__chevron { transform: none; }
.hmp-tr--footer .hmp-tr__panel {
	background: #fff;
	top: auto;
	bottom: calc(100% + 10px);
	right: auto;
	left: -6px;
	transform-origin: bottom left;
	font-size: 15px;
	line-height: 1.2;
}

/* When the menu bar is full (see "Fitting the menu bar" in translate.js), one step at a time. */
.hmp-tr-measuring > *, .hmp-tr-measuring > * > * { flex-shrink: 0 !important; }
.hmp-tr-fit-globe .hmp-tr--menu .hmp-tr__name {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.hmp-tr-fit-globe .hmp-tr--menu .hmp-tr__chevron { display: none; }
.hmp-tr-fit-globe .hmp-tr--menu .hmp-tr__button { padding: 8px; }
.hmp-tr-fit-tight .wp-block-navigation.wp-block-navigation,
.hmp-tr-fit-tight .wp-block-navigation .wp-block-navigation__container { --wp--style--block-gap: 12px; gap: 12px !important; }
.hmp-tr-fit-tight .hmp-tr-block { margin-inline-start: -6px; }
.hmp-tr-fit-logo .wp-block-site-title { display: none !important; }
.hmp-tr-fit-button .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
.hmp-tr-fit-button .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
/* Beside the menu button, the globe comes first. */
.hmp-tr-fit-button .hmp-tr-block { order: -1; }
@media (max-width: 1023px) {
	.hmp-site-header .hmp-tr-block { order: -1; }
}

/* Phones: the list sits across the screen just under the menu bar. */
@media (max-width: 600px) {
	.hmp-tr--menu .hmp-tr__button { padding: 7px 9px; gap: 5px; }
	.hmp-tr--menu .hmp-tr__name { font-size: 13px; }
	.hmp-tr--menu .hmp-tr__chevron { display: none; }
	.hmp-tr--menu .hmp-tr__panel {
		position: fixed;
		top: calc(var(--hmp-top, 0px) + var(--hmp-header-h, 64px) + 8px);
		left: 12px;
		right: 12px;
		width: auto;
		max-width: none;
		max-height: calc(100vh - var(--hmp-top, 0px) - var(--hmp-header-h, 64px) - 24px);
	}
	.hmp-tr--footer .hmp-tr__panel { position: fixed; left: 12px; right: 12px; bottom: 12px; width: auto; max-height: 70vh; }
}

/* Translated words are often longer (Swedish, German, Welsh): in headings and buttons a long word
   breaks with a hyphen where the language allows, instead of anywhere. */
html.hmp-tr-on :is(h1, h2, h3, h4, h5, h6, .wp-block-button__link) {
	-webkit-hyphens: auto;
	hyphens: auto;
}

/* A short message at the bottom of the screen, when part of a page couldn't be translated. */
.hmp-tr-toast {
	position: fixed;
	z-index: 10000;
	left: 50%;
	bottom: 24px;
	max-width: calc(100vw - 32px);
	padding: 11px 18px;
	border-radius: 999px;
	background: rgba(29, 27, 44, .92);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
	color: #fff;
	font-size: 14px;
	line-height: 1.35;
	text-align: center;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 12px);
	transition: opacity .3s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.hmp-tr-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
	.hmp-tr__panel { animation: none; }
	.hmp-tr-busy .hmp-tr__globe { animation: none; }
	.hmp-tr__chevron, .hmp-tr-toast { transition: none; }
}
