/* 入口站動態效果（2026-11-17）：首頁、消息清單 news/、關於我們、網站地圖共用。
   主題是「晨霧散開」：主視覺照片從微霧、略放大慢慢對焦，標題隨後升起；其餘只在有意義的地方動：
     1. 主視覺：照片對焦（filter＋transform），標題只位移不淡出（避免拖慢最大內容繪製 LCP）
     2. 清單進入畫面時依序浮現（鄉鎮卡、主題卡、消息卡…，由 assets/nav.js 加上 mo-wait／mo-in）
     3. 區塊標題前的橘色筆觸由下往上畫出
     4. 旅行路線：切換路線時路線先畫出，各站沿路依序出現（assets/app.js 控制 route-wait／route-live）
     5. 回饋：收藏愛心、收藏數、收藏視窗、搜尋結果
   沒有 JavaScript 時內容一律直接顯示；系統設定「減少動態」時只保留短淡入，不位移。 */
:root {
  --mo-ease:cubic-bezier(.16,1,.3,1);
}

@keyframes mo-focus {
  from { transform:scale(1.07); filter:blur(6px) saturate(.8) brightness(1.06); }
}
@keyframes mo-lift {
  from { transform:translateY(18px); }
}
@keyframes mo-rise {
  from { opacity:0; transform:translateY(16px); }
}
@keyframes mo-fade {
  from { opacity:0; }
}
@keyframes mo-brush {
  from { clip-path:inset(100% 0 0 0); }
}
@keyframes mo-draw {
  from { transform:scaleX(0); }
}
@keyframes mo-stop {
  from { opacity:0; transform:translateY(10px) scale(.92); }
}
@keyframes mo-pop {
  40% { transform:scale(1.3); }
}
@keyframes mo-dialog {
  from { opacity:0; transform:translateY(14px) scale(.98); }
}

/* 1. 主視覺：照片對焦、文字依序升起 */
.hero-photo,.news-hero-photo,.ab-photo img {
  animation:mo-focus 1.6s var(--mo-ease) backwards;
}
.ab-photo {
  overflow:hidden;
}
.hero h1,.news-hero h1,.ab-hero h1,.sm h1 {
  animation:mo-lift .9s .12s var(--mo-ease) backwards;
}
.hero .eyebrow,.hero h2,.hero-copy,.finder,.popular,.hero-note,
.news-hero-lead,.news-hero-hint,.news-hero-inner form,.news-hero-note,
.ab-lead,.ab-facts {
  animation:mo-rise .8s var(--mo-ease) backwards;
}
.hero .eyebrow { animation-delay:.05s; }
.hero h2,.news-hero-lead,.ab-lead { animation-delay:.26s; }
.hero-copy,.news-hero-hint { animation-delay:.36s; }
.finder,.news-hero-inner form,.ab-facts { animation-delay:.46s; }
.popular { animation-delay:.58s; }
.hero-note,.news-hero-note { animation-delay:.9s; animation-duration:1.2s; }

/* 2. 清單依序浮現：只隱藏「載入時還在畫面下方」的清單，進入畫面才播放；最多錯開 8 個 */
.mo-wait>* {
  opacity:0;
}
.mo-in>* {
  animation:mo-rise .7s var(--mo-ease) backwards;
  animation-delay:calc(var(--mo-i,0) * 65ms);
}

/* 3. 區塊標題的筆觸 */
.section-heading.mo-wait h2 i {
  clip-path:inset(100% 0 0 0);
}
.section-heading.mo-in h2 i {
  animation:mo-brush .55s .08s var(--mo-ease) backwards;
}
.section-heading.mo-in>p {
  animation:mo-fade .6s .2s ease-out backwards;
}

/* 4. 旅行路線：畫線，再沿路出現各站 */
.route-wait .route-stops:before {
  transform:scaleX(0);
}
.route-wait .route-stop {
  opacity:0;
}
.route-live .route-stops:before {
  transform-origin:left center;
  animation:mo-draw .75s var(--mo-ease) backwards;
}
.route-live .route-stop {
  animation:mo-stop .5s var(--mo-ease) backwards;
}
.route-live .route-stop:nth-child(1) { animation-delay:.08s; }
.route-live .route-stop:nth-child(2) { animation-delay:.2s; }
.route-live .route-stop:nth-child(3) { animation-delay:.32s; }
.route-live .route-stop:nth-child(4) { animation-delay:.44s; }
.route-live .route-stop:nth-child(5) { animation-delay:.56s; }
.route-landscape {
  transition:background-image .45s ease;
}

/* 5. 回饋 */
.save.mo-pop,#save-count.mo-pop {
  animation:mo-pop .34s var(--mo-ease);
}
dialog[open] {
  animation:mo-dialog .3s var(--mo-ease);
}
dialog[open]::backdrop {
  animation:mo-fade .3s ease-out;
}
.results>* {
  animation:mo-rise .45s var(--mo-ease) backwards;
}
.results>*:nth-child(2) { animation-delay:.06s; }
.results>*:nth-child(3) { animation-delay:.12s; }

/* 減少動態：不位移、不模糊，只留短淡入讓狀態變化看得出來 */
@media (prefers-reduced-motion:reduce) {
  .hero-photo,.news-hero-photo,.ab-photo img,
  .hero h1,.news-hero h1,.ab-hero h1,.sm h1,
  .section-heading.mo-in h2 i,.route-live .route-stops:before,.save.mo-pop,#save-count.mo-pop {
    animation:none;
  }
  .hero .eyebrow,.hero h2,.hero-copy,.finder,.popular,.hero-note,
  .news-hero-lead,.news-hero-hint,.news-hero-inner form,.news-hero-note,
  .ab-lead,.ab-facts,.mo-in>*,.route-live .route-stop,dialog[open],.results>* {
    animation-name:mo-fade;
    animation-duration:.25s;
    animation-delay:0s;
  }
}

/* 列印時全部直接顯示 */
@media print {
  .mo-wait>*,.route-wait .route-stop { opacity:1; }
  .route-wait .route-stops:before { transform:none; }
  .section-heading.mo-wait h2 i { clip-path:none; }
}
