/* ============================================================
   市川帖 ICHIKAWA — ハブポータル専用スタイル
   ひまわりイラスト（townflower.JPG）に合わせた固定カラーテーマ
   クラフト紙の茶・ひまわりの黄・茎葉の緑・輪郭の濃茶
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== ひまわりカラーパレット（固定） ===== */
:root {
  --base:       #f5e8c0;          /* 羊皮紙・明るいクラフト紙 */
  --base-warm:  #faf2dc;          /* より明るい羊皮紙 */
  --base-deep:  #e8d49a;          /* 深みのある黄土色 */
  --text:       #3d2008;          /* 濃茶（イラストの輪郭色） */
  --text-strong:#2a1405;          /* 最も濃い茶（見出し） */
  --text-muted: #8a6030;          /* 中間の温かい茶（補助テキスト） */
  --accent-1:   #e8c050;          /* ひまわりの花びら */
  --accent-2:   #a8c868;          /* 葉っぱの緑 */
  --gold:       #b87008;          /* 琥珀・インタラクティブ要素 */
  --hairline:   rgba(61,32,8,0.18); /* 温かい濃茶の罫線 */
  --nav-bg:     rgba(245,232,192,0.88); /* 羊皮紙半透明ナビ */
}

/* ===== エリアバッジ色 ===== */
:root {
  --area-amaji:  #A87A4F;
  --area-kawabe: #6BBCEB;
  --area-seka:   #74B96E;
  --area-tsurui: #F5D547;
}

/* ===== 12ヶ月ベース色連動 =====
   各帖の12ヶ月カラーシステムからベース色（背景・文字・罫線）だけ流用して連動。
   アクセント（ひまわりの黄・葉の緑・琥珀）とエリアバッジは町花テーマのまま固定。
   12月は黒基調のため文字色もセットで連動（固定だと読めなくなる）。
   月クラスは <head> のインラインスクリプトが html に付与（JS無効時は上の固定色）。 */
