/* 首頁專用（v2）：只在首頁載入，選擇器以 .hx- 開頭。值一律 var(--token)。
   主參考 RE:LAB〈Have a Nice Ride〉：天空街角插畫、圓角白卡、膠囊按鈕；副參考〈台電 循環材料〉：緞帶標題。 */

body.is-home .site-footer { margin-top: 0; }
.hx-sec { padding-block: var(--space-6); }
.hx-alt { background: var(--bg-alt); }
.hx-cream { background: var(--cream); }
@media (min-width: 900px) { .hx-sec { padding-block: var(--space-7); } }
.hx-head { display: grid; justify-items: center; text-align: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.hx-h2 { font-size: clamp(var(--text-2xl), 3.6vw, var(--text-3xl)); }

/* ---------- 緞帶標題 ---------- */
.ribbon { position: relative; display: inline-block; margin: 0; padding-inline: var(--space-5); font-size: clamp(var(--text-xl), 3vw, var(--text-2xl)); line-height: 1; }
.ribbon span { position: relative; z-index: 1; display: block; padding: var(--space-3) var(--space-5); background: var(--ribbon); color: var(--ribbon-fg); border: var(--stroke) solid var(--border); border-radius: var(--radius-sm); }
.ribbon::before, .ribbon::after { content: ""; position: absolute; top: var(--space-3); bottom: calc(var(--space-3) * -1); width: var(--space-6); background: var(--surface); border: var(--stroke) solid var(--border); }
.ribbon::before { left: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 30% 50%); }
.ribbon::after { right: 0; clip-path: polygon(0 0, 100% 0, 70% 50%, 100% 100%, 0 100%); }

