/* =============================================================
   おみそ散歩 — spot-map.css
   ============================================================= */

/* ── 0. 変数 ───────────────────────── */
.spot-map-page {
  --sm-rose:       #e8a0b4;
  --sm-rose-light: #fdf2f5;
  --sm-rose-mid:   #d4849b;
  --sm-mint:       #9bcdb8;
  --sm-mint-light: #eef8f3;
  --sm-cream:      #faf6f0;
  --sm-ink:        #3c3530;
  --sm-ink-light:  #7a7470;
  --sm-bg:         #fffcf9;
}

/* ── 1. ページ全体 ──────────────────── */
.spot-map-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 0;
  position: relative;
  min-height: 100vh;
}

/* 草原（フッターのピンクラインに密着） */
.spot-map-page::after {
  content: '';
  display: block;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: 55px;
  margin-top: 2rem;
  margin-bottom: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='55' viewBox='0 0 120 55'%3E%3Cpath d='M0,55 Q2,30 5,15 Q6,30 8,55' fill='%235a8f3c'/%3E%3Cpath d='M8,55 Q12,25 14,10 Q15,27 18,55' fill='%236ba348'/%3E%3Cpath d='M15,55 Q18,33 20,20 Q21,35 24,55' fill='%234d7a32'/%3E%3Cpath d='M22,55 Q26,23 28,5 Q29,25 32,55' fill='%237ab856'/%3E%3Cpath d='M30,55 Q33,30 35,17 Q36,33 39,55' fill='%235a8f3c'/%3E%3Cpath d='M37,55 Q40,27 42,13 Q43,29 46,55' fill='%236ba348'/%3E%3Cpath d='M44,55 Q48,20 50,3 Q51,23 54,55' fill='%234d7a32'/%3E%3Cpath d='M52,55 Q55,31 57,19 Q58,33 61,55' fill='%237ab856'/%3E%3Cpath d='M59,55 Q62,25 64,9 Q65,27 68,55' fill='%235a8f3c'/%3E%3Cpath d='M66,55 Q70,29 72,15 Q73,31 76,55' fill='%236ba348'/%3E%3Cpath d='M74,55 Q77,23 79,7 Q80,25 83,55' fill='%234d7a32'/%3E%3Cpath d='M81,55 Q84,33 86,21 Q87,35 90,55' fill='%237ab856'/%3E%3Cpath d='M88,55 Q91,27 93,11 Q94,29 97,55' fill='%235a8f3c'/%3E%3Cpath d='M95,55 Q98,31 100,17 Q101,33 104,55' fill='%236ba348'/%3E%3Cpath d='M102,55 Q106,21 108,5 Q109,23 112,55' fill='%234d7a32'/%3E%3Cpath d='M110,55 Q113,29 115,13 Q116,31 119,55' fill='%237ab856'/%3E%3C/svg%3E") repeat-x bottom;
  background-size: auto 55px;
}

/* ── 2. ヘッダー ────────────────────── */
.spot-map-header {
  text-align: center;
  margin-bottom: 1.75rem;
  padding: 2.5rem 1rem 2rem;
  border-radius: 16px;
  background:
    linear-gradient(180deg,
      #c0ddf0 0%,
      #d9ecf7 20%,
      #eaf5fb 35%,
      #fdfcf4 50%,
      #f4edd4 65%,
      #d4e6c3 80%,
      #b8d9a0 100%
    );
  position: relative;
  overflow: hidden;
}

.spot-map-header::before {
  content: '🌼';
  position: absolute;
  right: 12%;
  bottom: 14px;
  font-size: 2rem;
  opacity: 0.85;
  transform: rotate(-8deg);
}

.spot-map-header::after {
  content: '🌼';
  position: absolute;
  right: 8%;
  bottom: 42px;
  font-size: 1.1rem;
  opacity: 0.6;
  transform: rotate(12deg);
}

.spot-map-eyebrow {
  font-family: 'Petit Formal Script', cursive;
  font-size: 0.8rem;
  color: var(--sm-rose);
  letter-spacing: 0.08em;
  margin: 0 0 0.25rem;
}

.spot-map-title {
  font-family: 'Stick', 'Zen Maru Gothic', sans-serif;
  font-size: 3rem;
  font-weight: 500;
  margin: 0 0 0.6rem;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #f5c842 0%, #ed8a2e 45%, #e05a3a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(1px 2px 1px rgba(180, 80, 40, 0.15));
  line-height: 1.3;
}