:root.month-01 { --base:#f8f8f9; --base-warm:#fafafa; --base-deep:#ededef; --text:#303038; --text-strong:#1c1c24; --text-muted:#70707a; --hairline:rgba(28,28,36,0.12); --nav-bg:rgba(248,248,249,0.88); }
:root.month-02 { --base:#e4e4e8; --base-warm:#eaeaee; --base-deep:#d4d4d8; --text:#38383f; --text-strong:#242430; --text-muted:#68687a; --hairline:rgba(24,24,40,0.14); --nav-bg:rgba(228,228,232,0.88); }
:root.month-03 { --base:#f5eef5; --base-warm:#f8f2f8; --base-deep:#e8d8ec; --text:#503058; --text-strong:#401848; --text-muted:#8a6090; --hairline:rgba(64,24,72,0.13); --nav-bg:rgba(245,238,245,0.88); }
:root.month-04 { --base:#f5d8e0; --base-warm:#f8e0e8; --base-deep:#ecc8d4; --text:#5a1830; --text-strong:#6a1038; --text-muted:#9a5870; --hairline:rgba(106,16,56,0.14); --nav-bg:rgba(245,216,224,0.88); }
:root.month-05 { --base:#f0f8ee; --base-warm:#f5faf3; --base-deep:#ddf0de; --text:#2a4830; --text-strong:#1a3820; --text-muted:#607060; --hairline:rgba(26,56,32,0.11); --nav-bg:rgba(240,248,238,0.88); }
:root.month-06 { --base:#c4e8bc; --base-warm:#d0edc8; --base-deep:#a8d8a0; --text:#1a3818; --text-strong:#0c2810; --text-muted:#406840; --hairline:rgba(12,40,16,0.16); --nav-bg:rgba(196,232,188,0.88); }
:root.month-07 { --base:#e0f4fa; --base-warm:#e8f7fc; --base-deep:#c4e8f4; --text:#1a3848; --text-strong:#0a2838; --text-muted:#4a7080; --hairline:rgba(10,40,56,0.13); --nav-bg:rgba(224,244,250,0.88); }
:root.month-08 { --base:#bcd4f0; --base-warm:#c8dcf4; --base-deep:#a0c0e8; --text:#142848; --text-strong:#081838; --text-muted:#3c5878; --hairline:rgba(8,24,56,0.16); --nav-bg:rgba(188,212,240,0.88); }
:root.month-09 { --base:#f8f6d8; --base-warm:#fafae0; --base-deep:#f0ecb8; --text:#3c3400; --text-strong:#302800; --text-muted:#787030; --hairline:rgba(48,40,0,0.14); --nav-bg:rgba(248,246,216,0.88); }
:root.month-10 { --base:#f5e0cc; --base-warm:#f9e8d4; --base-deep:#ecd0b4; --text:#601000; --text-strong:#500800; --text-muted:#9a5030; --hairline:rgba(80,8,0,0.13); --nav-bg:rgba(245,224,204,0.88); }
:root.month-11 { --base:#e8d4b8; --base-warm:#eedcc0; --base-deep:#d8c0a0; --text:#4c2408; --text-strong:#3c1800; --text-muted:#806040; --hairline:rgba(60,24,0,0.14); --nav-bg:rgba(232,212,184,0.88); }
:root.month-12 { --base:#1e1e22; --base-warm:#262628; --base-deep:#141416; --text:#c4c4cc; --text-strong:#f0f0f4; --text-muted:#7a7a88; --hairline:rgba(240,240,244,0.10); --nav-bg:rgba(30,30,34,0.85); }

/* ===== Base ===== */
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: "YakuHanMPs", "Shippori Mincho B1", "Noto Serif JP", serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--base);
  /* clip優先（hiddenだとbodyがスクロールコンテナ化し、カードのview()タイムラインが不活性になる） */
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  transition: background 0.6s ease, color 0.6s ease;
}

/* ===== イントロオーバーレイ（viewBoxアニメーション） ===== */
/* アニメーションはすべてJS側で制御。CSSはレイアウトのみ。 */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--base-warm); /* 月連動（12ヶ月ベース色） */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  pointer-events: none;
}
.intro-svg-wrap {
  width: min(88vw, 560px);
}
/* aspect-ratio を市川viewBox比率(89:70)で固定 → 兵庫フェーズは内側でletterbox */
.intro-svg-wrap svg {
  width: 100%;
  aspect-ratio: 89 / 70;
  display: block;
}
.intro-label {
  font-family: "YakuHanMPs", 'Shippori Mincho B1', serif;
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 500;
  color: var(--text-strong);
  letter-spacing: 0.35em;
  opacity: 0;
  text-align: center;
}
/* スキップ（右上・常に押せる） */
.intro-skip {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1001;
  font-family: "YakuHanMPs", 'Shippori Mincho B1', serif;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(58, 74, 64, 0.25);
  border-radius: 100px;
  padding: 9px 18px;
  cursor: pointer;
}
.intro-skip:hover { background: rgba(255, 255, 255, 0.95); }

/* ===== ようこそ案内 ===== */
.welcome {
  max-width: 660px;
  margin: 0 auto 40px;
  text-align: center;
  background: rgba(250, 242, 220, 0.85);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 26px 28px;
}
.welcome-title {
  font-family: "YakuHanMPs", "Shippori Mincho B1", serif;
  font-size: clamp(22px, 4.4vw, 30px);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-strong);
  margin-bottom: 12px;
}
.welcome-lead {
  font-size: 15px;
  line-height: 1.95;
  color: var(--text);
  letter-spacing: 0.04em;
}
@media (max-width: 640px) {
  .welcome { margin-bottom: 28px; padding: 20px 18px; }
  .welcome-lead { font-size: 14px; }
  .welcome-lead br { display: none; }
}

/* ===== ナビ（sticky） ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  min-height: 64px;
}
.nav-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand-name {
  font-family: "YakuHanMPs", "Shippori Mincho B1", serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--text-strong);
  line-height: 1;
}

/* ===== ナビ内エリアフィルター（4色タブ） ===== */
.nav-filters {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* チップの説明（初見の観光客向け：これが地区フィルタだと分かる一言） */
.nav-filters-hint {
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text);
  white-space: nowrap;
  margin-right: 6px;
}
.nav-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "YakuHanMPs", "Shippori Mincho B1", serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--hairline);
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.55);
  line-height: 1;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease,
              box-shadow 0.2s ease, transform 0.1s ease;
}
.nav-filter:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
}
.nav-filter:active { transform: translateY(0); }

/* エリアを示す色ドット（常に4色が見える） */
.nav-filter-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(61, 32, 8, 0.12);
}
.nav-filter[data-area="amaji"]  .nav-filter-dot { background: var(--area-amaji); }
.nav-filter[data-area="kawabe"] .nav-filter-dot { background: var(--area-kawabe); }
.nav-filter[data-area="seka"]   .nav-filter-dot { background: var(--area-seka); }
.nav-filter[data-area="tsurui"] .nav-filter-dot { background: var(--area-tsurui); }

/* 選択中：エリア色でやさしく塗り、枠も色づける（文字は濃茶で可読性維持） */
.nav-filter.is-active {
  color: var(--text-strong);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(61, 32, 8, 0.10);
}
.nav-filter.is-active[data-area="amaji"] {
  background: color-mix(in srgb, var(--area-amaji) 26%, #fff);
  border-color: color-mix(in srgb, var(--area-amaji) 60%, #fff);
}
.nav-filter.is-active[data-area="kawabe"] {
  background: color-mix(in srgb, var(--area-kawabe) 26%, #fff);
  border-color: color-mix(in srgb, var(--area-kawabe) 60%, #fff);
}
.nav-filter.is-active[data-area="seka"] {
  background: color-mix(in srgb, var(--area-seka) 30%, #fff);
  border-color: color-mix(in srgb, var(--area-seka) 62%, #fff);
}
.nav-filter.is-active[data-area="tsurui"] {
  background: color-mix(in srgb, var(--area-tsurui) 40%, #fff);
  border-color: color-mix(in srgb, var(--area-tsurui) 70%, #fff);
}


/* スマホ：ブランドを上、チップは小型化して1行に収める
   （旧仕様の「タブを大きく」は3段化してstickyナビが画面の4割を占領していたため廃止） */
@media (max-width: 640px) {
  .nav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 16px;
  }
  .nav-brand-name { font-size: 22px; }
  .nav-filters {
    justify-content: flex-start;
    gap: 6px;
  }
  .nav-filters-hint {
    flex: 0 0 100%;
    font-size: 11px;
    margin-right: 0;
  }
  .nav-filter {
    flex: 0 0 auto;
    justify-content: center;
    font-size: 13px;
    padding: 7px 12px;
    gap: 5px;
  }
  .nav-filter-dot { width: 9px; height: 9px; }
}

/* ===== メインコンテンツ ===== */
.main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.main-heading {
  font-size: 13px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ===== カードグリッド ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .main { padding: 28px 16px 60px; }
}

/* ===== カード共通 ===== */
.card {
  border-radius: 4px;
  overflow: hidden;
  background: transparent;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.card--active:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.card--pending {
  cursor: default;
}
/* フィルターで非表示にしたカードを確実に隠す（.card の display:flex を上書き） */
.card[hidden] { display: none !important; }

/* ===== カードのスクロール表示 =====
   viewportに入ったときに一度だけふわっと現れる（IntersectionObserverでクラス付与）。
   JS無効・動きを減らす設定(prefers-reduced-motion)では静的表示のまま。
   hover の transform と衝突しないよう translate/opacity のみ動かす。 */
@media (prefers-reduced-motion: no-preference) {
  .card.reveal-init {
    opacity: 0;
    translate: 0 24px;
  }
  .card.reveal-in {
    opacity: 1;
    translate: 0 0;
    /* transform/box-shadow は .card の hover 用トランジションを引き継ぐ */
    transition: opacity 0.6s ease, translate 0.6s ease, transform 0.2s, box-shadow 0.2s;
  }
}

/* ===== サムネイル（全カード共通） ===== */
.card-thumb {
  height: 180px;
  background: var(--base-deep);
  overflow: hidden;
  flex-shrink: 0;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 準備中：控えめに（公開中カードを主役にするため小さく淡く） */
.card--pending .card-thumb--pending {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed var(--hairline);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
}
.card--pending .card-body { padding: 8px 12px; }
.card--pending .card-body h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .card-thumb { height: 120px; }
}

/* ===== カードボディ ===== */
.card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* アクティブカード：一行レイアウト・白背景（3列グリッドで中央固定） */
.card--active .card-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
}
.card-tag {
  font-size: 12px;
  color: var(--text-strong);
  letter-spacing: 0.15em;
  line-height: 1;
  justify-self: start;
}
.card-place {
  font-family: "YakuHanMPs", "Shippori Mincho B1", serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-strong);
  line-height: 1;
  justify-self: center;
}
.card-body h2 {
  font-family: "YakuHanMPs", "Shippori Mincho B1", serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-strong);
  line-height: 1.3;
}

/* ===== エリアバッジ ===== */
.badge {
  display: inline-block;
  font-size: 11px;
  font-family: "YakuHanMPs", "Shippori Mincho B1", serif;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge--area { color: var(--text-strong); }
.badge--area[data-area="amaji"]  { background: var(--area-amaji); }
.badge--area[data-area="kawabe"] { background: var(--area-kawabe); }
.badge--area[data-area="seka"]   { background: var(--area-seka); }
.badge--area[data-area="tsurui"] { background: var(--area-tsurui); }
/* バッジを右端に固定 */
.card--active .badge--area { justify-self: end; }

/* ===== ひまわりイラスト背景 ===== */
/* body の background: var(--base) を上書き。12ヶ月テーマはCSS変数経由でカード・文字・枠に引き続き適用される */
/* 案B：全面背景は使わず、無地のクラフト紙。ひまわりは冒頭にヒーローで1枚。 */
body {
  background-color: var(--base);
}
.welcome-hero {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}
.welcome-flower {
  display: block;
  height: clamp(240px, 42vw, 380px);
  width: auto;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(61, 32, 8, 0.14);
}
/* 縦書きの添え書き（掛け軸風：右は上寄せ・左は下寄せ） */
.welcome-caption {
  writing-mode: vertical-rl;
  font-family: "YakuHanMPs", "Shippori Mincho B1", serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--text-muted);
}
.welcome-caption--left  { align-self: flex-end; }
.welcome-caption--right { align-self: flex-start; }
@media (max-width: 640px) {
  .welcome-hero { gap: 12px; }
  .welcome-caption { font-size: 11px; letter-spacing: 0.22em; }
}

/* ===== フッター ===== */
.footer {
  text-align: center;
  padding: 40px 24px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  border-top: 1px solid var(--hairline);
}

.footer-note {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.7;
  opacity: 0.75;
}
/* 「…非公式の／ポータルサイトです。」の改行はモバイルのみ */
.footer-note-br { display: none; }
@media (max-width: 640px) {
  .footer-note-br { display: inline; }
}
