/* ───────────────────────────────────────────────────────────
/* 지도(map)
/* ───────────────────────────────────────────────────────────
/* style.css(base) 다음에 로드됩니다. 브랜드 토큰(:root)은 base에 있습니다.
/* ─────────────────────────────────────────────────────────── */

.map-page {
  position: relative;
  isolation: isolate; /* Leaflet pane z-index(최대 700)가 header/sub-nav 등 페이지 밖으로 새지 않도록 */
  height: min(calc(100vh - 100px), 620px); /* PC에서는 과대해지지 않게 상한 */
  min-height: 360px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.map-wrap {
  position: relative;
  height: 100%;
  width: 100%;
}

.map-container {
  height: 100%;
  width: 100%;
}

.map-container .maplibregl-popup-content {
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}

.map-info h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 2px;
}

.map-info p {
  font-size: 11px;
  color: #666;
  margin: 0;
}

/* ── 한글 지명 라벨 오버레이 ─────────────────────────── */
.kr-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }

/* Leaflet divIcon 기본 배경/테두리 제거 */
.kr-label-div, .ml-marker-div { background: transparent; border: none; pointer-events: none; }
.kr-label-div .kr-label { pointer-events: none; }
.ml-marker-div { pointer-events: auto; }

/* ── 마커 군집화 배지 ─────────────────────────────── */
.mc-wrap { background: transparent; border: none; }
.mc-badge {
  border-radius: 50%;
  background: linear-gradient(180deg, #f5a623, #d98310);
  color: #fff;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,.35), inset 0 0 0 3px rgba(255,255,255,.85);
  display: block;
}

.kr-label {
  position: absolute;
  top: 0; left: 0;
  white-space: nowrap;
  font-family: var(--font);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.85), 0 0 3px rgba(0,0,0,.6);
  -webkit-text-stroke: .4px rgba(0,0,0,.35);
  line-height: 1.15;
  transform-origin: 0 0;
}
.kr-rk-0 { font-size: 15px; font-weight: 800; }
.kr-rk-1 { font-size: 13px; font-weight: 700; }
.kr-rk-2 { font-size: 12px; font-weight: 600; }
.kr-rk-3 { font-size: 11px; font-weight: 500; }
.kr-rk-4 { font-size: 11px; font-weight: 400; opacity: .92; }

/* ── POI 마커 ─────────────────────────────────────────── */
.ml-marker {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  cursor: pointer;
  font-size: 13px;
}
.maplibregl-marker { z-index: 3; }
.maplibregl-popup { z-index: 4; }
.ml-marker:hover { transform: scale(1.12); }
.ml-marker-emoji { pointer-events: none; }
.ml-marker-pin { width: auto; height: auto; padding: 2px 5px; border-radius: 6px; background: rgba(255,255,255,.9); font-size: 12px; }


.map-topbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 800; /* Leaflet pane(최대 700)보다 위 — 검색/필터가 지도에 가려지지 않게 */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-search {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.map-search .form-control {
  width: 100%;
  border: none;
  background: transparent;
  box-shadow: none;
  padding-right: 36px;
}

.map-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: var(--bg);
  color: var(--text-tertiary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
}

.map-search-clear:hover { background: var(--surface-hover); color: var(--text-secondary); }

.map-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.map-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}

.map-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  white-space: nowrap;
}

.map-controls {
  position: absolute;
  top: 128px;
  right: 12px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-ctl {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-ctl:hover { background: var(--surface-hover); }

.map-panel {
  position: absolute;
  z-index: 810;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.map-detail[hidden], .map-nearby[hidden] { display: none; }

.map-detail {
  top: 76px;
  right: 56px;
  width: 300px;
  max-height: calc(100% - 96px);
  overflow-y: auto;
}

.map-nearby {
  top: 76px;
  left: 56px;
  width: 300px;
  max-height: calc(100% - 96px);
  display: flex;
  flex-direction: column;
}

.map-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.map-panel-close {
  border: none;
  background: var(--bg);
  color: var(--text-tertiary);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
}

.map-panel-close:hover { background: var(--surface-hover); color: var(--text-secondary); }

.map-detail-body { padding: 14px; }

.map-panel-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-top: 10px;
}

.map-panel-region {
  font-size: 12px;
  color: var(--blue);
  margin-top: 2px;
}

.map-panel-stars {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 1px;
  margin-top: 4px;
}

.map-panel-stars span { color: var(--text-secondary); font-size: 12px; }

.map-panel-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 6px;
}

.map-panel-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.map-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.map-panel-actions .btn { justify-content: center; }

.map-nearby-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }

.map-nearby-list { overflow-y: auto; padding: 4px 0; flex: 1; }

.map-nearby-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
}

.map-nearby-item:hover { background: var(--surface-hover); }

.map-nearby-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.map-nearby-body { flex: 1; min-width: 0; }

.map-nearby-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-nearby-sub {
  font-size: 11px;
  color: var(--text-tertiary);
}

.map-nearby-dist {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-text);
  flex-shrink: 0;
}

@media (max-width: 640px) {
	
	  .map-detail {
	    top: auto;
	    right: 12px;
	    bottom: 12px;
	    left: 12px;
	    width: auto;
	    max-height: 46%;
	  }
}

@media (max-width: 640px) {
	
	  .map-nearby {
	    top: auto;
	    right: 12px;
	    bottom: 12px;
	    left: 12px;
	    width: auto;
	    max-height: 46%;
	  }
}

@media (max-width: 640px) {
	
	  .map-controls { top: 112px; right: 8px; }
}

@media (max-width: 640px) {
	
	  .map-chips { justify-content: flex-start; }
}

