/**
 * Language switcher —
 * Desktop: header chips.
 * Mobile: floating control + bottom drawer (+ footer links).
 */

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Desktop header chips */
.uw-lang--header .uw-lang {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.uw-lang--header .uw-lang__item a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 0.85rem;
	border-radius: 10px;
	text-decoration: none;
	font-family: var(--wp--preset--font-family--playfair-display, "Playfair Display", Georgia, serif);
	font-style: normal;
	font-weight: 400;
	font-size: 22px;
	line-height: 18px;
	color: var(--wp--preset--color--black, #000000);
}

.uw-lang--header .uw-lang__item a[aria-current="true"],
.uw-lang--header .uw-lang__item.is-active a {
	background: var(--uw-accent, #7bc47c);
	border-radius: 10px;
	color: var(--wp--preset--color--white, #ffffff);
}

@media (min-width: 1024px) and (max-width: 1199px) {
	.uw-lang--header .uw-lang {
		flex-wrap: nowrap;
		gap: 0.2rem;
	}

	.uw-lang--header .uw-lang__item a {
		padding: 0.4rem 0.55rem;
		font-size: 16px;
		line-height: 1;
		white-space: nowrap;
	}
}

/* Floating control — mobile only */
.uw-lang-switcher {
	display: none;
}

@media (max-width: 1023px) {
	.uw-lang-switcher {
		display: block;
		position: fixed;
		left: max(16px, env(safe-area-inset-left, 0px));
		bottom: max(16px, env(safe-area-inset-bottom, 0px));
		z-index: 100010;
	}

	.uw-lang-switcher__fab {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		margin: 0;
		padding: 10px 14px 10px 12px;
		border: 0;
		border-radius: 100px;
		background: var(--uw-accent, #7bc47c);
		color: #ffffff;
		box-shadow: 0 10px 28px rgba(42, 55, 56, 0.22);
		font-family: "Source Sans 3", var(--wp--preset--font-family--source-sans-3, sans-serif);
		cursor: pointer;
		appearance: none;
		-webkit-appearance: none;
		transition:
			transform 200ms ease,
			box-shadow 200ms ease,
			background-color 200ms ease;
	}

	.uw-lang-switcher__fab:hover,
	.uw-lang-switcher__fab:focus-visible {
		background: var(--uw-accent-strong, #5a9a5c);
		box-shadow: 0 14px 34px rgba(42, 55, 56, 0.28);
	}

	.uw-lang-switcher__fab:focus-visible {
		outline: 2px solid #2a3738;
		outline-offset: 3px;
	}

	.uw-lang-switcher__fab-globe {
		display: inline-flex;
		flex: 0 0 auto;
	}

	.uw-lang-switcher__fab-label {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 1px;
		min-width: 0;
	}

	.uw-lang-switcher__fab-kicker {
		font-size: 11px;
		line-height: 1.2;
		letter-spacing: 0.02em;
		opacity: 0.85;
	}

	.uw-lang-switcher__fab-current {
		font-family: "Fraunces", var(--wp--preset--font-family--fraunces, Georgia, serif);
		font-size: 16px;
		line-height: 1.15;
		font-weight: 400;
	}

	.uw-lang-drawer {
		position: fixed;
		inset: 0;
		z-index: 100011;
		pointer-events: none;
	}

	.uw-lang-drawer[hidden] {
		display: none !important;
	}

	.uw-lang-drawer.is-open {
		pointer-events: auto;
	}

	.uw-lang-drawer__backdrop {
		position: absolute;
		inset: 0;
		background: rgba(42, 55, 56, 0.55);
		opacity: 0;
		transition: opacity 240ms ease;
	}

	.uw-lang-drawer.is-open .uw-lang-drawer__backdrop {
		opacity: 1;
	}

	.uw-lang-drawer__sheet {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1;
		max-height: min(78vh, 560px);
		padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
		background: #ffffff;
		border-radius: 20px 20px 0 0;
		box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.18);
		transform: translateY(110%);
		transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
		outline: none;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
	}

	.uw-lang-drawer.is-open .uw-lang-drawer__sheet {
		transform: translateY(0);
	}

	.uw-lang-drawer__handle {
		width: 44px;
		height: 4px;
		margin: 0 auto 14px;
		border-radius: 100px;
		background: #bdcaca;
	}

	.uw-lang-drawer__header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		margin-bottom: 18px;
	}

	.uw-lang-drawer__title {
		margin: 0;
		font-family: "Fraunces", var(--wp--preset--font-family--fraunces, Georgia, serif);
		font-weight: 400;
		font-size: 28px;
		line-height: 1.15;
		color: #2a3738;
	}

	.uw-lang-drawer__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 999px;
		background: #f6f5f2;
		color: #2a3738;
		cursor: pointer;
	}

	.uw-lang--drawer .uw-lang {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.uw-lang--drawer .uw-lang__item a {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		width: 100%;
		padding: 14px 16px;
		border-radius: 12px;
		background: #f6f5f2;
		color: #2a3738;
		text-decoration: none;
		box-sizing: border-box;
	}

	.uw-lang--drawer .uw-lang__item.is-active a,
	.uw-lang--drawer .uw-lang__item a[aria-current="true"] {
		background: var(--uw-accent, #7bc47c);
		color: #ffffff;
	}

	.uw-lang--drawer .uw-lang__name {
		font-family: "Fraunces", var(--wp--preset--font-family--fraunces, Georgia, serif);
		font-size: 20px;
		line-height: 1.2;
	}

	.uw-lang--drawer .uw-lang__code {
		font-family: "Source Sans 3", var(--wp--preset--font-family--source-sans-3, sans-serif);
		font-size: 14px;
		line-height: 1.2;
		opacity: 0.85;
	}

	html.uw-lang-drawer-open,
	body.uw-lang-drawer-open {
		overflow: hidden;
	}

	body.uw-nav-open .uw-lang-switcher {
		opacity: 0;
		pointer-events: none;
	}
}

/* Desktop: no floating language control */
@media (min-width: 1024px) {
	.uw-lang-switcher {
		display: none !important;
	}
}
