/* Language controls and native English pages share the established site layout. */
.sa-header > .sa-header__inner {
	box-sizing: border-box;
	width: 100%;
	max-width: 1280px;
	flex-wrap: nowrap;
	gap: clamp(0.65rem, 1.6vw, 1.5rem);
}

.sa-header .sa-brand {
	flex: 1 1 auto;
	min-width: 0;
}

.sa-brand .sa-brand-title {
	margin: 0;
	font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
	font-size: clamp(1rem, 1.2vw, 1.22rem);
	font-weight: 500;
	letter-spacing: 0.08em;
	line-height: 1.2;
}

.sa-brand .sa-brand-title a {
	color: var(--sa-ink);
	text-decoration: none;
}

.sa-header .sa-navigation {
	flex: 0 0 auto;
	font-size: 0.78rem;
}

.sa-header .sa-navigation > .wp-block-navigation__container,
.sa-header .sa-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container {
	gap: clamp(0.65rem, 1.3vw, 1.15rem);
}

.sa-header .sa-navigation .wp-block-navigation-item__label {
	white-space: nowrap;
}

.sa-language-switcher {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 0.18rem;
	margin: 0;
	font-family: "Noto Sans TC", "PingFang TC", sans-serif;
	font-size: 0.68rem;
	letter-spacing: 0.02em;
	line-height: 1;
	white-space: nowrap;
}

.sa-language-switcher a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding-inline: 0.18rem;
	color: #646e63;
	text-decoration: none;
	text-underline-offset: 0.32em;
}

.sa-language-switcher a[aria-current="true"] {
	color: var(--sa-ink);
	font-weight: 600;
	text-decoration: underline;
}

.sa-language-switcher a:hover,
.sa-language-switcher a:focus-visible {
	color: var(--sa-ink);
	text-decoration: underline;
}

.sa-language-switcher a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.sa-language-switcher > span {
	color: #989f95;
}

.sa-language-en .sa-page-title,
.sa-language-en .sa-section-title {
	letter-spacing: 0;
}

.sa-language-en .sa-footer__menu a {
	line-height: 1.65;
}

body .sa-navigation .is-menu-open .wp-block-navigation-item:nth-child(6) {
	animation-delay: 480ms;
}

@media (min-width: 782px) and (max-width: 1000px) {
	.sa-header .sa-brand-note {
		max-width: 13rem;
		font-size: 0.58rem;
		letter-spacing: 0.09em;
	}

	.sa-header .wp-block-site-title,
	.sa-brand .sa-brand-title {
		font-size: 0.92rem;
		letter-spacing: 0.03em;
	}
}

@media (max-width: 781px) {
	/* Keep the language control inside the open mobile menu, after its tagline. */
	body .sa-navigation .is-menu-open .wp-block-navigation__responsive-container-content::after {
		order: 1;
	}

	body .sa-navigation .is-menu-open .wp-block-navigation__responsive-container-content > .sa-language-switcher--mobile-menu {
		order: 2;
		align-self: center;
		flex: 0 0 auto;
		justify-content: center;
		gap: 0.35rem;
		margin: auto 0 0;
		padding-top: 1.1rem;
		font-size: 0.82rem;
		letter-spacing: 0.08em;
		animation: sa-menu-item-in 800ms 500ms ease both;
	}

	/* No rectangular frame around the menu toggle or the auto-focused first link. */
	body .sa-header .sa-navigation .wp-block-navigation__responsive-container-open,
	body .sa-header .sa-navigation .wp-block-navigation__responsive-container-close {
		border: 0 !important;
		box-shadow: none !important;
	}

	body .sa-header .sa-navigation .wp-block-navigation__responsive-container-open:focus,
	body .sa-header .sa-navigation .wp-block-navigation__responsive-container-close:focus {
		outline: 0 !important;
		box-shadow: none !important;
	}

	body .sa-header .sa-navigation .wp-block-navigation__responsive-container-open:focus-visible,
	body .sa-header .sa-navigation .wp-block-navigation__responsive-container-close:focus-visible {
		color: var(--sa-muted);
	}

	body .sa-navigation .is-menu-open .wp-block-navigation-item__content:focus {
		outline: 0 !important;
		box-shadow: none !important;
	}

	body .sa-navigation .is-menu-open .wp-block-navigation-item__content:focus-visible {
		text-decoration: underline;
		text-decoration-thickness: 2px;
		text-underline-offset: 0.45em;
	}

	/* Match the native overlay breakpoint to this theme's mobile menu styling. */
	.sa-header .sa-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none;
	}

	.sa-header .sa-navigation .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.sa-header > .sa-header__inner {
		gap: 0.45rem;
	}

	.sa-header .sa-navigation {
		margin-left: 0;
	}

	.sa-header .sa-brand .wp-block-site-title,
	.sa-header .sa-brand .sa-brand-title {
		font-size: clamp(0.78rem, 2.8vw, 1rem);
		letter-spacing: 0.025em;
		line-height: 1.35;
	}

	.sa-header .sa-brand-note {
		max-width: none;
		font-size: 0.51rem;
		letter-spacing: 0.08em;
		line-height: 1.5;
	}

	.sa-language-switcher {
		gap: 0.1rem;
		font-size: 0.65rem;
	}

	body.sa-language-en .sa-navigation .is-menu-open .wp-block-navigation__responsive-container-content::after {
		content: "A little space to create and grow";
		max-width: 24rem;
		letter-spacing: 0.07em;
	}

	body.sa-language-en .sa-navigation .is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content {
		font-size: clamp(1.45rem, 6.3vw, 1.8rem);
		letter-spacing: 0.035em;
	}
}

