/*
 * Header language switcher (see inc/i18n.php).
 */

.gp-lang {
	position: relative;
}

.gp-lang__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 42px;
	padding: 0 8px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: #e5e7eb;
	font-size: 15px;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}

.gp-lang__toggle:hover,
.gp-lang__toggle[aria-expanded="true"] {
	color: #fff;
	background: rgba(255, 255, 255, .08);
}

.gp-lang__flag {
	display: block;
	width: 28px;
	height: 19px;
	border-radius: 4px;
	object-fit: cover;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}

.gp-lang__code {
	letter-spacing: .02em;
}

.gp-lang__chevron {
	transition: transform .2s;
}

.gp-lang__toggle[aria-expanded="true"] .gp-lang__chevron {
	transform: rotate(180deg);
}

.gp-lang__menu {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	z-index: 1100;
	min-width: 230px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow: hidden;
	border: 1px solid #d9dde3;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(17, 24, 39, .25);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
}

.gp-lang.is-open .gp-lang__menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.gp-lang__menu li + li {
	border-top: 1px solid #eef0f3;
}

.gp-lang__option {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 18px;
	color: #3a4150 !important;
	font-size: 17px;
	transition: background-color .15s;
}

.gp-lang__option:hover,
.gp-lang__option:focus-visible {
	background: #f3f4f6;
}

.gp-lang__option.is-active {
	background: #f1f3f5;
	color: #111827 !important;
}

.gp-lang__option.is-active .gp-lang__name {
	font-weight: 600 !important;
}

.gp-lang__name {
	flex: 1;
}

.gp-lang__check {
	color: #3a4150;
}

@media (max-width: 575px) {
	.gp-lang__code {
		display: none;
	}

	.gp-lang__menu {
		right: -60px;
	}
}

/* CJK languages: swap in a font that has the glyphs. */
html[lang^="ko"] body,
html[lang^="ko"] body :where(h1, h2, h3, h4, h5, h6, button, input, textarea, .btn) {
	font-family: "Noto Sans KR", var(--font-sans);
}

html[lang^="ja"] body,
html[lang^="ja"] body :where(h1, h2, h3, h4, h5, h6, button, input, textarea, .btn) {
	font-family: "Noto Sans JP", var(--font-sans);
}
