/*
  台湾 旅のしおり — デザイン方針
  ・スマホで見るのが前提（PC は編集時に確認するくらい）。
    中身は最大 480px 幅の1カラムで、PC でもスマホと同じ見た目を中央に置く
  ・移動は画面下のナビ（親指が届く位置）。日程タブはスクロールしても上に貼りつく
  ・色は台湾の街の色を「やわらかく」したもの：
    珊瑚色（提灯・廟の朱をパステル寄りに）、淡い金、翡翠の緑、生成りの紙
    強い赤の面は使わず、塗るのはヒーローとアクセントだけ
  ・セクションは「紙」と「うすい翡翠（.sec-tint）」を交互に
  ・見出しに添える漢字（.sec-zh）は繁体字。区切りの帯（.fret）は回紋
*/

:root {
  --coral: #c4604b;
  --coral-2: #d47b66;
  --coral-deep: #8f3e2e;
  --coral-soft: #f4d9ce;
  --gold: #d0a24a;
  --gold-soft: #f5e0ac;
  --jade: #3d7c6e;
  --jade-deep: #2a5c52;
  --jade-soft: #d8e8e1;
  --paper: #faf3e6;
  --card: #ffffff;
  --ink: #33261f;
  --ink-soft: #6e5a4e;
  --line: #e6d6bd;
  --fill: #c8701f;
  --nav-h: 62px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 12px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a { color: inherit; }
h1, h2, h3, h4 { font-family: "Zen Old Mincho", serif; line-height: 1.35; margin: 0; }
.wrap { max-width: 480px; margin: 0 auto; padding: 0 16px; }

/* まだ決まっていない箇所（金谷城のしおりと同じ約束） */
.fill {
  color: var(--fill);
  font-style: italic;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.small { font-size: .75em; font-weight: 400; }

/* ---------- 回紋の帯 ---------- */
.fret {
  height: 14px;
  background-color: var(--gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 36 18'%3E%3Cpath d='M0 15 H15 V3 H3 V11 H11 V7 H7' fill='none' stroke='%238f3e2e' stroke-width='2'/%3E%3Cpath d='M18 15 H33 V3 H21 V11 H29 V7 H25' fill='none' stroke='%238f3e2e' stroke-width='2'/%3E%3C/svg%3E");
  background-size: 28px 14px;
  background-repeat: repeat-x;
}

/* ---------- ヒーロー ----------
   地は朱色（ページで唯一しっかり赤を使う場所）。写真は全面に敷かず、
   中華庭園の「円窓（まるまど）」に見立てた金縁の丸窓の中に入れる */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  color: #fff6e6;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(245,224,172,.22), transparent 55%),
    linear-gradient(180deg, #c0503e 0%, #a63c2f 100%);
}
.hero::before { /* うっすら格子窓 */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(245,224,172,.09) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgba(245,224,172,.09) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  pointer-events: none;
}
.hero-inner { position: relative; padding: 36px 16px 30px; }
.hero-kicker { margin: 0 0 14px; letter-spacing: .5em; font-family: "Zen Old Mincho", serif; font-size: 13px; color: var(--gold-soft); }

.moon-gate {
  width: min(64vw, 250px); aspect-ratio: 1;
  margin: 0 auto 20px;
  border-radius: 50%;
  padding: 6px;
  background: var(--gold);
  box-shadow: 0 0 0 3px #a63c2f, 0 0 0 5px var(--gold-soft), 0 10px 30px rgba(60,20,12,.35);
}
.moon-gate img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

.hero-title {
  font-size: clamp(32px, 9.5vw, 42px);
  font-weight: 900;
  letter-spacing: .06em;
  text-shadow: 0 2px 0 rgba(110,30,20,.5);
}
.hero-dates {
  margin: 10px 0 2px;
  font-family: "Zen Old Mincho", serif;
  font-size: 26px; font-weight: 700;
  color: var(--gold-soft);
}
.hero-dates small { font-size: .5em; margin-left: 2px; vertical-align: .3em; }
.hero-dates .dash { margin: 0 .4em; opacity: .7; }
.hero-place { margin: 0; letter-spacing: .2em; font-size: 14px; }

.lanterns { position: absolute; inset: 0 0 auto; height: 130px; pointer-events: none; }
.lantern { position: absolute; top: -6px; width: 40px; transform-origin: 50% 0; animation: sway 4.5s ease-in-out infinite; }
.l1 { left: 7%; animation-delay: -1s; }
.l2 { right: 7%; animation-delay: -3s; }
@keyframes sway { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .lantern { animation: none; } html { scroll-behavior: auto; } }

/* ---------- セクション共通 ---------- */
.sec { padding: 40px 0 44px; }
.sec-tint { background: var(--jade-soft); }
.sec-title {
  font-size: 24px; font-weight: 900;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.sec-zh {
  flex: none;
  writing-mode: vertical-rl;
  font-size: 12px; letter-spacing: .15em;
  padding: 6px 3px;
  border-radius: 4px;
  background: var(--coral);
  color: #fffaf2;
}
.sec-tint .sec-zh { background: var(--jade); }
.sec-note { color: var(--ink-soft); font-size: 14px; }
.sub {
  font-size: 17px;
  margin: 28px 0 10px;
  padding-left: 10px;
  border-left: 4px solid var(--coral-2);
}
.card { background: var(--card); border-radius: 14px; padding: 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(59,47,41,.08); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  border-radius: 999px;
  background: var(--coral); color: #fff;
  text-decoration: none; font-weight: 700; font-size: 15px;
}
.btn-line { background: transparent; color: var(--coral-deep); border: 1.5px solid var(--coral-2); }
.btn-block { display: flex; width: 100%; margin-top: 12px; }

.callout {
  background: var(--gold-soft);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin: 8px 0 0;
}

/* ---------- 日程 ---------- */
.day-tabs {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  max-width: 480px; margin: 12px auto 0;
  padding: 8px 16px;
  background: rgba(252,248,241,.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.day-tabs button {
  font: inherit; color: var(--ink);
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  min-height: 52px; padding: 4px 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.25; cursor: pointer;
}
.day-tabs b { font-family: "Zen Old Mincho", serif; font-size: 15px; }
.day-tabs span { font-size: 11px; color: var(--ink-soft); }
.day-tabs button[aria-selected="true"] { background: var(--coral); border-color: var(--coral); color: #fff; }
.day-tabs button[aria-selected="true"] span { color: #fff; opacity: .9; }

.day { margin-top: 12px; background: var(--card); border-radius: 16px; padding: 18px 16px 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(59,47,41,.08); }
.day + .day { margin-top: 20px; }
.day-cover { display: block; width: calc(100% + 32px); margin: -18px -16px 14px; aspect-ratio: 800 / 340; object-fit: cover; border-radius: 16px 16px 0 0; } /* JS が無いとき全日が並ぶ */
.day-head { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.day-num {
  flex: none;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-content: center;
  background: var(--coral-soft); color: var(--coral-deep);
  font-family: "Zen Old Mincho", serif; font-size: 22px; font-weight: 900;
}
.day-head h3 { font-size: 20px; }
.day-wx { margin: 0; font-size: 13px; color: var(--ink-soft); }
.day-empty { margin: 12px 0 14px; padding: 18px; text-align: center; color: var(--ink-soft); background: var(--paper); border-radius: 10px; font-size: 14px; }
.day-empty a { display: block; margin-top: 6px; color: var(--coral-deep); font-weight: 700; text-decoration: none; }

.bus-list { display: grid; gap: 8px; }
.bus { border-radius: 10px; padding: 10px 12px; background: var(--paper); }
.bus-who { margin: 0 0 2px; font-weight: 700; color: var(--coral-deep); font-size: 14px; }
.bus-route { margin: 0; font-size: 15px; display: flex; gap: 10px; }
.bus-route b { flex: none; font-variant-numeric: tabular-nums; }
.bus-note { margin: 4px 0 0; font-size: 12px; color: var(--ink-soft); }

.timeline { list-style: none; padding: 0; margin: 20px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 71px; top: 8px; bottom: 20px; width: 2px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 60px 1fr; gap: 24px; padding: 0 0 18px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: 66px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--coral-2);
}
.timeline time { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; font-size: 15px; line-height: 1.5; }
.timeline time small { display: block; font-size: 10px; color: var(--ink-soft); font-weight: 400; }
.timeline b { display: block; line-height: 1.5; }
.timeline p { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); }
.timeline .tl-flight::before { background: var(--jade); border-color: var(--jade); }
.timeline .tl-main::before { background: var(--gold); border-color: var(--coral); width: 16px; height: 16px; left: 64px; top: 5px; }
.timeline .tl-main b { color: var(--coral-deep); }
.timeline .tl-sub::before { border-style: dashed; border-color: var(--jade); }
.timeline .tl-sub b { color: var(--jade-deep); }

/* ---------- 行きたい場所（横スワイプのカード） ---------- */
.btn-list { margin: 4px 0 14px; background: var(--jade); }
.btn-list::before { content: "📍"; margin-right: 6px; }
.spots {
  display: flex; gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  padding: 4px 16px 12px;
  max-width: 480px; margin: 0 auto;
  scrollbar-width: none;
}
.spots::-webkit-scrollbar { display: none; }
.spot {
  flex: none; width: 62%;
  scroll-snap-align: start;
  background: var(--card); border-radius: 14px; overflow: hidden;
  text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 3px rgba(51,38,31,.12);
  display: flex; flex-direction: column;
}
.spot-photo { position: relative; display: block; }
.spot img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.spot-genre {
  position: absolute; left: 8px; top: 8px;
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,.92); color: var(--coral-deep);
}
.spot-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.spot-body b { font-family: "Zen Old Mincho", serif; font-size: 18px; line-height: 1.3; }
.spot-desc { font-size: 13px; line-height: 1.5; margin-top: 2px; }

/* ---------- 天気 ---------- */
.wx-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.wx-card {
  font: inherit; color: var(--ink);
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 10px 2px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(59,47,41,.08);
}
.wx-card[aria-expanded="true"] { border-color: var(--jade); }
.wx-card b { font-size: 14px; }
.wx-i { font-size: 28px; line-height: 1.3; }
.wx-t { font-size: 12px; color: var(--ink-soft); }
.wx-t em { font-style: normal; color: var(--coral-deep); font-weight: 700; font-size: 16px; }
.wx-p { font-size: 11px; color: var(--jade-deep); }
.wx-p::before { content: "☂ "; }
.wx-hint { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--ink-soft); }

.wx-detail { margin-top: 10px; background: var(--card); border-radius: 14px; padding: 10px 0 10px; box-shadow: 0 1px 3px rgba(59,47,41,.08); }
.wx-sum { padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.wx-sum .big { font-size: 32px; line-height: 1; }
.wx-sum p { margin: 0; }
.wx-sum .name { font-weight: 700; font-size: 17px; }
.wx-sum .range { font-size: 13px; color: var(--ink-soft); }

.wx-hours {
  display: flex; gap: 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 6px 12px 4px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
}
.wx-h {
  flex: none; width: 52px;
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 12px; padding: 6px 0; border-radius: 10px;
}
.wx-h.now { background: var(--jade-soft); }
.wx-h .h { color: var(--ink-soft); }
.wx-h .i { font-size: 22px; line-height: 1.3; }
.wx-h .t { font-weight: 700; font-size: 15px; }
.wx-h .p { color: var(--jade-deep); font-size: 11px; min-height: 1.4em; }

.wx-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 12px 0; }
.wx-facts div { background: var(--paper); border-radius: 8px; padding: 4px 2px; text-align: center; }
.wx-facts dt { font-size: 10px; color: var(--ink-soft); }
.wx-facts dd { margin: 0; font-weight: 700; font-size: 13px; line-height: 1.3; }
.wx-facts dd small { display: block; font-size: 12px; }
.wx-status { margin: 10px 0 0; font-size: 11px; color: var(--ink-soft); text-align: right; }

/* ---------- 飛行機 ---------- */
.ticket {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 16px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(59,47,41,.08);
  border-left: 6px solid var(--jade);
}
.ticket-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); }
.ticket-top b { font-size: 16px; color: var(--jade-deep); }
.ticket-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-top: 4px; }
.ticket-route > div { display: flex; flex-direction: column; line-height: 1.25; }
.ticket-route > div:last-child { text-align: right; }
.ticket-route b { font-size: 28px; font-variant-numeric: tabular-nums; }
.ticket-route span { font-weight: 700; color: var(--coral); letter-spacing: .05em; font-size: 13px; }
.ticket-route small { font-size: 11px; color: var(--ink-soft); }
.ticket-plane { text-align: center; color: var(--jade); font-size: 18px; }
.ticket-plane small { display: block; font-size: 10px; }

.seat-map { margin-bottom: 14px; }
.seat-map p { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.seat-map p small { font-weight: 400; color: var(--ink-soft); margin-left: 8px; font-size: 12px; }
.seat-map table { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.seat-map th { font-weight: 400; font-size: 12px; color: var(--ink-soft); }
.seat-map tbody th { width: 26px; }
.seat-map td {
  background: var(--card);
  border-radius: 8px 8px 4px 4px;
  text-align: center; font-size: 13px; padding: 9px 0;
  border-top: 4px solid var(--jade);
  box-shadow: 0 1px 2px rgba(59,47,41,.08);
}
.seat-map td.empty { background: transparent; border: 1.5px dashed var(--line); box-shadow: none; }

.baggage { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.baggage li { background: var(--card); border-radius: 10px; padding: 8px 12px; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; }
.baggage b { font-size: 14px; color: var(--jade-deep); }
.baggage span { text-align: right; font-weight: 700; }
.baggage small { grid-column: 1 / -1; color: var(--ink-soft); font-size: 12px; }

.sub-flight { margin-top: 20px; padding: 10px 14px; border: 1.5px dashed var(--jade); border-radius: 12px; font-size: 14px; }
.sub-flight p { margin: 2px 0; }
.sub-flight b { display: inline-block; width: 3.4em; color: var(--jade-deep); }
.sub-flight-who { font-weight: 700; }

/* ---------- ホテル ---------- */
.hotel-photo { display: block; width: calc(100% + 32px); margin: -16px -16px 14px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px 14px 0 0; }
.hotel-name { margin: 0; font-family: "Zen Old Mincho", serif; font-size: 28px; font-weight: 900; color: var(--coral-deep); letter-spacing: .08em; }
.hotel-addr { margin: 2px 0 0; font-size: 15px; }
.hotel-access { margin: 2px 0 0; font-size: 13px; color: var(--jade-deep); font-weight: 700; }
.hotel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.facts div { background: var(--paper); border-radius: 10px; padding: 6px 10px; }
.facts dt { font-size: 11px; color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 700; font-size: 14px; }

/* ---------- 入国 ---------- */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 16px 0 8px; display: grid; gap: 8px; }
.steps li {
  counter-increment: s;
  position: relative;
  padding: 10px 12px 10px 50px;
  background: var(--card);
  border-radius: 12px;
  font-size: 14px; color: var(--ink-soft);
  box-shadow: 0 1px 3px rgba(59,47,41,.08);
}
.steps li b { display: block; color: var(--ink); font-size: 15px; }
.steps li::before {
  content: counter(s);
  position: absolute; left: 12px; top: 12px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--coral-soft); color: var(--coral-deep);
  display: grid; place-content: center;
  font-weight: 900; font-family: "Zen Old Mincho", serif;
}
.steps a { color: var(--jade-deep); font-weight: 700; word-break: break-all; }

/* 折りたたみ（タップで手順が開く） */
.fold { background: var(--card); border-radius: 14px; box-shadow: 0 1px 3px rgba(51,38,31,.1); }
.fold summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px 14px;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "＋"; margin-left: auto; color: var(--coral); font-weight: 700; font-size: 18px; }
.fold[open] summary::after { content: "－"; }
.fold-no { font-family: "Zen Old Mincho", serif; font-size: 26px; color: var(--coral); line-height: 1; }
.fold-title { font-weight: 700; line-height: 1.4; }
.fold-title small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-soft); }
.fold .steps { margin: 0; padding: 0 12px; }
.fold .steps li { box-shadow: none; background: var(--paper); }
.fold .btn-block { margin: 10px 12px 12px; width: auto; }

