/* WJ-215 / QAL-112: language switcher.
   ヘッダー右端の Sign in ボタンの左隣にインライン表示する。
   フローティング (`position: fixed`) はやめ、ヘッダーの stacking context に乗せる。 */
.wj-lang-switcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Sans", "Yu Gothic", sans-serif;
	font-size: 13px;
	line-height: 1.3;
}

/* font-size / padding を隣接する `.header-btn` (theme-frame.css:240-) と揃える。
   `.header-btn` は border を持たないため、こちらは border 2px ぶん padding-y を縮め、
   line-height はブラウザ既定値に任せて Sign in / Sign up と同じ高さで並ぶようにする。 */
.wj-lang-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 12px;
	background: #ffffff;
	color: #222;
	border: 1px solid #d0d0d0;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	transition: box-shadow 0.15s ease, background 0.15s ease;
}

.wj-lang-switcher__toggle:hover,
.wj-lang-switcher__toggle:focus {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	background: #f7f7f7;
	outline: none;
}

.wj-lang-switcher__icon {
	font-size: 16px;
	line-height: 1;
}

.wj-lang-switcher__label {
	color: #555;
	font-weight: 400;
}

.wj-lang-switcher__current {
	font-weight: 600;
	color: #111;
	margin-left: 2px;
	max-width: 140px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wj-lang-switcher__chevron {
	margin-left: 4px;
	color: #888;
	font-size: 10px;
	transition: transform 0.15s ease;
}

.wj-lang-switcher.is-open .wj-lang-switcher__chevron {
	transform: rotate(180deg);
}

.wj-lang-switcher__menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	min-width: 200px;
	max-height: 360px;
	overflow: auto;
	display: none;
	z-index: 10;
}

.wj-lang-switcher.is-open .wj-lang-switcher__menu {
	display: block;
}

.wj-lang-switcher__item {
	padding: 8px 14px;
	cursor: pointer;
	color: #222;
	white-space: nowrap;
	transition: background 0.1s ease;
}

.wj-lang-switcher__item:hover {
	background: #f2f6ff;
}

.wj-lang-switcher__item.is-active {
	background: #e8efff;
	color: #1a3cbf;
	font-weight: 600;
}

/* ヘッダー内に置かれた switcher と Sign in ボタンの間に余白を確保。
   `.header-btns` 側の `gap: 4px` だけだとアイコンと隣接ボタンが詰まりすぎるため。 */
.header-btns > .wj-lang-switcher {
	margin-right: 4px;
}

/* モバイル: アイコンのみ表示。ラベル / 選択中言語 / chevron を隠して
   ヘッダーの幅を奪わないようにする。768px はテーマの既存 breakpoint に合わせる。 */
@media screen and (max-width: 768px) {
	.wj-lang-switcher__toggle {
		padding: 6px 8px;
		border-radius: 6px;
	}
	.wj-lang-switcher__label,
	.wj-lang-switcher__current,
	.wj-lang-switcher__chevron {
		display: none;
	}
	.wj-lang-switcher__icon {
		font-size: 18px;
	}
	.wj-lang-switcher__menu {
		min-width: 180px;
	}
}