.spot-map-lead {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 0.85rem;
  color: var(--sm-ink-light);
  margin: 0;
  line-height: 1.7;
}

/* ── 3. ナビ（地図の上のフィルター） ── */
.spot-map-nav {
  position: relative;
  z-index: 10;
  margin-bottom: 0.75rem;
}

.spot-map-nav-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.spot-map-nav-foot {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  filter: hue-rotate(320deg) saturate(1.5);
  order: -1;
}

.spot-map-nav-cats {
  display: flex;
  gap: 0.5rem;
}

.spot-map-cat-btn {
  appearance: none;
  background: #fffef6;
  color: #4a8c3f;
  font-family: 'Stick', 'Zen Maru Gothic', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5em 1.3em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  border: 2.5px solid #c8b88a;
  border-radius: 24px;
  box-shadow:
    inset 0 0 0 1px rgba(200, 184, 138, 0.2),
    0 1px 3px rgba(160, 140, 80, 0.1);
  transform: rotate(-0.5deg);
}

.spot-map-cat-btn:nth-child(2) {
  transform: rotate(0.3deg);
  border-radius: 22px 28px 26px 20px;
}

.spot-map-cat-btn:nth-child(3) {
  transform: rotate(-0.8deg);
  border-radius: 26px 20px 24px 28px;
}

.spot-map-cat-btn:hover {
  background: #f0ebd6;
  transform: translateY(-1px) rotate(0deg);
}

.spot-map-cat-btn.is-active {
  background: #4a8c3f;
  border-color: #3d7534;
  color: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(61, 117, 52, 0.3),
    0 1px 4px rgba(60, 100, 40, 0.2);
}

/* サブエリア（開閉式） */
.spot-map-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem 0 0.4rem;
  animation: spotSubIn 0.25s ease-out;
}

.spot-map-sub[hidden] {
  display: none;
}

@keyframes spotSubIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.spot-map-filter-btn {
  appearance: none;
  border: 1px solid #d4ccbe;
  background: #fff;
  color: #4a8c3f;
  font-family: 'Stick', 'Zen Maru Gothic', sans-serif;
  font-size: 0.72rem;
  padding: 0.35em 0.85em;
  border-radius: 2em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.spot-map-filter-btn:hover {
  border-color: #4a8c3f;
  background: #f4f9f2;
}

.spot-map-filter-btn.is-active {
  background: #4a8c3f;
  border-color: #3d7534;
  color: #fff;
}

/* ── 4. 地図コンテナ ────────────────── */
.spot-map-container {
  position: relative;
  margin-bottom: 1rem;
}

.spot-map-canvas {
  width: 100%;
  height: 520px;
  border-radius: 12px;
  border: 1px solid #e8e2dc;
  overflow: hidden;
  z-index: 0;
}

.spot-map-count {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 0.78rem;
  color: var(--sm-ink-light);
  margin: 0.6rem 0 0;
  text-align: right;
}

.spot-map-count [data-spot-count] {
  font-weight: 600;
}

/* ── 5. Leaflet ポップアップ上書き ──── */
.spot-map-canvas .leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(60, 53, 48, 0.12);
  padding: 0;
  overflow: hidden;
}

.spot-map-canvas .leaflet-popup-content {
  margin: 0;
  min-width: 220px;
}

.spot-map-canvas .leaflet-popup-tip {
  box-shadow: none;
}

.spot-popup {
  display: flex;
  gap: 0;
  font-family: 'Zen Maru Gothic', sans-serif;
}

.spot-popup-thumb {
  width: 110px;
  min-height: 85px;
  object-fit: cover;
  flex-shrink: 0;
}

.spot-popup-thumb-empty {
  width: 110px;
  min-height: 85px;
  flex-shrink: 0;
  background: var(--sm-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--sm-rose);
}

.spot-popup-body {
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.spot-popup-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sm-ink);
  margin: 0 0 0.2rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spot-popup-area {
  font-size: 0.7rem;
  color: var(--sm-ink-light);
  margin: 0 0 0.4rem;
}

.spot-popup-area::before {
  content: '📍 ';
}

.spot-popup-link {
  font-size: 0.75rem;
  color: var(--sm-rose-mid);
  text-decoration: none;
  display: inline-block;
}

.spot-popup-link:hover {
  color: var(--sm-rose);
  text-decoration: underline;
}

.spot-popup-link::after {
  content: ' →';
}

