/* ─── TOKENS ───────────────────────────────────────── */
:root {
  --forest:  #3a5240;   /* やや明るい森 — 主テキスト */
  --washi:   #f5f2ea;   /* 和紙 — 背景（暖かみ） */
  --pond:    #5b8db8;   /* 青い池 — アクセント（少し明るく） */
  --wheat:   #c8a96e;   /* 麦畑 — サブアクセント */
  --fog:     #8a9e8c;   /* 霧 — ミュートテキスト */
  --rule:    #e0dbd0;   /* 罫線（やや明るく） */
  --white:   #ffffff;

  --f-serif: "Shippori Mincho B1", "Hiragino Mincho ProN", serif;
  --f-sans:  "Noto Sans JP", "Hiragino Sans", sans-serif;

  --nav-h: 58px;
  --hdr-h: 52px;
  --radius: 10px;   /* 共通角丸 */
}

/* ─── RESET ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--f-sans);
  font-weight: 400;
  color: var(--forest);
  background: var(--washi);
  -webkit-font-smoothing: antialiased;
}

/* ─── LAYOUT ─────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100%; }
#pages { flex: 1; position: relative; overflow: hidden; }
.page {
  position: absolute; inset: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  opacity: 0; pointer-events: none;
  transition: opacity .28s ease;
}
.page.active { opacity: 1; pointer-events: all; }

/* ─── HEADER ─────────────────────────────────────────── */
#hdr {
  flex: none;
  height: var(--hdr-h);
  /* 青い池グラデーション：穏やかなスカイブルー系 */
  background: linear-gradient(105deg, #2a6090 0%, #3d8ab5 40%, #4fa8c8 70%, #2e7e9e 100%);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
/* 水面の光彩レイヤー */
#hdr::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 40% 120%, rgba(100,210,230,.18) 0%, transparent 70%);
  pointer-events: none;
}
#hdr .site-name {
  font-family: var(--f-serif);
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  letter-spacing: .12em;
  position: relative;
}
#hdr .site-sub {
  font-size: 10px;
  color: rgba(255,255,255,.65);
  font-weight: 400;
  letter-spacing: .16em;
  margin-left: 2px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.25);
  position: relative;
}
#hdr .hdr-right {
  margin-left: auto;
  font-size: 10px;
  color: rgba(255,255,255,.55);
  letter-spacing: .1em;
  position: relative;
}

#hdr #langSel {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  letter-spacing: .05em;
  backdrop-filter: blur(4px);
  cursor: pointer;
}

#hdr #langSel option {
  color: #000; /* プルダウン展開時は白背景なので黒文字 */
}

/* ─── NAV ────────────────────────────────────────────── */
#nav {
  flex: none;
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  border: none; background: none; cursor: pointer;
  font-family: var(--f-sans); font-size: 10px; font-weight: 500;
  color: var(--fog);
  letter-spacing: .06em;
  transition: color .2s;
  position: relative;
  padding: 0;
}
.nav-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
.nav-btn.active { color: var(--forest); }
.nav-btn::after {
  content: "";
  position: absolute; top: 0; left: 25%; right: 25%; height: 1.5px;
  background: var(--pond);
  transform: scaleX(0);
  transition: transform .22s ease;
}
.nav-btn.active::after { transform: scaleX(1); }

/* ─── PAGE 1: HOME ───────────────────────────────────── */
.p-home { background: var(--washi); }

/* — Hero — */
.home-hero {
  height: clamp(200px, 48vw, 310px);
  position: relative;
  overflow: hidden;
  display: flex; align-items: flex-end;
  background: #4a7c8a; /* 画像がない間の仮背景 */
}
/* 画像プレースホルダー（画像が入ったら img タグに差し替え） */
.hero-img-placeholder {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #5e9db5 0%, #3a7a92 40%, #2a5e72 100%);
  display: flex; align-items: center; justify-content: center;
}
.hero-img-placeholder span {
  font-size: 12px; letter-spacing: .2em;
  color: rgba(255,255,255,.4); font-weight: 400;
}
/* 画像を入れる場合は .hero-img-placeholder を削除して代わりに:
   <img src="your-image.jpg" style="position:absolute;inset:0;width:100%;height:100%;object-fit:cover;"> */