@media (max-width: 519px) {
	/* On phone-width headers, keep language links in the open menu only. */
	body .sa-header .sa-language-switcher:not(.sa-language-switcher--mobile-menu) {
		display: none !important;
	}
}

.sa-language-en .sa-page-title {
 font-size: clamp(2.15rem, 4vw, 3.5rem);
 line-height: 1.15;
 max-width: 24ch;
}

/* Keep the English navigation on one quiet row at tablet widths. */
@media (min-width: 520px) and (max-width: 781px) {
	body.sa-language-en .sa-header > .sa-header__inner {
		min-height: 56px;
		padding-block: 0;
		padding-inline: clamp(1.25rem, 6.5vw, 2.4rem);
		gap: clamp(0.25rem, 1vw, 0.5rem);
		justify-content: space-between;
	}

	body.sa-language-en .sa-header .sa-brand {
		display: none;
	}

	body.sa-language-en .sa-header .wp-block-navigation__responsive-container:not(.is-menu-open) {
		position: static;
		display: flex !important;
		flex: 1 1 auto;
		width: auto;
		height: auto;
		padding: 0;
		overflow: visible;
		visibility: visible;
		background: transparent;
	}

	body.sa-language-en .sa-header .wp-block-navigation__responsive-close {
		width: 100%;
		max-width: none;
		margin: 0;
	}

	body.sa-language-en .sa-header .wp-block-navigation__responsive-container-open,
	body.sa-language-en .sa-header .wp-block-navigation__responsive-container-close {
		display: none !important;
	}

	body.sa-language-en .sa-header .wp-block-navigation__responsive-container-content {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		width: 100%;
		min-height: 0;
		padding: 0;
		gap: 0;
	}

	body.sa-language-en .sa-header nav.wp-block-navigation {
		display: flex;
		flex: 1 1 auto;
		align-items: center;
		justify-content: flex-start;
		min-width: 0;
		margin: 0;
	}

	body.sa-language-en .sa-header .wp-block-navigation__container {
		box-sizing: border-box;
		width: 100%;
		flex-wrap: nowrap;
		justify-content: space-between;
		gap: clamp(0.15rem, 0.8vw, 0.4rem);
		margin: 0;
		padding: 0;
	}

	body.sa-language-en .sa-header .wp-block-navigation-item {
		flex: 0 0 auto;
		min-width: 0;
	}

	body.sa-language-en .sa-header .wp-block-navigation-item__content {
		min-height: 44px;
		padding-inline: 0;
		font-size: 0.72rem;
		line-height: 1;
		white-space: nowrap;
	}

	body.sa-language-en .sa-header .sa-language-switcher {
		flex: 0 0 auto;
		margin-left: 0;
		gap: 0.08rem;
		font-size: 0.68rem;
	}

	body.sa-language-en .sa-header .sa-language-switcher a {
		min-height: 44px;
		padding-inline: 0.12rem;
	}
}
