/* 対応エリアページ専用: インタラクティブマップ（area/index.php のみ読込） */

/* --- マップシェル（角丸カード内にマップ＋凡例を収める） --- */
.area-map-shell {
  position: relative;
  border: 1px solid #E8DED8;
  background-color: #F3EFEA;
}

/* マップキャンバス: 大型表示（PC 65vh / SPは下記メディアクエリ） */
#area-map.area-map-canvas {
  width: 100%;
  height: min(65vh, 720px);
  min-height: 520px;
  z-index: 1;
}

/* タイルのみ暖色化（attribution には filter を当てない） */
#area-map .leaflet-tile-pane {
  filter: saturate(0.62) sepia(0.14) brightness(1.06);
}

/* Leaflet ズームコントロールをサイトカラーに合わせる */
#area-map .leaflet-control-zoom a {
  color: #2F2A28;
  border-color: #E8DED8;
  background-color: #FFFFFF;
}

#area-map .leaflet-control-zoom a:hover {
  color: #C98F8F;
  background-color: #FAF8F5;
}

#area-map .leaflet-control-attribution {
  font-size: 10px;
  color: #6F6661;
  background-color: rgba(255, 255, 255, 0.88);
}

/* --- 凡例パネル（マップ左上・コンテナ内相対配置） --- */
.area-map-legend {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  width: min(280px, calc(100% - 32px));
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #E8DED8;
  background-color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 32px rgba(47, 42, 40, 0.1);
  backdrop-filter: blur(6px);
}

.area-map-legend__title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #2F2A28;
  letter-spacing: 0.02em;
}

.area-map-legend__desc {
  margin: 0 0 12px;
  font-size: 11px;
  line-height: 1.6;
  color: #6F6661;
}

.area-map-legend__zones {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 距離ゾーンボタン（凡例タップで対応する円をハイライト） */
.area-map-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.area-map-zone:hover,
.area-map-zone.is-active {
  background-color: #FAF8F5;
  border-color: #E8DED8;
}

.area-map-zone__swatch {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.area-map-zone__body {
  flex: 1;
  min-width: 0;
}

.area-map-zone__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #2F2A28;
}

.area-map-zone__price {
  display: block;
  font-size: 11px;
  color: #C98F8F;
  font-weight: 700;
}

.area-map-legend__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #E8DED8;
}

.area-map-reset {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  border: 1px solid #D8C8BD;
  border-radius: 999px;
  background-color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  color: #2F2A28;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.area-map-reset:hover {
  background-color: #FAF8F5;
  color: #C98F8F;
}

.area-map-legend__link {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  border-radius: 999px;
  background-color: #C98F8F;
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.area-map-legend__link:hover {
  background-color: #B77C7C;
}

/* --- スマホ: 凡例をマップ下へ配置（マップ全面表示） --- */
@media (max-width: 768px) {
  .area-map-shell {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #area-map.area-map-canvas {
    flex-shrink: 0;
    height: min(50vh, 440px);
    min-height: 320px;
    border-radius: 24px 24px 0 0;
  }

  .area-map-legend {
    position: static;
    width: 100%;
    padding: 14px 16px 16px;
    border: none;
    border-top: 1px solid #E8DED8;
    border-radius: 0 0 24px 24px;
    background-color: #FFFFFF;
    box-shadow: none;
    backdrop-filter: none;
  }

  .area-map-legend__desc {
    display: none;
  }

  .area-map-legend__zones {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .area-map-zone {
    padding: 6px 8px;
    gap: 8px;
  }

  .area-map-zone__label {
    font-size: 11px;
  }

  .area-map-zone__price {
    font-size: 10px;
  }

  .area-map-legend__actions {
    margin-top: 10px;
    padding-top: 10px;
  }
}

/* Leaflet 未読込・初期化失敗時のフォールバック */
.area-map-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(65vh, 720px);
  min-height: 520px;
  padding: 24px;
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
  color: #6F6661;
  background-color: #F3EFEA;
}

@media (max-width: 768px) {
  .area-map-fallback {
    height: min(50vh, 440px);
    min-height: 320px;
    border-radius: 24px;
  }
}

/* カスタム拠点マーカー */
.area-map-marker-wrap {
  background: transparent;
  border: none;
}

.area-map-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -100%);
}

.area-map-marker__pin {
  width: 18px;
  height: 18px;
  border: 3px solid #FFFFFF;
  border-radius: 50%;
  background-color: #C98F8F;
  box-shadow: 0 4px 12px rgba(201, 143, 143, 0.45);
}

.area-map-marker__label {
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background-color: rgba(47, 42, 40, 0.82);
  font-size: 10px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
}