/* 空港での流れ（縦につながる番号） */
.flow { counter-reset: f; list-style: none; padding: 0; margin: 0; position: relative; }
.flow::before { content: ""; position: absolute; left: 15px; top: 16px; bottom: 24px; width: 2px; background: var(--coral-soft); }
.flow li { counter-increment: f; position: relative; padding: 2px 0 14px 46px; }
.flow li::before {
  content: counter(f);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--coral); color: #fff;
  display: grid; place-content: center;
  font-weight: 900; font-family: "Zen Old Mincho", serif;
}
.flow b { color: var(--ink); }
.flow > li > b { display: block; font-size: 16px; line-height: 1.6; }
.flow p { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); }

/* ---------- 持ち物 ---------- */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checklist label {
  display: flex; align-items: center; gap: 12px;
  min-height: 50px;
  background: var(--card); border-radius: 12px; padding: 8px 14px;
  cursor: pointer;
}
.checklist input { flex: none; width: 24px; height: 24px; accent-color: var(--jade); margin: 0; }
.checklist input:checked + span { color: var(--ink-soft); text-decoration: line-through; }

/* ---------- フッター ---------- */
.foot { text-align: center; padding: 28px 0 24px; color: var(--ink-soft); }
.foot p { margin: 0; font-family: "Zen Old Mincho", serif; font-size: 18px; letter-spacing: .3em; color: var(--coral-deep); }
.foot small { font-size: 12px; display: block; }
.foot .credit { font-size: 11px; margin-top: 4px; }

/* ---------- 下のナビ ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(7, 1fr);
  max-width: 480px; margin: 0 auto;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 10px rgba(59,47,41,.06);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; font-size: 10px; color: var(--ink-soft); gap: 1px;
}
.bottom-nav a span { font-size: 20px; line-height: 1.2; }
.bottom-nav a.on { color: var(--coral-deep); font-weight: 700; }
@media (min-width: 481px) { .bottom-nav { border-radius: 16px 16px 0 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
