/* 지도 페이지 전용 스타일 (map.php에서만 로드) */

.map-page { padding-top: 32px; padding-bottom: 24px; }

.map-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.map-back {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  transition: color .15s;
}
.map-back:hover { color: var(--ink); }
.map-head h1 { font-size: clamp(24px, 3.4vw, 32px); }
.map-meta { color: var(--ink-3); font-size: 14px; font-weight: 600; }

/* ── 노선 칩 스트립 ─────────────────────────── */
.line-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.line-chips::-webkit-scrollbar { display: none; }

.line-chip {
  --line-c: var(--navy);
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-1);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.line-chip:hover { transform: translateY(-1px); color: var(--ink); }
.line-chip i {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--line-c);
  flex: none;
}
.line-chip b { font-weight: 800; color: var(--line-c); }
.line-chip.on {
  background: var(--line-c);
  border-color: var(--line-c);
  color: #fff;
}
.line-chip.on i { background: #fff; }
.line-chip.on b { color: #fff; }

/* ── 지도 스테이지 ──────────────────────────── */
.map-stage {
  position: relative;
  height: min(72vh, 640px);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
#metroMap {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#metroMap.dragging { cursor: grabbing; }
#metroMap:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

/* 줌 버튼 */
.map-zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-zoom button {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-1);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.map-zoom button:hover { background: var(--navy); color: #fff; }

/* 역 툴팁 */
.map-tooltip {
  position: absolute;
  z-index: 5;
  max-width: 260px;
  background: var(--navy);
  color: #fff;
  border-radius: 12px;
  box-shadow: var(--sh-2);
  padding: 10px 14px;
  font-size: 14px;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
}
.map-tooltip::after {
  content: '';
  position: absolute;
  left: 50%; top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--navy);
}
.map-tooltip .t-name { font-weight: 800; font-size: 15px; }
.map-tooltip .t-sub { color: rgba(255,255,255,.72); font-size: 12.5px; }
.map-tooltip .t-lines {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.map-tooltip .t-lines i {
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 800;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* 로딩/에러 오버레이 */
.map-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
  z-index: 6;
}
.map-status .spinner {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--navy);
  animation: map-spin .8s linear infinite;
}
@keyframes map-spin { to { transform: rotate(360deg); } }
.map-status button {
  padding: 9px 22px;
  border-radius: 999px;
  border: 0;
  background: var(--navy);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.map-hint {
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .map-page { padding-top: 20px; }
  .map-stage { height: 62vh; }
  .map-zoom button { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .map-status .spinner { animation-duration: 2s; }
}
