@charset "utf-8";
/* =========================================================================
   マップでしろう観光スポット  専用スタイル
   地図は「補助」、キーボードでも使える一覧が「本体」という設計です。
   ========================================================================= */

.mapapp { padding: clamp(20px, 3vw, 36px) 0 clamp(40px, 6vw, 80px); }

/* ---- 検索・絞り込みバー ---- */
.filters {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--sp-5);
  box-shadow: var(--shadow-1); margin-bottom: var(--sp-5);
}
.filters__row + .filters__row { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px dashed var(--line); }
.filters__legend {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; color: var(--ink-2);
  letter-spacing: .06em; margin-bottom: var(--sp-3);
}
.filters__legend svg { width: 17px; height: 17px; color: var(--brand); }

.search {
  position: relative; display: flex; align-items: center;
  background: var(--surface-2); border: 2px solid var(--line-ui);
  border-radius: var(--r-pill); padding: 0 14px; min-height: 52px;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.search svg { width: 20px; height: 20px; color: var(--ink-3); flex: 0 0 auto; }
.search input {
  flex: 1 1 auto; min-width: 0; border: none; background: none;
  padding: 0 12px; min-height: 48px; font-size: 16px; /* iOS のズーム防止 */
}
.search input::placeholder { color: var(--ink-3); }
.search__clear {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: none; background: var(--surface-3); color: var(--ink-2);
  border-radius: 50%; cursor: pointer; flex: 0 0 auto;
}
.search__clear svg { width: 16px; height: 16px; color: inherit; }
.search__clear[hidden] { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: var(--tap); padding: 0 15px;
  background: var(--surface-2); color: var(--ink);
  border: 1.5px solid var(--line-ui); border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s, color .18s, transform .12s;
}
.chip svg { width: 17px; height: 17px; }
.chip:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-deep); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip[aria-pressed="true"] svg { color: var(--on-brand); }
.chip__count { font-family: var(--font-num); font-size: 11.5px; opacity: .75; }

.filters__foot {
  display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center;
  justify-content: space-between; margin-top: var(--sp-4);
}
.result-count { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.result-count b { font-family: var(--font-num); font-size: 20px; color: var(--accent); }
.btn-reset {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; cursor: pointer;
  background: none; border: 1.5px solid var(--line-ui); border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 700; color: var(--ink-2);
}
.btn-reset svg { width: 16px; height: 16px; }
.btn-reset:hover { border-color: var(--accent); color: var(--accent); }

/* ---- 地図と一覧の 2 カラム ---- */
.mapgrid { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 1000px) {
  .mapgrid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: start; }
  .mapgrid__map { position: sticky; top: 80px; }
}

.map-shell {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-2); background: var(--surface-2);
}
#map { width: 100%; height: clamp(380px, 62vh, 680px); background: var(--surface-2); }
.map-shell__hint {
  padding: 10px var(--sp-4); font-size: 12.5px; color: var(--ink-3);
  background: var(--surface); border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.map-shell__hint svg { width: 15px; height: 15px; color: var(--brand); }

.map-fallback {
  position: absolute; inset: 0; display: none; place-items: center; text-align: center;
  padding: var(--sp-6); background: var(--surface-2); color: var(--ink-2); font-size: 14px;
}
.map-shell.is-failed .map-fallback { display: grid; }

/* ---- スポット一覧 ---- */
.spotlist {
  max-height: none; display: grid; gap: var(--sp-4);
}
@media (min-width: 1000px) {
  .spotlist { max-height: calc(100vh - 160px); overflow-y: auto; padding-right: 6px; scrollbar-gutter: stable; }
}
.spot {
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--brand);
  border-radius: var(--r-md); padding: var(--sp-5); box-shadow: var(--shadow-1);
  scroll-margin-top: 90px;
}
.spot.is-active { border-color: var(--accent); border-left-color: var(--accent); box-shadow: var(--shadow-2); }
.spot[hidden] { display: none; }
.spot--temple    { border-left-color: var(--gold); }
.spot--nature    { border-left-color: var(--leaf); }
.spot--beach     { border-left-color: var(--brand); }
.spot--wildlife  { border-left-color: var(--leaf); }
.spot--culture   { border-left-color: var(--plum); }
.spot--city      { border-left-color: var(--accent); }
.spot--tea       { border-left-color: var(--leaf); }
.spot--waterfall { border-left-color: var(--brand); }
.spot--colonial  { border-left-color: var(--plum); }

.spot__head { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-3); }
.spot__no {
  font-family: var(--font-num); font-size: 12px; font-weight: 800;
  color: var(--ink-2); background: var(--surface-2);
  padding: 2px 9px; border-radius: var(--r-pill);
}
.spot h3 { font-size: 18px; width: 100%; margin-top: 2px; }
.spot__desc { font-size: 14.5px; color: var(--ink-2); }
.spot__tip {
  margin-top: var(--sp-3); padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--gold-tint); font-size: 13.5px; color: var(--ink-2);
  display: flex; gap: 9px; align-items: flex-start;
}
.spot__tip svg { width: 16px; height: 16px; color: var(--gold); flex: 0 0 auto; margin-top: 3px; }
.spot__foot { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); align-items: center; }
.spot__btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: var(--tap); padding: 0 15px; cursor: pointer;
  background: var(--brand-tint); color: var(--brand-deep);
  border: 1.5px solid transparent; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 700; text-decoration: none;
}
.spot__btn:hover { background: var(--brand); color: var(--on-brand); }
.spot__btn svg { width: 16px; height: 16px; }
.spot__cite { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--sp-3); font-size: 12.5px; }
.spot__cite span { color: var(--ink-3); font-weight: 700; }
.spot__cite a { color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; min-height: 32px; }
.spot__cite a svg { width: 12px; height: 12px; }

