/* Bar after an automatic language switch (assets/language-notice.js). Restyle through the variables. */
.ctc-lang-notice {
	--ctc-notice-bg: #1d2327;
	--ctc-notice-fg: #ffffff;
	--ctc-notice-radius: 6px;
	--ctc-notice-font: inherit;

	position: fixed;
	left: calc(16px + env(safe-area-inset-left, 0px));
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: 99999;
	box-sizing: border-box;
	width: max-content;
	max-width: min(400px, calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
	overflow: hidden;
	border-radius: var(--ctc-notice-radius);
	background: var(--ctc-notice-bg);
	color: var(--ctc-notice-fg);
	font-family: var(--ctc-notice-font);
	font-size: 13px;
	line-height: 1.4;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
	opacity: 0;
	transform: translateY(16px) scale(.98);
	transform-origin: left bottom;
	/* Leaving: quicker, easing in. */
	transition: opacity .22s ease-in, transform .22s ease-in;
}

.ctc-lang-notice.is-visible {
	opacity: 1;
	transform: none;
	/* Arriving: a little slower, easing out without overshoot. */
	transition: opacity .32s cubic-bezier(.2, .8, .2, 1), transform .45s cubic-bezier(.2, .8, .2, 1);
}

.ctc-lang-notice__row {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 4px 6px 12px;
}

.ctc-lang-notice__text {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	color: inherit;
}

.ctc-lang-notice__link,
.ctc-lang-notice__link:hover,
.ctc-lang-notice__link:visited {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ctc-lang-notice__close {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.ctc-lang-notice__close:hover {
	background: rgba(127, 127, 127, .2);
}

.ctc-lang-notice a:focus-visible,
.ctc-lang-notice__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* The track takes the text colour at low strength, so it works on light and dark bars. */
.ctc-lang-notice__track {
	position: relative;
	height: 2px;
}

.ctc-lang-notice__track::before {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	opacity: .2;
}

.ctc-lang-notice__progress {
	position: relative;
	height: 2px;
	background: currentColor;
	transform-origin: left center;
}

@media (max-width: 600px) {
	.ctc-lang-notice {
		left: calc(12px + env(safe-area-inset-left, 0px));
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		max-width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.ctc-lang-notice,
	.ctc-lang-notice.is-visible {
		transition: opacity .2s linear;
		transform: none;
	}

	.ctc-lang-notice__track {
		display: none;
	}
}
