/*
 * Language switcher (navbar, mobile menu, footer), loaded by
 * inc/polylang-content.php only when a second language is public.
 * Plain file outside the Vite build.
 */

.magnet-lang-switch__link {
	text-decoration: none;
	color: inherit;
}

/* Navbar: small utility next to the logo, from 768px (phones use the menu block). */
.magnet-lang-switch--desktop {
	display: none;
	align-items: center;
	margin-left: 1rem;
	padding-left: 0.5rem;
	border-left: 1px solid #d4d4d8;
	font-family: "Inter", sans-serif;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

@media (min-width: 768px) {
	.magnet-lang-switch--desktop {
		display: flex;
	}
}

html.dark .magnet-lang-switch--desktop {
	border-left-color: #3f3f46;
}

.magnet-lang-switch--desktop .magnet-lang-switch__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	min-height: 2.75rem;
	color: #71717a;
	transition: color 0.2s ease;
}

html.dark .magnet-lang-switch--desktop .magnet-lang-switch__link {
	color: #a1a1aa;
}

.magnet-lang-switch--desktop .magnet-lang-switch__link:hover,
.magnet-lang-switch--desktop .magnet-lang-switch__link:focus-visible {
	color: var(--magnet-red-text, #e30613);
}

.magnet-lang-switch--desktop .magnet-lang-switch__link.is-current {
	color: #09090b;
	text-decoration: underline;
	text-decoration-color: #e30613;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.4em;
}

html.dark .magnet-lang-switch--desktop .magnet-lang-switch__link.is-current {
	color: #fff;
}

/* Tablets (768-1023px): the navbar row is tight. */
@media (max-width: 1023px) {
	magnet-navbar nav .space-x-10 > :not([hidden]) ~ :not([hidden]) {
		margin-left: 1.75rem;
	}

	.magnet-lang-switch--desktop {
		margin-left: 0.5rem;
		padding-left: 0.25rem;
	}
}

/* Mobile menu: block at the bottom, two large buttons. */
.magnet-lang-switch--menu {
	width: 100%;
	max-width: 28rem;
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 2px solid #d4d4d8;
}

html.dark .magnet-lang-switch--menu {
	border-top-color: #3f3f46;
}

.magnet-lang-switch__title {
	margin: 0 0 0.75rem;
	font-family: "Inter", sans-serif;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.15em;
	color: #71717a;
}

html.dark .magnet-lang-switch__title {
	color: #a1a1aa;
}

.magnet-lang-switch__options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	border: 2px solid currentColor;
}

.magnet-lang-switch--menu .magnet-lang-switch__link {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 3.25rem;
	font-size: 1rem;
	letter-spacing: 0.02em;
}

.magnet-lang-switch--menu .magnet-lang-switch__link + .magnet-lang-switch__link {
	border-left: 2px solid currentColor;
}

.magnet-lang-switch--menu .magnet-lang-switch__link.is-current {
	background: #09090b;
	color: #fff;
}

html.dark .magnet-lang-switch--menu .magnet-lang-switch__link.is-current {
	background: #fff;
	color: #09090b;
}

/* Footer: same IT / EN pair, in the bottom bar. */
.magnet-lang-switch--footer {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.magnet-lang-switch--footer .magnet-lang-switch__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
	transition: color 0.2s ease;
}

.magnet-lang-switch--footer .magnet-lang-switch__link:hover,
.magnet-lang-switch--footer .magnet-lang-switch__link:focus-visible {
	color: var(--magnet-red-text, #e30613);
}

.magnet-lang-switch--footer .magnet-lang-switch__link.is-current {
	color: #09090b;
	text-decoration: underline;
	text-decoration-color: #e30613;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.45em;
}

html.dark .magnet-lang-switch--footer .magnet-lang-switch__link.is-current {
	color: #fff;
}
