/* 多語範本切換 Template Language Switcher — 前台樣式 */

/* ---------- 內容區 ---------- */
.tls-pane {
	display: none;
}

html[data-tls-lang="zh"] .tls-pane[data-tls-lang="zh"],
html[data-tls-lang="en"] .tls-pane[data-tls-lang="en"],
.tls-pane--solo {
	display: block;
}

/* 未執行 JS / 未設定語言時，至少顯示第一個版本 */
html:not([data-tls-lang]) .tls-content > .tls-pane:first-child {
	display: block;
}

/* 淡入 */
.tls-content--fade .tls-pane {
	animation: tls-fade-in 0.3s ease both;
}

@keyframes tls-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tls-content--fade .tls-pane {
		animation: none;
	}
}

/* ---------- 語言顯示條件 ---------- */
html[data-tls-lang="en"] .tls-only-zh,
html[data-tls-lang="zh"] .tls-only-en {
	display: none !important;
}

/* ---------- 切換鈕 ---------- */
.tls-switch {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	line-height: 1.2;
}

.tls-switch__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	opacity: 0.55;
	box-sizing: border-box;
	transition: opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.tls-switch__btn:hover,
.tls-switch__btn:focus {
	text-decoration: none;
	opacity: 1;
}

html[data-tls-lang="zh"] .tls-switch__btn[data-lang="zh"],
html[data-tls-lang="en"] .tls-switch__btn[data-lang="en"] {
	opacity: 1;
	cursor: default;
}

.tls-switch__sep {
	opacity: 0.35;
	user-select: none;
}

/* ---------- 編輯器 ---------- */
.tls-content--editor .tls-pane {
	display: block !important;
	position: relative;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
	margin-bottom: 14px;
	padding-top: 26px;
}

.tls-pane__flag {
	position: absolute;
	top: 0;
	left: 0;
	padding: 3px 10px;
	font-size: 11px;
	line-height: 1.6;
	letter-spacing: 0.05em;
	background: #515962;
	color: #fff;
	border-radius: 4px 0 4px 0;
	z-index: 2;
}

.tls-notice {
	padding: 22px;
	border: 1px dashed #c3c4c7;
	border-radius: 4px;
	color: #6d7882;
	text-align: center;
	font-size: 14px;
	line-height: 1.8;
}
