/* ツーリング目的地マップ（touring.2strokegoat.com）
   レイアウト：紺の帯（見出し）→ 絞り込み → 地図 → 一覧カード
   ★ 色は必ず変数を通すこと ★ ダークは JS が <html data-theme="dark"> を付けたときだけ。
     ブロックはライトの :root とダークの :root[data-theme="dark"] の2つだけ（姉妹サイトと同じ方式）。
   ★ 地図の印と凡例の色はダークでも変えない ★ 地図のタイルが明るいままなので、凡例＝実物を優先。 */
:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1a1f28;
  --body-text: #2b3240;
  --sub: #5a6472;
  --muted: #7d8692;
  --line: #dfe4eb;
  --line-strong: #b9c4d1;
  --soil: #8a5a2b;
  --soil-2: #a97540;
  --on-soil: #ffffff;
  --link: #0b5ea8;
  --seg-off: #e3e7ed;
  --area: rgba(138, 90, 43, 0.16);
  /* 注意の印（休館・駐車場なし・時期限定など）。赤ではなく錆色＝危険ではなく「行く前に確かめて」 */
  --warn: #9a3b12;
  --warn-bg: #fdf1e7;
  --warn-line: #e3b48f;
  /* 見出しの帯は明暗とも紺（OGカードと同じ地色）。ダークで上書きしない */
  --hero-bg: #1a2a4a;
  --hero-ink: #f4f6f9;
  --hero-sub: #c9d4e6;
  --hero-line: rgba(244, 246, 249, 0.22);
  --hero-num: #dda869;
  --font-cond: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a2a4a;
  --card: #213254;
  --ink: #f4f6f9;
  --body-text: #dce4f0;
  --sub: #a7b4ca;
  --muted: #8e9bb3;
  --line: #324569;
  --line-strong: #4a5f86;
  --soil: #c68c4a;
  --soil-2: #dda869;
  --on-soil: #1a2a4a;
  --link: #8ab8ec;
  --seg-off: #324569;
  --area: rgba(198, 140, 74, 0.22);
  --warn: #f2b48a;
  --warn-bg: rgba(242, 180, 138, 0.12);
  --warn-line: #8a5a3c;
}

/* 注意の印 */
.cautions { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.caution { font-size: 12px; line-height: 1.5; padding: 0 7px; border: 1px solid var(--warn-line); border-radius: 3px; color: var(--warn); background: var(--warn-bg); }
.caution-box { margin: 12px 0 16px; padding: 10px 14px; border: 1px solid var(--warn-line); border-left: 4px solid var(--warn); background: var(--warn-bg); border-radius: 3px; }
.caution-box p { margin: 4px 0; color: var(--body-text); }
.caution-box b { color: var(--warn); margin-right: 8px; }
.caution-box .src { display: block; font-size: 12px; color: var(--sub); }
.pop .pc { color: var(--warn); font-size: 12px; font-weight: 700; }

* { box-sizing: border-box; }
/* ★ 絞り込みは hidden 属性で隠す ★ カードの display:flex に hidden が負けると全件出たままになる */
[hidden] { display: none !important; }
html { overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.7;
}
.wrap {
  max-width: 1040px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--soil-2); outline-offset: 2px; }
.num { font-family: var(--font-cond); font-variant-numeric: tabular-nums; }

/* ---------- ハブへ戻る1行（姉妹サイト共通） ---------- */
.home-link { padding-block: 10px; font-size: 13px; }
.home-link a { color: var(--soil); font-weight: 700; text-decoration: none; }
.home-link a:hover { text-decoration: underline; }

/* ---------- 紺の帯 ---------- */
header.page-header { background: var(--hero-bg); color: var(--hero-ink); border-bottom: 4px solid var(--soil); }
header.page-header .wrap { padding-block: 26px 22px; }
header.page-header .eyebrow { display: block; color: var(--hero-sub); font-size: 13px; margin: 0 0 6px; }
header.page-header h1 { margin: 0; font-size: clamp(24px, 4.2vw, 38px); line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; }
header.page-header .date-line { color: var(--hero-sub); font-size: 14.5px; margin: 10px 0 0; max-width: 42em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; border-top: 1px solid var(--hero-line); }
.stats > div { padding: 10px 0 0 14px; border-right: 1px solid var(--hero-line); }
.stats > div:first-child { padding-left: 0; }
.stats > div:last-child { border-right: 0; }
.stats .v { display: block; font-family: var(--font-cond); font-weight: 600; font-size: 28px; line-height: 1.1; color: var(--hero-num); }
.stats .k { display: block; margin-top: 2px; color: var(--hero-sub); font-size: 12px; }

/* ---------- 紋章（姉妹サイトと同じ指定） ----------
   ★ 高さで揃える ★ ★ with-emblem を付けた側だけ flex ★
   ★ 帯の中は明暗にかかわらず紺地用（emblem-dark.svg）★ :root を付けて詳細度で負けないようにする */
