/* ==========================================================
   美好祈福 Elementor 模組樣式（design.md 第 6 節）
   顏色、字型使用主題 tokens.css 的變數；未載入主題時使用括號內預設值。
   ========================================================== */

/* 模組之間不加 Elementor 預設間距，間距由模組自己控制 */
.elementor-widget[data-widget_type^="mh-"],
.elementor-widget[data-widget_type^="mh-"]:not(:last-child) { margin: 0 !important; margin-block-end: 0 !important; }
.elementor-widget[data-widget_type^="mh-"] > .elementor-widget-container { padding: 0; margin: 0; }

.mh-w {
	--g: var(--mh-gutter, 20px);
	color: var(--mh-ink, #2B1D16);
	font-family: var(--mh-font-sans, 'Noto Sans TC', sans-serif);
	text-align: left;
	max-width: var(--mh-max, 100%);
	margin-inline: auto;
}
.mh-w a { color: inherit; text-decoration: none; }
.mh-w a:hover { opacity: .88; }
.mh-w a:focus-visible { outline: 2px solid var(--mh-red, #A8281E); outline-offset: 2px; }
.mh-w svg { flex-shrink: 0; }
.mh-ph { display: block; background: var(--mh-placeholder, #EADFCC); }

/* 區塊標題（6-4） */
.mh-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.mh-h2 {
	display: flex; align-items: flex-start; gap: 10px; margin: 0; text-wrap: balance;
	font-family: var(--mh-font-serif, 'Noto Serif TC', serif);
	font-size: var(--mh-fs-h2, 20px); font-weight: 700; line-height: 1.35;
	letter-spacing: var(--mh-track-h2, .1em); color: var(--mh-ink, #2B1D16);
}
.mh-h2-line { width: 18px; height: 2px; margin-top: .67em; background: var(--mh-red, #A8281E); flex-shrink: 0; }
.mh-more { font-size: var(--mh-fs-label, 13px); color: var(--mh-red, #A8281E) !important; white-space: nowrap; }

/* 主視覺（6-3） */
.mh-w-hero { padding: 0 var(--g); }
.mh-hero {
	position: relative; overflow: hidden;
	display: flex; flex-direction: column; gap: 12px;
	background-color: var(--mh-red, #A8281E); background-size: cover; background-position: center;
	color: var(--mh-on-red, #FFF7EC);
	border-radius: var(--mh-radius-card, 14px); padding: 24px 22px;
}
.mh-hero-kicker { font-size: var(--mh-fs-caption, 12px); letter-spacing: var(--mh-track-kicker, .3em); color: var(--mh-on-red-3, #F3D9A4); }
.mh-hero-title {
	margin: 0; font-family: var(--mh-font-serif, 'Noto Serif TC', serif);
	font-size: var(--mh-fs-display, 30px); line-height: 1.3; font-weight: 700; color: var(--mh-on-red, #FFF7EC);
	text-wrap: balance;
}
.mh-hero-desc { margin: 0; font-size: var(--mh-fs-body-sm, 14px); line-height: 1.6; color: var(--mh-on-red-2, #FBE9D8); }
.mh-hero-btn {
	align-self: flex-start; margin-top: 4px; min-height: 44px; padding: 0 22px;
	display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
	background: var(--mh-on-red, #FFF7EC); color: var(--mh-red, #A8281E) !important;
	border-radius: 22px; font-size: var(--mh-fs-body, 15px); font-weight: 700;
}

/* 精簡主視覺：介紹頁用，大標約為首頁的 87%（手機 26px） */
.mh-hero--compact .mh-hero-title { font-size: calc(var(--mh-fs-display, 30px) * .87); }

/* 服務格（6-5） */
.mh-w-services { padding: calc(var(--mh-section, 24px) + 4px) var(--g) 8px; }
.mh-w-services .mh-head { margin-bottom: 16px; }
.mh-services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 8px; }
.mh-service { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; text-align: center; }
.mh-service-icon {
	width: 58px; height: 58px; border-radius: 50%;
	background: var(--mh-card, #FFFCF6); border: 1px solid var(--mh-line, #E4D6BF); color: var(--mh-red, #A8281E);
	display: flex; align-items: center; justify-content: center;
}
.mh-service-label { font-size: var(--mh-fs-label, 13px); line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.mh-service-note { font-size: var(--mh-fs-micro, 10px); color: var(--mh-muted, #6B5A4A); margin-top: -6px; text-align: center; }

/* 旅遊團橫幅（6-6） */
.mh-w-tour { padding: var(--mh-section, 24px) var(--g) 8px; }
.mh-tour {
	display: flex; gap: 14px; align-items: center;
	background: var(--mh-card, #FFFCF6); border: 1px solid var(--mh-line, #E4D6BF);
	border-radius: var(--mh-radius-card, 14px); padding: 12px;
}
.mh-tour-img { width: 96px; height: 96px; flex-shrink: 0; border-radius: 10px; object-fit: cover; }
.mh-tour-text { display: flex; flex-direction: column; gap: 6px; flex-grow: 1; min-width: 0; }
.mh-tour-label { font-size: var(--mh-fs-caption, 12px); color: var(--mh-gold, #8A6420); letter-spacing: var(--mh-track-label, .15em); }
.mh-tour-title { font-family: var(--mh-font-serif, 'Noto Serif TC', serif); font-size: var(--mh-fs-h3, 17px); font-weight: 700; line-height: 1.35; }
.mh-tour-meta { font-size: var(--mh-fs-label, 13px); line-height: 1.45; color: var(--mh-muted, #6B5A4A); text-wrap: pretty; }
.mh-tour-arrow { color: var(--mh-muted, #6B5A4A); display: flex; }

/* 排行榜（6-7）：左側貼齊留白、右側延伸到畫面邊緣、可橫向滑動 */
.mh-w-ranking { padding: var(--mh-section, 24px) 0 8px var(--g); }
.mh-w-ranking .mh-head { padding-right: var(--g); }
.mh-rank-track {
	display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
	padding-right: var(--g); scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.mh-rank-track::-webkit-scrollbar { display: none; }
.mh-rank { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; scroll-snap-align: start; }
.mh-rank-img { width: 200px; height: 130px; border-radius: var(--mh-radius-img, 12px); object-fit: cover; }
.mh-rank-count { font-size: var(--mh-fs-caption, 12px); color: var(--mh-red, #A8281E); font-weight: 700; }
.mh-rank-title {
	font-family: var(--mh-font-serif, 'Noto Serif TC', serif); font-size: var(--mh-fs-h4, 16px); font-weight: 600; line-height: 1.4; margin-top: -6px;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 熱門廟宇（6-8） */
.mh-w-temples { padding: var(--mh-section, 24px) var(--g) var(--mh-section, 24px); }
.mh-temples { display: flex; flex-direction: column; gap: 12px; }
.mh-temple {
	display: flex; gap: 14px; align-items: center;
	background: var(--mh-card, #FFFCF6); border: 1px solid var(--mh-line, #E4D6BF);
	border-radius: 12px; padding: 10px;
}
.mh-temple-img { width: 76px; height: 76px; flex-shrink: 0; border-radius: 8px; object-fit: cover; }
.mh-temple-text { display: flex; flex-direction: column; gap: 6px; flex-grow: 1; min-width: 0; }
.mh-temple-name {
	font-family: var(--mh-font-serif, 'Noto Serif TC', serif); font-size: var(--mh-fs-h4, 16px); font-weight: 700; line-height: 1.35;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mh-temple-loc { font-size: var(--mh-fs-label, 13px); color: var(--mh-muted, #6B5A4A); }
.mh-temple-tag {
	align-self: flex-start; font-size: var(--mh-fs-caption, 12px); color: var(--mh-red, #A8281E);
	border: 1px solid var(--mh-red, #A8281E); border-radius: var(--mh-radius-sm, 4px); padding: 1px 8px;
}

/* 摺疊介紹 */
.mh-w-accordion { padding: var(--mh-section, 24px) var(--g) 8px; }
.mh-w-accordion .mh-head { margin-bottom: 4px; }
.mh-acc-item { border-bottom: 1px solid var(--mh-line, #E4D6BF); }
.mh-acc-item summary {
	list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
	font-size: var(--mh-fs-body, 15px); font-weight: 700; color: var(--mh-ink, #2B1D16);
}
.mh-acc-item summary::-webkit-details-marker { display: none; }
.mh-acc-item summary svg { color: var(--mh-muted, #6B5A4A); transition: transform .2s; }
.mh-acc-item[open] summary svg { transform: rotate(180deg); }
.mh-acc-body { padding: 0 0 14px; font-size: var(--mh-fs-body-sm, 14px); line-height: 1.85; }

/* 連結列表 */
.mh-w-links { padding: 16px var(--g) 0; }
.mh-links { background: var(--mh-card, #FFFCF6); border: 1px solid var(--mh-line, #E4D6BF); border-radius: var(--mh-radius-card, 14px); padding: 0 14px; }
.mh-link-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; }
.mh-link-row + .mh-link-row { border-top: 1px solid var(--mh-line, #E4D6BF); }
.mh-link-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--mh-paper, #F7F1E6); color: var(--mh-red, #A8281E); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mh-link-text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.mh-link-label { font-size: var(--mh-fs-body, 15px); }
.mh-link-sub { font-size: var(--mh-fs-caption, 12px); color: var(--mh-muted, #6B5A4A); }
.mh-link-arrow { color: var(--mh-muted, #6B5A4A); display: flex; }

/* 選項卡片 */
.mh-w-cards { padding: var(--mh-section, 24px) var(--g) 0; }
.mh-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mh-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; background: var(--mh-card, #FFFCF6); border: 1px solid var(--mh-line, #E4D6BF); border-radius: var(--mh-radius-card, 14px); text-align: center; }
.mh-card-img { width: 100%; height: 110px; border-radius: 10px; object-fit: cover; }
.mh-cards.is-round .mh-card-img { width: 72px; height: 72px; border-radius: 50%; }
.mh-card-title { font-family: var(--mh-font-serif, 'Noto Serif TC', serif); font-size: var(--mh-fs-h4, 16px); font-weight: 700; line-height: 1.35; }
.mh-card-sub { font-size: var(--mh-fs-caption, 12px); color: var(--mh-muted, #6B5A4A); line-height: 1.4; }

/* 提示框 */
.mh-w-notice { padding: 16px var(--g) 0; }
.mh-notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: var(--mh-fs-label, 13px); line-height: 1.6; }
.mh-notice.is-info { background: #F6EEDC; color: var(--mh-ink, #2B1D16); }
.mh-notice.is-info .mh-notice-icon { color: var(--mh-gold, #8A6420); }
.mh-notice.is-brand { background: #FBE9D8; color: var(--mh-ink, #2B1D16); }
.mh-notice.is-brand .mh-notice-icon { color: var(--mh-red, #A8281E); }
.mh-notice.is-tag { display: inline-flex; padding: 2px 10px; border-radius: 4px; background: #EFE8DC; color: var(--mh-muted, #6B5A4A); font-size: var(--mh-fs-caption, 12px); font-weight: 700; }
.mh-notice-icon { display: flex; margin-top: 1px; }

/* 步驟說明 */
.mh-w-steps { padding: var(--mh-section, 24px) var(--g) 8px; }
.mh-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.mh-step { display: flex; gap: 12px; align-items: flex-start; }
.mh-step-no {
	width: 28px; height: 28px; border-radius: 50%; background: var(--mh-red, #A8281E); color: var(--mh-on-red, #FFF7EC);
	font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mh-step-text { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; min-width: 0; }
.mh-step-title { font-size: var(--mh-fs-body, 15px); font-weight: 700; }
.mh-step-desc { font-size: var(--mh-fs-label, 13px); line-height: 1.6; color: var(--mh-muted, #6B5A4A); }

/* ==========================================================
   平板（768px 以上）
   ========================================================== */
@media (min-width: 768px) {
	.mh-hero { padding: 36px 40px; gap: 14px; }
	.mh-hero-title, .mh-hero-desc { max-width: 560px; }
	.mh-hero-btn { min-height: 48px; padding: 0 28px; }

	.mh-services { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
	.mh-service-icon { width: 64px; height: 64px; }

	.mh-tour { padding: 14px; gap: 20px; }
	.mh-tour-img { width: 150px; height: 100px; }

	/* 排行榜改成 3 欄格線，不再橫向滑動 */
	.mh-w-ranking { padding-right: var(--g); }
	.mh-w-ranking .mh-head { padding-right: 0; }
	.mh-rank-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; overflow: visible; padding-right: 0; }
	.mh-rank { width: auto; }
	.mh-rank-img { width: 100%; height: auto; aspect-ratio: 16 / 10; }

	.mh-temples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
	.mh-temple-img { width: 84px; height: 84px; }
	.mh-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ==========================================================
   電腦（1024px 以上）
   ========================================================== */
@media (min-width: 1024px) {
	.mh-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
	.mh-step { flex-direction: column; padding: 18px; background: var(--mh-card, #FFFCF6); border: 1px solid var(--mh-line, #E4D6BF); border-radius: 16px; }
	.mh-head { margin-bottom: 20px; }
	.mh-h2-line { width: 24px; }
	.mh-more { font-size: 15px; }

	/* 主視覺：橫幅，右側以同心圓呼應印章與燈籠 */
	.mh-w-hero { padding-top: 32px; }
	.mh-hero { min-height: 360px; justify-content: center; padding: 56px 64px; border-radius: 20px; gap: 16px; }
	.mh-hero::before, .mh-hero::after {
		content: ""; position: absolute; top: 50%; border-radius: 50%;
		border: 1px solid rgba(255, 247, 236, .22); pointer-events: none; transform: translateY(-50%);
	}
	.mh-hero::before { right: 48px; width: 280px; height: 280px; }
	.mh-hero::after { right: 88px; width: 200px; height: 200px; border-style: dashed; }
	.mh-hero.has-image::before, .mh-hero.has-image::after { display: none; }
	.mh-hero > * { position: relative; z-index: 1; }
	.mh-hero-title, .mh-hero-desc { max-width: 620px; }
	.mh-hero-btn { font-size: 16px; }

	/* 服務格：一列 8 個，放在卡片底上 */
	.mh-services {
		background: var(--mh-card, #FFFCF6); border: 1px solid var(--mh-line, #E4D6BF);
		border-radius: 20px; padding: 28px 16px; gap: 16px;
	}
	.mh-service { gap: 10px; }
	.mh-service-icon { width: 76px; height: 76px; background: var(--mh-paper, #F7F1E6); }
	.mh-service-icon svg { width: 30px; height: 30px; }
	.mh-service-label { font-size: 15px; }
	.mh-service-note { margin-top: -4px; }

	.mh-tour { padding: 18px; gap: 28px; border-radius: 20px; }
	.mh-tour-img { width: 240px; height: 140px; border-radius: 14px; }
	.mh-tour-text { gap: 8px; }
	.mh-tour-meta { font-size: 15px; }

	.mh-rank-track { gap: 24px; }
	.mh-rank-img { border-radius: 16px; }

	.mh-temples { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
	.mh-temple { flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; border-radius: 16px; gap: 0; }
	.mh-temple-img { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 0; }
	.mh-temple-text { padding: 16px 18px 18px; gap: 8px; }
	.mh-acc-item summary { font-size: 17px; min-height: 60px; }
	.mh-acc-body { font-size: 16px; }
	.mh-links { max-width: 640px; }
}

/* 編輯器提示 */
.mh-editor-note { margin: 12px var(--g); padding: 12px 14px; border: 1px dashed var(--mh-red, #A8281E); border-radius: 8px; font-size: 13px; color: var(--mh-red, #A8281E); }
