/* Language rail + fast switch transitions — loaded globally */

@view-transition {
	navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
	animation-duration: 0.16s;
	animation-timing-function: ease-out;
}

html.er-lang-switching {
	cursor: progress;
}

/* Steagurile nu acoperă chatul deschis */
body.er-chat-open .er-lang-rail {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease, visibility 0.15s ease;
}

.er-lang-rail {
	position: fixed;
	top: 50%;
	right: max(0.65rem, calc(var(--er-container-gutter, 1.25rem) - 0.35rem));
	z-index: 480;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
	transform: translateY(-50%);
	pointer-events: none;
}

.er-lang {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
	padding: 0;
	background: none;
	border: 0;
	pointer-events: auto;
}

.er-lang__link {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 0;
	text-decoration: none;
	opacity: 0.85;
	transition: opacity 0.12s ease, transform 0.12s ease;
}

.er-lang__link:hover,
.er-lang__link:focus-visible {
	opacity: 1;
	transform: scale(1.06);
	outline: none;
}

.er-lang__link--active {
	opacity: 1;
}

.er-lang__link--active .er-lang__flag {
	box-shadow:
		0 0 0 2px rgba(255, 255, 255, 0.9),
		0 3px 12px rgba(0, 0, 0, 0.35);
}

.er-lang__flag {
	flex-shrink: 0;
	width: 2.75rem;
	aspect-ratio: 3 / 2;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.er-lang__flag--img {
	display: block;
	width: 2.75rem;
	height: auto;
	object-fit: cover;
}

.er-lang-rail__menu {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.42rem;
	width: 2.75rem;
	aspect-ratio: 3 / 2;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
	transition: transform 0.12s ease, opacity 0.12s;
}

.er-lang-rail__menu:hover,
.er-lang-rail__menu:focus-visible {
	transform: scale(1.06);
	outline: none;
}

.er-lang-rail__menu span {
	display: block;
	width: 1.55rem;
	height: 2px;
	background: #fff;
	border-radius: 1px;
}

@media (max-width: 40rem) {
	.er-lang-rail {
		top: max(0.65rem, env(safe-area-inset-top, 0px));
		left: 50%;
		right: auto;
		bottom: auto;
		transform: translateX(-50%);
		flex-direction: row;
		gap: 1.1rem;
		padding: 0.45rem 0.75rem;
		border-radius: 8px;
		background: rgba(15, 17, 16, 0.48);
		border: 1px solid rgba(245, 241, 234, 0.16);
		backdrop-filter: blur(14px) saturate(1.1);
		-webkit-backdrop-filter: blur(14px) saturate(1.1);
		box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
	}

	.er-lang {
		flex-direction: row;
		gap: 1.1rem;
	}

	.er-lang__flag,
	.er-lang__flag--img,
	.er-lang-rail__menu {
		width: 2.25rem;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	}

	.er-lang-rail__menu span {
		width: 1.25rem;
	}
}