.with-emblem { display: flex; align-items: flex-start; gap: 18px; }
.with-emblem .ph-body { min-width: 0; flex: 1; }
header.page-header .emblem { flex: none; height: 52px; width: auto; display: block; margin-top: 2px; }
:root header.page-header .emblem-light { display: none; }
:root header.page-header .emblem-dark { display: block; }
:root[data-theme="dark"] .emblem-light,
:root:not([data-theme="dark"]) .emblem-dark { display: none; }

/* ---------- 本文の区切り（面ではなく罫線） ---------- */
main { padding-bottom: 8px; }
.sec { margin: 34px 0 0; }
.sec h2 { margin: 0 0 14px; font-size: 18px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.sec p { margin: 0 0 10px; color: var(--body-text); }
/* 結論3行。左に土色の罫1本だけ */
.three { list-style: none; margin: 22px 0 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--soil); }
.three li { margin: 2px 0; color: var(--body-text); }
.three b { color: var(--ink); margin-right: 6px; }
.reading { margin: 14px 0 0; font-size: 13px; color: var(--sub); }
.reading strong { color: var(--ink); }

/* ---------- 絞り込み・並べ替え ---------- */
.controls { margin: 24px 0 12px; display: grid; gap: 10px; }
.ctl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ctl-label { font-size: 12.5px; color: var(--muted); margin-right: 2px; min-width: 4.5em; }
.chk, .chip {
  font: inherit; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 4px 12px; min-height: 34px; user-select: none;
}
.chk input { margin: 0; accent-color: var(--soil); }
.chk:has(input:checked), .chip[aria-pressed="true"] { background: var(--soil); color: var(--on-soil); border-color: var(--soil); }
.chk:hover, .chip:hover { border-color: var(--soil); }
/* 検索窓。16px 未満だと iPhone が入力のたびに拡大する */
.search input {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 5px 10px; min-height: 38px; flex: 1 1 14em; max-width: 26em; min-width: 0;
}
.search input:focus { outline: 2px solid var(--soil); outline-offset: 1px; border-color: var(--soil); }
.sort select { font: inherit; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line-strong); border-radius: 4px; padding: 5px 8px; min-height: 34px; }

/* ---------- 地図 ---------- */
.map { height: clamp(320px, 58vh, 560px); border: 1px solid var(--line-strong); background: #eef1f4; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 0; padding: 0; font-size: 13px; color: var(--sub); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
/* ★ 凡例の色は地図の印と同じ値（map.js の COLORS）。ダークでも変えない ★ */
.key-michinoeki { background: #8a5a2b; border: 2px solid #ffffff; box-shadow: 0 0 0 1px #8a5a2b; }
.key-spot { background: #ffffff; border: 3px solid #1a2a4a; }
.attr { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.attr a { color: var(--sub); }
.leaflet-container { font-family: var(--font-body); }
.leaflet-container .leaflet-interactive:focus { outline: none; }
.pop { font-size: 13px; line-height: 1.6; min-width: 180px; }
.pop a { font-weight: 700; font-size: 14px; }
.pop .pm { color: #5a6472; }
.pop .ps { margin-top: 4px; font-family: var(--font-cond); color: #1a1f28; }

/* ---------- 一覧カード ---------- */
.count { margin: 22px 0 8px; font-size: 13.5px; color: var(--sub); }
.count .num { font-size: 18px; color: var(--ink); }
.none { color: var(--sub); padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.cards > li { display: flex; min-width: 0; }
.cards a.card {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--soil);
  color: var(--ink); text-decoration: none;
}
.cards li[data-kind="spot"] a.card { border-left-color: var(--line-strong); }
.cards a.card:hover { border-color: var(--soil); }
.card .nm { font-weight: 700; font-size: 15.5px; line-height: 1.45; overflow-wrap: anywhere; }
.card .meta { font-size: 12.5px; color: var(--sub); }
.bars { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: center; margin-top: 2px; font-size: 12px; }
.bars .bl { color: var(--sub); }
.segs { display: inline-flex; gap: 3px; align-items: center; }
.segs i { width: 16px; height: 7px; background: var(--seg-off); display: inline-block; }
.segs i.on { background: var(--soil); }
.segs .un, .un { color: var(--muted); font-size: 12px; }
.bars .sorted { color: var(--ink); font-weight: 700; }

/* ---------- 地点のページ ---------- */
.crumb { margin: 16px 0 0; font-size: 13.5px; }
.crumb a { color: var(--link); }
.chart-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 8px 28px; align-items: start; }
.radar { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; }
.radar .r-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.radar .r-spoke { stroke: var(--line-strong); stroke-width: 1; }
.radar .r-spoke.un { stroke-dasharray: 3 3; }
.radar .r-area { fill: var(--area); stroke: var(--soil); stroke-width: 2; stroke-linejoin: round; }
.radar .r-dot { fill: var(--soil); }
.radar .r-label { fill: var(--ink); font-size: 12.5px; font-family: var(--font-body); }
.radar .r-val { fill: var(--soil); font-size: 13px; font-family: var(--font-cond); font-weight: 600; }
.radar .r-un { fill: var(--muted); font-size: 11.5px; font-family: var(--font-body); }
.why { list-style: none; margin: 0; padding: 0; }
.why li { padding: 9px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 9.5em 3.2em minmax(0, 1fr); gap: 2px 10px; align-items: baseline; }
.why li:first-child { padding-top: 0; }
.why .wl { font-weight: 700; font-size: 14px; }
.why .wv { font-family: var(--font-cond); font-weight: 600; color: var(--soil); font-size: 16px; }
.why .wv.un { font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 12.5px; }
.why .wt { color: var(--sub); font-size: 13px; }

.scale { margin: 0 0 18px; }
.scale-ends { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; }
.scale-track { position: relative; height: 22px; margin: 4px 7px; }
.scale-track::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--line-strong); }
.scale-track .tick { position: absolute; top: 6px; width: 2px; height: 10px; background: var(--line-strong); transform: translateX(-1px); }
.scale-track .mark { position: absolute; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--soil); border: 2px solid var(--bg); transform: translateX(-8px); }
.scale .wt { font-size: 13px; color: var(--sub); margin: 2px 0 0; }

.tblwrap { overflow-x: auto; }
table.facts { width: 100%; border-collapse: collapse; font-size: 14px; }
table.facts th, table.facts td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.facts tbody th { font-weight: 400; color: var(--sub); width: 13em; }
table.facts td { overflow-wrap: anywhere; }
table.facts tr.grp th { padding-top: 18px; font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--line-strong); }
table.facts tbody:first-child tr.grp th { padding-top: 4px; }
table.facts .src { display: block; font-weight: 400; font-size: 12.5px; color: var(--sub); margin-top: 2px; }
table.facts td.un { color: var(--muted); }

blockquote.cite { margin: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--line-strong); }
blockquote.cite p { margin: 0; font-size: 15px; color: var(--ink); }
.cite-src { font-size: 12.5px; color: var(--sub); margin: 6px 0 0; }