/* ---------- 首屏：天空街角插畫 ---------- */
.hx-hero { position: relative; background: var(--sky); border-bottom: var(--stroke) solid var(--border); overflow: hidden; }
.hx-hero-art img { display: block; width: 100%; height: auto; }
.hx-hero-inner { padding-block: var(--space-5) var(--space-4); }
.hx-hero h1 { font-size: min(var(--text-display), calc((100vw - 2 * var(--space-3)) / 8.4)); line-height: var(--leading-tight); letter-spacing: 0.02em; margin-bottom: var(--space-5); }
.hx-hero h1 .nw { display: inline-block; white-space: normal; max-width: 100%; } /* 每段自成一行；放大字距放不下時段內可再折行，不被裁掉 */
.hx-org { --hx-coin-d: clamp(56px, 5.6vw, 92px); display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.hx-org-name { font-family: var(--font-display); font-weight: var(--display-weight); font-size: min(var(--text-3xl), calc((100vw - 2 * var(--space-3) - var(--hx-coin-d) - var(--space-3)) / 8.4)); line-height: var(--leading-tight); letter-spacing: 0.04em; min-width: 0; } .hx-org-name .nw { display: inline-block; } /* 字距放大放不下時在「旭翔公益／事業機構」之間折行 */ /* 客戶 11-29 12:01：全名「旭翔公益事業機構」要明顯 */
.hx-coin { --coin-d: var(--hx-coin-d); --coin-t: 7px; }
.hx-coin::after { content: ""; position: absolute; inset: auto 14% calc(var(--space-2) * -1.5) 14%; height: var(--space-2); border-radius: 50%; background: rgb(29 43 79 / 0.18); filter: blur(3px); }
.hx-coin .coin-spin { transform: rotateY(-24deg); } /* 不播動畫時斜放，看得出硬幣厚度 */
@media (prefers-reduced-motion: no-preference) { .hx-coin .coin-spin { animation: coin-cycle 6s var(--ease) 0.8s infinite both; } }
.hx-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.btn-lg { font-size: var(--text-lg); min-height: 56px; padding-inline: var(--space-5); }
/* 首屏：插畫靠右、文字在左側天空。
   ≥900 用左側天空橫向拉長的油畫寬圖（寬高比 3.55），高度固定 --hx-h，圖照高度縮放、貼右下 → 小店＋腳踏車占右邊 0.88×高度，
   文字欄＝剩下的寬度（再留 0.07×高度）；地面約在圖高 84%，圓標＋標題＋按鈕在地面以上垂直置中。
   <900 天空放不下標題＋按鈕，改成文字在上（底是油畫天空）、插畫（右側小店裁圖）在下。 */
@media (max-width: 899px) {
  .hx-hero { display: flex; flex-direction: column-reverse; background: var(--sky) url(/img/page-sky-1200.webp) no-repeat 85% top / cover; }
}
@media (max-width: 719px) { .hx-cta .btn { width: 100%; } }
@media (min-width: 900px) {
  .hx-hero { --hx-h: clamp(440px, 40vw, 720px); height: var(--hx-h); display: flex; }
  .hx-hero-art { position: absolute; inset: 0; }
  .hx-hero-art img { height: 100%; object-fit: cover; object-position: right bottom; }
  .hx-hero-inner { position: relative; display: flex; flex-direction: column; justify-content: center; padding-block: var(--space-5) calc(var(--hx-h) * 0.16 + var(--space-3)); }
  .hx-hero-text { --hx-col: calc(100vw - 0.95 * var(--hx-h) - max(var(--space-5), (100vw - var(--container-wide)) / 2 + var(--space-5)) - var(--space-6)); max-width: min(var(--hx-col), var(--measure-wide)); } /* 超寬螢幕也讓標題在「，」後換成兩行 */
  .hx-hero h1 { font-size: min(var(--text-display), calc(var(--hx-col) / 8.6)); margin-bottom: clamp(var(--space-4), 2.4vw, var(--space-5)); }
  .hx-org { margin-bottom: clamp(var(--space-3), 1.6vw, var(--space-4)); }
  .hx-org-name { font-size: min(var(--text-3xl), calc((var(--hx-col) - var(--hx-coin-d) - var(--space-3)) / 8.4)); } /* 「處處時時皆可公益」8 字一行放得進文字欄 */
}

/* ---------- 影響力數字 ---------- */
.hx-stats-sec { padding-block: var(--space-5); }
.hx-stats { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 1fr); }
.hx-stat { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); display: grid; gap: var(--space-1); }
.hx-stat-label { font-weight: 700; font-size: var(--text-md); }
.hx-stat-val { display: flex; align-items: baseline; gap: var(--space-2); }
.hx-stat-val .num { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(var(--text-3xl), 5vw, var(--text-4xl)); line-height: var(--leading-tight); }
.hx-stat-pts .num { color: var(--accent); }
.hx-stat-val .unit { font-weight: 700; font-size: var(--text-md); }
.hx-stat-note { font-size: var(--text-sm); color: var(--subtle-fg); }
@media (min-width: 720px) { .hx-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); } .hx-stat { padding: var(--space-5); } }

/* ---------- 四步驟 ---------- */
.hx-steps { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); counter-reset: step; }
.hx-step { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); display: grid; gap: var(--space-2); align-content: start; justify-items: center; text-align: center; }
.hx-step-art { width: 132px; height: 132px; border-radius: var(--radius-lg); border: 3px solid var(--gold); outline: var(--stroke-thin) solid var(--gold-soft); outline-offset: 3px; box-shadow: var(--shadow-frame); margin-block: var(--space-1) var(--space-2); }
.hx-step-no { font-family: var(--font-mono); font-weight: 600; font-size: var(--text-sm); letter-spacing: 0.08em; background: var(--highlight); padding: 0 var(--space-3); border-radius: var(--radius-pill); line-height: var(--leading-loose); }
.hx-step h3 { font-size: var(--text-xl); }
.hx-step-text { font-size: var(--text-base); line-height: var(--leading-loose); text-align: left; }
@media (min-width: 640px) { .hx-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1120px) { .hx-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.hx-ledger { margin-top: var(--space-6); display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: center; }
.hx-ledger-text h3 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.hx-ledger-text p { line-height: var(--leading-loose); max-width: var(--measure); }
.hx-sample { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); }
.hx-sample-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: var(--space-2); }
.hx-sample dl > div { display: flex; justify-content: space-between; gap: var(--space-3); padding-block: var(--space-2); border-top: var(--stroke-thin) dashed var(--hairline); }
.hx-sample dt { font-size: var(--text-sm); font-weight: 700; color: var(--muted-fg); }
.hx-sample dd { text-align: right; overflow-wrap: anywhere; }
.hx-pt { color: var(--accent); }
@media (min-width: 900px) { .hx-ledger { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); } }