.region-head {
  position: sticky; top: 64px; z-index: 2;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 10px 0 8px; margin-top: var(--sp-4);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 900; color: var(--brand-deep);
  border-bottom: 2px solid var(--brand-tint);
}
.region-head[hidden] { display: none; }
.region-head svg { width: 18px; height: 18px; }
.region-head span { font-family: var(--font-num); font-weight: 700; color: var(--ink-3); font-size: 12px; margin-left: auto; }

.empty {
  padding: var(--sp-8) var(--sp-5); text-align: center; color: var(--ink-2);
  background: var(--surface); border: 1px dashed var(--line-ui); border-radius: var(--r-lg);
}
.empty[hidden] { display: none; }
.empty svg { width: 44px; height: 44px; color: var(--ink-3); margin: 0 auto var(--sp-3); }

/* ---- Leaflet の見た目調整 ---- */
.leaflet-container { font: inherit; background: var(--surface-2); }
.leaflet-container a { color: var(--brand-deep); }
.leaflet-popup-content-wrapper {
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
  background: var(--surface); color: var(--ink);
}
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 14px 16px; font-size: 14px; line-height: 1.75; max-width: 260px; }
.leaflet-popup-content h4 { font-size: 16px; margin: 0 0 6px; color: var(--ink); }
.leaflet-popup-content p { margin: 0 0 8px; color: var(--ink-2); font-size: 13px; }
.leaflet-popup-content .pop-links { display: flex; flex-wrap: wrap; gap: 8px; }
.leaflet-popup-content .pop-links a {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 36px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--brand-tint); color: var(--brand-deep);
  font-size: 12.5px; font-weight: 700; text-decoration: none;
}
.leaflet-popup-content .pop-links a:hover { background: var(--brand); color: var(--on-brand); }
.leaflet-popup-content .pop-links svg { width: 13px; height: 13px; }
.leaflet-bar a, .leaflet-bar a:hover {
  width: 38px; height: 38px; line-height: 38px;
  background: var(--surface); color: var(--ink); border-bottom-color: var(--line);
}
.leaflet-bar a:hover { background: var(--brand-tint); }
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 86%, transparent) !important;
  color: var(--ink-3) !important; font-size: 11px;
}
.leaflet-control-attribution a { color: var(--brand-deep) !important; }
/* ダークモードでは地図タイルを控えめに */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile { filter: brightness(.78) saturate(.86) contrast(1.06); }
}
:root[data-theme="dark"] .leaflet-tile { filter: brightness(.78) saturate(.86) contrast(1.06); }

/* 自作ピン */
.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  display: grid; place-items: center;
  border: 2.5px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35);
  background: var(--brand);
}
.pin svg { width: 15px; height: 15px; color: #fff; transform: rotate(45deg); }
.pin--temple { background: #7A5200; } .pin--nature { background: #146B3A; }
.pin--beach  { background: #0A6E75; } .pin--wildlife { background: #1E8A4C; }
.pin--culture{ background: #8E2A5F; } .pin--city   { background: #B8420A; }
.pin--tea    { background: #2E7D32; } .pin--waterfall { background: #0E7C9E; }
.pin--colonial { background: #6B2E7A; }
.leaflet-marker-icon.is-active .pin { outline: 3px solid var(--focus); outline-offset: 3px; }

.cluster {
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(10,110,117,.88); color: #fff;
  font-weight: 800; font-family: var(--font-num);
  border: 3px solid rgba(255,255,255,.9); box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.cluster--s { width: 38px; height: 38px; font-size: 13px; }
.cluster--m { width: 46px; height: 46px; font-size: 14px; background: rgba(184,66,10,.88); }
.cluster--l { width: 56px; height: 56px; font-size: 15px; background: rgba(142,42,95,.9); }

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
  .leaflet-fade-anim .leaflet-tile,
  .leaflet-zoom-anim .leaflet-zoom-animated { transition: none !important; }
}

/* エリア見出しの下の説明行 */
.region-note {
  margin: 0 0 var(--sp-3); padding: 0 2px;
  font-size: 12.5px; color: var(--ink-3); line-height: 1.7;
}
.region-note[hidden] { display: none; }
.region-note b { color: var(--ink-2); font-weight: 700; }
/* 地図ポップアップ内の一言 */
.leaflet-popup-content .pop-note {
  margin: 0 0 8px; font-size: 11.5px; font-weight: 700;
  color: var(--brand-deep); letter-spacing: .02em;
}