/* 丘のシルエット（画像の上に重ねる） */
.hero-horizon {
  position: absolute; bottom: 0; left: 0; right: 0;
  z-index: 2;
}
.home-hero-text {
  position: relative; z-index: 4;
  padding: 0 24px 28px;
}
.home-hero-kanji {
  font-family: var(--f-serif);
  font-weight: 800;
  font-size: clamp(52px, 13vw, 80px);
  color: rgba(255,255,255,.1);
  line-height: 1;
  position: absolute;
  right: 20px; bottom: 20px;
  letter-spacing: -.02em;
  pointer-events: none;
  z-index: 3;
}
.home-hero-title {
  font-family: var(--f-serif);
  font-weight: 800;
  font-size: clamp(20px, 5vw, 30px);
  color: #fff;
  letter-spacing: .08em;
  line-height: 1.3;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.home-hero-en {
  font-size: 10px;
  color: rgba(255,255,255,.65);
  letter-spacing: .22em;
  margin-top: 6px;
  font-weight: 400;
}

/* — Section wrapper — */
.home-body { padding: 0 20px; }

/* — 3機能リスト ＋ アクションボックス — */
.features { margin-top: 4px; }
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}
.feature-row:first-child { padding-top: 22px; }
.feature-left {}
.feature-name {
  font-family: var(--f-serif);
  font-weight: 600; font-size: 14px;
  letter-spacing: .06em;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.feature-name::before {
  content: "○";
  font-size: 12px;
  color: var(--pond);
  font-family: var(--f-serif);
}
.feature-desc {
  font-size: 12px; color: var(--fog);
  line-height: 1.7; font-weight: 400;
}

/* アクションボックス（右カラム） */
.action-box {
  border: 1.5px solid var(--rule);
  padding: 12px 14px;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease;
  text-align: center;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(44,62,45,.06);
}
.action-box:hover { background: #faf8f4; box-shadow: 0 4px 14px rgba(44,62,45,.10); }
.action-box.clickable { border-color: #c8d8c4; cursor: pointer; }
.action-box.clickable:hover { background: rgba(74,127,165,.06); border-color: var(--pond); }
.action-text {
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: clamp(11px, 2.8vw, 14px);
  line-height: 1.5;
  color: var(--forest);
  letter-spacing: .03em;
}
.action-text.em {
  font-size: clamp(11px, 2.8vw, 14px);
  font-weight: 800;
}
.action-text .pond { color: var(--pond); }

/* ─── PAGE 2: INFO ───────────────────────────────────── */
.p-info { background: var(--washi); }

.info-eyebrow {
  padding: 28px 20px 0;
  font-size: 10px; letter-spacing: .22em; color: var(--fog);
  font-weight: 400;
}
.info-title {
  padding: 8px 20px 0;
  font-family: var(--f-serif);
  font-weight: 800;
  font-size: clamp(22px, 5.5vw, 30px);
  letter-spacing: .06em;
  line-height: 1.3;
  color: var(--forest);
}
.info-rule {
  height: 1px; background: var(--forest);
  margin: 16px 20px 0;
}

.info-section { padding: 0 20px; }
.info-section-title {
  font-family: var(--f-serif);
  font-weight: 600; font-size: 14px;
  letter-spacing: .08em;
  padding: 20px 0 10px;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 8px;
}
.info-section-title svg { width: 16px; height: 16px; stroke: var(--pond); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.ph-block { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.ph-line {
  height: 11px; background: var(--rule); border-radius: 3px;
  margin-bottom: 9px;
  opacity: .7;
}

.tag-set { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0 4px; border-bottom: 1px solid var(--rule); }
.tag {
  font-size: 10px; font-weight: 400; letter-spacing: .1em;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  color: var(--fog);
  border-radius: 2px;
}
.tag.pond  { border-color: var(--pond);  color: var(--pond); }
.tag.wheat { border-color: var(--wheat); color: var(--wheat); }

/* ─── PAGE 2: 渋滞回避ナビ ───────────────────────────── */
.p-navi { background: var(--washi); }

/* ブレッドクラム */
.navi-breadcrumb {
  padding: 14px 20px 0;
  font-size: 11px; color: var(--fog); letter-spacing: .06em;
  display: flex; align-items: center; gap: 6px;
}
.navi-breadcrumb .bc-sep { color: var(--rule); }
.navi-breadcrumb .bc-current { color: var(--forest); font-weight: 500; }

/* 2カラムグリッド */
.navi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 16px 16px 0;
  column-gap: 12px;
  align-items: start;
}
.navi-col-head {
  font-family: var(--f-serif);
  font-weight: 800;
  font-size: clamp(16px, 4vw, 22px);
  letter-spacing: .04em;
  color: var(--forest);
  padding-bottom: 10px;
  text-align: center;
}

/* ステータスボックス */
.navi-status-box {
  border: 1.5px solid var(--rule);
  padding: 18px 12px;
  text-align: center;
  margin-bottom: 10px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(44,62,45,.05);
}
.navi-status-text {
  font-family: var(--f-serif);
  font-weight: 800;
  font-size: clamp(13px, 3.5vw, 17px);
  letter-spacing: .04em;
}
.status-congested  { color: #c0392b; border-color: #c0392b; }
.status-moderate   { color: #b8860b; border-color: #d4a017; }
.status-free       { color: #4a7c59; border-color: #4a7c59; }

/* ライブ映像ボックス */
.navi-live-box {
  border: 1.5px solid var(--rule);
  min-height: unset;
  height: auto;
  display: block;
  margin-bottom: 10px;
  background: #f8f6f0;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  align-self: start;
}
.navi-live-box img {
  width: 100%;
  height: auto;
  display: block;
}
.navi-live-box::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #e8eef2 0%, #d8e4ea 100%);
  display: none;
}
.navi-live-label {
  position: relative; z-index: 1;
  font-size: 12px; font-weight: 500; color: var(--fog);
  letter-spacing: .1em;
  display: flex; align-items: center; gap: 6px;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #c0392b;
  animation: liveblink 1.4s ease-in-out infinite;
}
@keyframes liveblink { 0%,100%{opacity:1;} 50%{opacity:.2;} }

/* 地図（全幅） */
.navi-map-section { padding: 0 16px 20px; }
.navi-map-box {
  border: 1.5px solid var(--rule);
  min-height: clamp(120px, 28vw, 200px);
  display: block;
  background: linear-gradient(160deg, #d8e8ec 0%, #c8dce4 100%);
  position: relative; overflow: hidden;
  border-radius: var(--radius);
}
.navi-map-box::after {
  content: "";
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23a8c4cc' stroke-width='.5'%3E%3Cpath d='M0 20h40M20 0v40'/%3E%3C/g%3E%3C/svg%3E");
  opacity: .4;
}
.navi-map-label {
  position: relative; z-index: 1;
  font-size: 12px; font-weight: 500; color: #5a7e8c; letter-spacing: .14em;
}

/* ─── PAGE 5: 混雑予想カレンダー ─────────────────────── */
.p-calendar { background: var(--washi); }

.cal-header {
  padding: 12px 16px 8px;
  display: flex; align-items: center;
}
.cal-month {
  font-size: 13px; color: var(--fog); letter-spacing: .1em;
  flex: 1;
  font-family: var(--f-serif);
}.cal-nav button {
  width: 34px; height: 34px;
  border: 1px solid var(--rule);
  background: var(--white);
  cursor: pointer;
  font-size: 14px; color: var(--forest);
  display: grid; place-items: center;
  transition: background .15s;
  border-radius: 8px;
}
.cal-nav button:first-child { border-radius: 8px 0 0 8px; }
.cal-nav button:last-child  { border-radius: 0 8px 8px 0; border-left: none; }
.cal-nav button:hover { background: var(--washi); }

.cal-nav {
  display: flex; gap: 1px;
}
.cal-note {
  padding: 10px 16px 20px;
  font-size: 11px;
  color: var(--fog);
  line-height: 1.6;
  letter-spacing: .02em;
}

/* テーブルラッパー（横スクロール） */
.cal-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 0 16px 20px;
}
.cal-table {
  border-collapse: collapse;
  min-width: 700px;
  width: 100%;
}
.cal-table th {
  font-size: 11px; font-weight: 500;
  color: var(--fog); letter-spacing: .06em;
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid var(--forest);
  white-space: nowrap;
  font-family: var(--f-sans);
}
.cal-table th.col-date { text-align: left; min-width: 72px; }
.cal-table td {
  padding: 8px 3px;
  border-bottom: 1px solid var(--rule);
  text-align: center;
  font-size: 11px;
  min-width: 42px;
}
.cal-table td.date-cell {
  text-align: left;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  padding-right: 8px;
  color: var(--forest);
  font-family: var(--f-serif);
}
.cal-table tr:nth-child(even) td { background: #f7f5ee; }
/* 混雑度セル */
.c-free     { color: #4a7c59; font-size: 11px; font-weight: 500; }
.c-moderate { color: #b8860b; font-size: 11px; font-weight: 500; }
.c-busy     { color: #c0392b; font-size: 11px; font-weight: 500; }
.c-empty    { color: transparent; user-select: none; }

/* ─── PAGE 3: MAP ────────────────────────────────────── */
.p-map { overflow: hidden; padding: 0; }
#map-frame { width: 100%; height: 100%; border: none; display: block; }

/* ─── PAGE 4: MORE ───────────────────────────────────── */
.p-more { background: var(--washi); }

.more-eyebrow {
  padding: 28px 20px 0;
  font-size: 10px; letter-spacing: .22em; color: var(--fog);
}
.more-title {
  padding: 8px 20px 0;
  font-family: var(--f-serif);
  font-weight: 800;
  font-size: clamp(22px, 5.5vw, 30px);
  letter-spacing: .06em;
  color: var(--forest);
}
.more-rule { height: 1px; background: var(--forest); margin: 16px 20px 0; }

.more-group { padding: 0 20px; margin-top: 4px; }
.more-group-label {
  font-size: 10px; letter-spacing: .2em; color: var(--fog);
  padding: 18px 0 8px;
  border-bottom: 1px solid var(--rule);
}
.more-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  border-radius: 8px;
  transition: background .2s ease;
}
.more-row:hover { background: rgba(90,140,100,.06); }
.more-row svg { width: 17px; height: 17px; stroke: var(--fog); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; transition: stroke .2s; }
.more-row:hover svg { stroke: var(--pond); }
.more-row-title { font-size: 13px; font-weight: 500; flex: 1; }
.more-row-sub   { font-size: 11px; color: var(--fog); }
.more-row-arrow { font-size: 14px; color: var(--rule); }

.ver { text-align: center; padding: 32px 0 16px; font-size: 10px; color: var(--rule); letter-spacing: .14em; }

/* アンケートボタン */
.survey-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 20px;
  background: linear-gradient(105deg, #3d8ab5 0%, #4fa8c8 100%);
  color: #fff;
  font-family: var(--f-sans);
  font-size: 15px; font-weight: 700;
  letter-spacing: .06em;
  border: none; border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(74,127,165,.30);
  transition: filter .2s ease, box-shadow .2s ease;
}
.survey-btn:hover { filter: brightness(1.06); box-shadow: 0 6px 20px rgba(74,127,165,.42); }
.survey-btn:active { filter: brightness(.96); }
  .p-navi .more-eyebrow,
  .p-navi .more-title,
  .p-navi .more-rule {
    flex: none;
  }
  .navi-grid {
    flex: none;
  }
  .navi-map-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 12px;
    min-height: 0;
  }
  .navi-map-box {
    flex: 1;
    min-height: 0;
  }
}