.link-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.link-rows li { border-bottom: 1px solid var(--line); }
.link-rows a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; text-decoration: none; color: var(--ink); min-height: 44px; }
.link-rows a::after { content: "↗"; color: var(--link); font-size: 0.9em; }
.link-rows a:hover { color: var(--link); }
.link-rows .lk-note { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.notice { margin: 30px 0 0; padding: 12px 14px; border: 1px solid var(--line-strong); font-size: 13.5px; color: var(--body-text); }

/* /about/ の表 */
table.rules { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rules th, table.rules td { text-align: left; padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.rules th { width: 12em; }
table.rules .basis { display: block; font-weight: 400; font-size: 12.5px; color: var(--sub); margin-top: 2px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.steps li { border: 1px solid var(--line); background: var(--card); padding: 1px 8px; font-size: 13.5px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { position: relative; padding: 6px 0 6px 26px; border-bottom: 1px solid var(--line); color: var(--body-text); }
.checklist li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 12px; height: 7px; border-left: 2px solid var(--soil); border-bottom: 2px solid var(--soil); transform: rotate(-45deg); }
.src-list { margin: 0; padding-left: 20px; color: var(--body-text); }
.src-list li { margin: 4px 0; }

/* ---------- フッター（姉妹サイト共通） ---------- */
footer.page-footer { font-size: 12.5px; color: var(--sub); padding: 24px 0 28px; border-top: 1px solid var(--line); margin-top: 44px; }
footer.page-footer .site-name { font-weight: 700; color: var(--ink); font-size: 15px; }
footer.page-footer .foot-links { margin: 8px 0 4px; display: flex; flex-wrap: wrap; gap: 4px 0; }
footer.page-footer .foot-links a { color: var(--sub); }
footer.page-footer .sep { margin: 0 8px; color: var(--line-strong); }
.brand-line { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; }
.brand-line a { color: var(--soil); font-weight: 700; text-decoration: none; }
.brand-line a:hover { text-decoration: underline; }
/* テーマ切替。★ JS が動いたときだけ見える ★（姉妹サイトと同じ指定） */
.theme-switch { display: none; margin-top: 12px; }
html[data-theme] .theme-switch { display: block; }
.theme-switch button {
  font: inherit; font-size: 12px; color: var(--sub); background: none;
  border: 1px solid var(--line-strong); padding: 2px 12px; margin: 0; cursor: pointer;
}
.theme-switch button + button { border-left: none; }
.theme-switch button:first-of-type { border-radius: 999px 0 0 999px; padding-left: 14px; }
.theme-switch button:last-of-type { border-radius: 0 999px 999px 0; padding-right: 14px; }
.theme-switch button[aria-pressed="true"] { color: var(--ink); background: var(--card); font-weight: 700; }

/* ---------- スマホ ---------- */
@media (max-width: 720px) {
  .chart-grid { grid-template-columns: minmax(0, 1fr); }
  .why li { grid-template-columns: minmax(0, 1fr) auto; }
  .why .wt { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  header.page-header .emblem { height: 42px; }
  .with-emblem { gap: 12px; }
  .stats .v { font-size: 23px; }
  .ctl-label { min-width: 0; width: 100%; }
  table.facts tbody th { width: 42%; }
  table.rules th { width: 8.5em; }
}
