/**
 * RS ShinMenu — Roll Hover Effect + Underline
 * Version: 1.2.3
 */

/* ── 外層容器 ── */
.rsshinmenu-container {
	position: relative;
}

/* ── 選單列表 ── */
.rsshinmenu-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 2em;
}

/* ── 單一項目 ── */
.rsshinmenu-item {
	list-style: none;
}

/* ── 底線動畫（掛在 li，避開 link 的 overflow:hidden） ── */
.rsshinmenu-item::after {
	content: '';
	display: block;
	width: 0;
	height: 2px;
	margin-top: 4px;
	background: var(--Color-2, #98A68C);
	transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── 連結：壓死所有狀態的顏色，防止過渡時閃藍 ── */
.rsshinmenu-link,
.rsshinmenu-link:link,
.rsshinmenu-link:visited,
.rsshinmenu-link:hover,
.rsshinmenu-link:active {
	display: grid;
	grid-template-areas: "text";
	overflow: hidden;
	text-decoration: none;
	color: #5F5E5B;
}

/* ── 雙層文字共用樣式 ── */
.rsshinmenu-text--default,
.rsshinmenu-text--hover {
	grid-area: text;
	display: block;
	transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	white-space: nowrap;
}

/* ── 預設文字（上層） ── */
.rsshinmenu-text--default {
	color: #5F5E5B;
}

/* ── Hover 文字（下層）：初始推到容器下方 ── */
.rsshinmenu-text--hover {
	color: var(--Color-2, #98A68C);
	transform: translateY(100%);
}

/* ── 當前頁面項目 ── */
.rsshinmenu-item--current .rsshinmenu-text--default,
.rsshinmenu-item--current .rsshinmenu-text--hover {
	color: var(--Color-2, #98A68C);
}

.rsshinmenu-item--current::after {
	width: 100%;
}

/* ── Toggle 按鈕（桌面隱藏） ── */
.rsshinmenu-toggle {
	display: none;
}

/* ════════════════════════════════════════════
   桌面版（> 1080px）— hover 觸發動畫
   ════════════════════════════════════════════ */
@media (min-width: 1081px) {
	.rsshinmenu-item:hover .rsshinmenu-text--default {
		transform: translateY(-100%);
	}

	.rsshinmenu-item:hover .rsshinmenu-text--hover {
		transform: translateY(0);
	}

	.rsshinmenu-item:hover::after {
		width: 100%;
	}
}

/* ════════════════════════════════════════════
   手機版（≤ 1080px）
   ════════════════════════════════════════════ */
@media (max-width: 1080px) {

	/* ── Toggle 按鈕 ── */
	.rsshinmenu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		background: none;
		border: none;
		padding: 0;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	.rsshinmenu-toggle-icon {
		display: block;
		width: 24px;
		height: 16px;
	}

	/* ── 面板：預設隱藏 ── */
	.rsshinmenu-nav-wrap {
		display: none;
		position: fixed;
		top: 80px;
		left: 0;
		right: 0;
		bottom: 0;
		background: #FDF9F5;
		z-index: 9999;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: 20px;
	}

	/* ── 面板展開 ── */
	.rsshinmenu--open .rsshinmenu-nav-wrap {
		display: block;
	}

	/* ── 列表改為垂直排列 ── */
	.rsshinmenu--open .rsshinmenu-list {
		flex-direction: column;
		gap: 1.5em;
	}

	/* ── 手機版文字色 ── */
	.rsshinmenu-text--default {
		color: #5F5E5B;
	}

	.rsshinmenu-text--hover {
		color: var(--Color-2, #98A68C);
	}

	/* ── 手機版 current item ── */
	.rsshinmenu-item--current .rsshinmenu-text--default,
	.rsshinmenu-item--current .rsshinmenu-text--hover {
		color: var(--Color-2, #98A68C);
	}

	/* ── 手機版：class 觸發動畫（取代 hover） ── */
	.rsshinmenu-link--activated .rsshinmenu-text--default {
		transform: translateY(-100%);
	}

	.rsshinmenu-link--activated .rsshinmenu-text--hover {
		transform: translateY(0);
	}

	/* ── 手機版底線動畫 ── */
	.rsshinmenu-item--activated::after {
		width: 100%;
	}

	/* ── body scroll lock ── */
	body.rsshinmenu-noscroll {
		overflow: hidden;
	}
}