/* ── 6. カスタムピンアイコン ────────── */
.spot-pin {
  position: relative;
  width: 28px;
  height: 36px;
}

.spot-pin-head {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sm-rose);
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(60, 53, 48, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
}

.spot-pin-tail {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid var(--sm-rose);
}

/* ── 7. 空メッセージ ────────────────── */
.spot-map-empty {
  text-align: center;
  padding: 2rem 1rem;
}

.spot-map-empty-text {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 0.85rem;
  color: var(--sm-ink-light);
  line-height: 1.8;
}

/* ── 8. 記事一覧（スケッチブック風） ── */
.spot-map-articles {
  margin-top: 2.5rem;
}

.spot-map-articles-title {
  font-family: 'Stick', 'Zen Maru Gothic', sans-serif;
  font-size: 1.1rem;
  color: #4a8c3f;
  margin: 0 0 1rem;
  padding-left: 0.3rem;
}

.spot-map-articles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* カード本体 */
.spot-article-card {
  background: #faf5ec;
  border-radius: 2px 6px 8px 2px;
  box-shadow:
    2px 2px 8px rgba(120, 100, 70, 0.12),
    0 0 0 1px rgba(180, 160, 120, 0.15);
  position: relative;
  overflow: visible;
  padding-left: 2.2rem;
  margin-left: 1.2rem;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ルーズリーフの穴（6つ） */
.spot-article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 1.8rem;
  background:
    radial-gradient(circle 5px at 0.9rem 8%, transparent 4px, #faf5ec 4.5px, #faf5ec 6px, transparent 6.5px),
    radial-gradient(circle 5px at 0.9rem 23%, transparent 4px, #faf5ec 4.5px, #faf5ec 6px, transparent 6.5px),
    radial-gradient(circle 5px at 0.9rem 38%, transparent 4px, #faf5ec 4.5px, #faf5ec 6px, transparent 6.5px),
    radial-gradient(circle 5px at 0.9rem 54%, transparent 4px, #faf5ec 4.5px, #faf5ec 6px, transparent 6.5px),
    radial-gradient(circle 5px at 0.9rem 69%, transparent 4px, #faf5ec 4.5px, #faf5ec 6px, transparent 6.5px),
    radial-gradient(circle 5px at 0.9rem 84%, transparent 4px, #faf5ec 4.5px, #faf5ec 6px, transparent 6.5px);
  filter: drop-shadow(0 1px 1px rgba(100, 80, 50, 0.15));
  pointer-events: none;
  z-index: 2;
}

.spot-article-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 1.8rem;
  background:
    radial-gradient(circle 4px at 0.9rem 8%, rgba(200, 190, 170, 0.3) 3.5px, transparent 4px),
    radial-gradient(circle 4px at 0.9rem 23%, rgba(200, 190, 170, 0.3) 3.5px, transparent 4px),
    radial-gradient(circle 4px at 0.9rem 38%, rgba(200, 190, 170, 0.3) 3.5px, transparent 4px),
    radial-gradient(circle 4px at 0.9rem 54%, rgba(200, 190, 170, 0.3) 3.5px, transparent 4px),
    radial-gradient(circle 4px at 0.9rem 69%, rgba(200, 190, 170, 0.3) 3.5px, transparent 4px),
    radial-gradient(circle 4px at 0.9rem 84%, rgba(200, 190, 170, 0.3) 3.5px, transparent 4px);
  pointer-events: none;
  z-index: 1;
}

/* リンク（縦並び・赤線なし） */
.spot-article-card__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  padding: 0.6rem 0.8rem;
}

.spot-article-card__link:hover {
  background: rgba(250, 245, 236, 0.6);
}

/* サムネイル（大きく・写真を貼った風） */
.spot-article-card__thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 1px 1px 4px rgba(100, 80, 50, 0.15);
  transform: rotate(-0.3deg);
  margin-bottom: 0.5rem;
}

.spot-article-card__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0ead8;
  font-size: 2rem;
}

/* テキスト部分 */
.spot-article-card__body {
  min-width: 0;
}

.spot-article-card__title {
  font-family: 'Stick', 'Zen Maru Gothic', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sm-ink);
  margin: 0 0 0.25rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spot-article-card__area {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 0.7rem;
  color: var(--sm-ink-light);
  display: block;
  margin: 0 0 0.2rem;
}

.spot-article-card__date {
  font-family: 'Stick', 'Zen Maru Gothic', sans-serif;
  font-size: 0.68rem;
  color: #9a8e80;
}

/* ページネーション */
.spot-map-pagination {
  text-align: center;
  margin-top: 1.5rem;
  font-family: 'Stick', 'Zen Maru Gothic', sans-serif;
  font-size: 0.8rem;
}

.spot-map-pagination a,
.spot-map-pagination span {
  display: inline-block;
  padding: 0.3em 0.7em;
  margin: 0 0.15em;
  border-radius: 4px;
  color: #4a8c3f;
  text-decoration: none;
}

.spot-map-pagination .current {
  background: #4a8c3f;
  color: #fff;
}

/* ── 9. レスポンシブ ────────────────── */
@media (max-width: 767px) {
  .spot-map-page {
    padding: 1.5rem 1rem 0;
  }

  .spot-map-title {
    font-size: 2.2rem;
  }

  /* スマホで花がテキストに被らないよう位置調整 */
  .spot-map-header::before {
    right: 4%;
    bottom: 8px;
    font-size: 1.4rem;
  }

  .spot-map-header::after {
    right: 1%;
    bottom: 30px;
    font-size: 0.9rem;
  }

  .spot-map-canvas {
    height: 400px;
    border-radius: 8px;
  }

  .spot-map-nav-inner {
    gap: 0.4rem;
  }

  .spot-map-cat-btn {
    font-size: 0.75rem;
    padding: 0.4em 1em;
  }

  .spot-map-nav-foot {
    font-size: 1.4rem;
  }

  .spot-map-sub {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .spot-map-sub::-webkit-scrollbar {
    display: none;
  }

  .spot-map-filter-btn {
    font-size: 0.7rem;
    padding: 0.35em 0.75em;
  }

  .spot-map-articles-grid {
    grid-template-columns: 1fr;
  }

  .spot-article-card {
    padding-left: 1.8rem;
    margin-left: 0.8rem;
  }

  .spot-article-card::before,
  .spot-article-card::after {
    width: 1.4rem;
  }

  .spot-article-card::before {
    background:
      radial-gradient(circle 4px at 0.7rem 8%, transparent 3px, #faf5ec 3.5px, #faf5ec 5px, transparent 5.5px),
      radial-gradient(circle 4px at 0.7rem 23%, transparent 3px, #faf5ec 3.5px, #faf5ec 5px, transparent 5.5px),
      radial-gradient(circle 4px at 0.7rem 38%, transparent 3px, #faf5ec 3.5px, #faf5ec 5px, transparent 5.5px),
      radial-gradient(circle 4px at 0.7rem 54%, transparent 3px, #faf5ec 3.5px, #faf5ec 5px, transparent 5.5px),
      radial-gradient(circle 4px at 0.7rem 69%, transparent 3px, #faf5ec 3.5px, #faf5ec 5px, transparent 5.5px),
      radial-gradient(circle 4px at 0.7rem 84%, transparent 3px, #faf5ec 3.5px, #faf5ec 5px, transparent 5.5px);
  }

  .spot-article-card::after {
    background:
      radial-gradient(circle 3px at 0.7rem 8%, rgba(200, 190, 170, 0.3) 2.5px, transparent 3px),
      radial-gradient(circle 3px at 0.7rem 23%, rgba(200, 190, 170, 0.3) 2.5px, transparent 3px),
      radial-gradient(circle 3px at 0.7rem 38%, rgba(200, 190, 170, 0.3) 2.5px, transparent 3px),
      radial-gradient(circle 3px at 0.7rem 54%, rgba(200, 190, 170, 0.3) 2.5px, transparent 3px),
      radial-gradient(circle 3px at 0.7rem 69%, rgba(200, 190, 170, 0.3) 2.5px, transparent 3px),
      radial-gradient(circle 3px at 0.7rem 84%, rgba(200, 190, 170, 0.3) 2.5px, transparent 3px);
  }

  .spot-article-card__thumb {
    height: 120px;
  }

  .spot-popup {
    flex-direction: column;
  }

  .spot-popup-thumb,
  .spot-popup-thumb-empty {
    width: 100%;
    height: 100px;
    min-height: auto;
  }
}

@media (min-width: 768px) {
  .spot-map-title {
    font-size: 3.4rem;
  }

  .spot-map-canvas {
    height: 560px;
  }

  .spot-map-cat-btn:hover {
    transform: translateY(-1px);
  }

  .spot-map-filter-btn:hover {
    transform: translateY(-1px);
  }
}