/* ---------- 合規聲明 ---------- */
.hx-rules { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.hx-rules li { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); display: grid; gap: var(--space-2); align-content: start; }
.hx-rule-art { width: 96px; height: 96px; border-radius: var(--radius-md); border: 3px solid var(--gold); outline: var(--stroke-thin) solid var(--gold-soft); outline-offset: 3px; box-shadow: var(--shadow-frame); margin: var(--space-1) var(--space-1) var(--space-2); } /* 金框油畫小圖，和步驟區同一家族 */
.hx-rules h3 { font-size: var(--text-xl); }
.hx-rules p { line-height: var(--leading-loose); }
@media (min-width: 900px) { .hx-rules { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hx-rules li { padding: var(--space-5); } }

/* ---------- 兩種點數 ---------- */
.hx-kinds { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
.hx-kind { background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); display: grid; gap: var(--space-3); }
.hx-kind-top { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.hx-kind h3 { font-size: var(--text-xl); }
.hx-kind p { line-height: var(--leading-loose); }
.hx-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: 700; color: var(--muted-fg); }
.hx-line i { height: var(--space-3); border: var(--stroke) solid var(--border); border-radius: var(--radius-pill); background: var(--leaf-soft); }
.hx-line-renew i { display: flex; gap: var(--stroke); background: var(--border); overflow: hidden; }
.hx-line-renew b { flex: 1; background: var(--highlight); }
@media (min-width: 900px) { .hx-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hx-kind { padding: var(--space-5); } }

/* ---------- 合作夥伴 ---------- */
.hx-partners { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); align-items: center; }
.hx-partners-text { display: grid; gap: var(--space-3); justify-items: start; }
.hx-partners-text p { line-height: var(--leading-loose); max-width: var(--measure); }
.hx-count { display: flex; align-items: baseline; gap: var(--space-2); font-weight: 700; }
.hx-count .num { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-4xl); line-height: 1; }
.hx-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.hx-chip { display: inline-flex; align-items: baseline; gap: var(--space-2); background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-pill); padding: var(--space-2) var(--space-4); min-height: 48px; align-items: center; }
.hx-chip b { font-weight: 700; }
.hx-chip span { font-size: var(--text-sm); color: var(--muted-fg); }
.hx-chip-join { padding: 0; border-style: dashed; background: transparent; }
.hx-chip-join a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 48px; padding: var(--space-2) var(--space-4); color: var(--fg); text-decoration: none; border-radius: var(--radius-pill); }
.hx-chip-join a:hover { background: var(--highlight); }
.hx-chip-join .icon { width: var(--text-lg); height: var(--text-lg); }
@media (min-width: 900px) { .hx-partners { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-6); } }

/* ---------- 最新消息 ---------- */
.hx-news { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 1fr); }
.hx-news a { display: grid; gap: var(--space-2); height: 100%; background: var(--surface); border: var(--stroke) solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); color: var(--fg); text-decoration: none; }
.hx-news time { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--subtle-fg); }
.hx-news-t { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); line-height: var(--leading-snug); }
.hx-go { display: inline-flex; align-items: center; gap: var(--space-1); margin-top: auto; font-weight: 700; color: var(--accent-ink); }
.hx-go .icon { width: var(--text-lg); height: var(--text-lg); }
.hx-news a:hover { background: var(--bg-alt); }
.hx-news a:hover .hx-news-t { text-decoration: underline; text-decoration-thickness: var(--stroke-thin); text-underline-offset: var(--space-1); }
.hx-more { margin-top: var(--space-3); text-align: center; }
@media (min-width: 840px) { .hx-news { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); } }
@media (prefers-reduced-motion: no-preference) { .hx-news a, .hx-chip-join a { transition: background-color var(--dur-state) var(--ease); } }
