/**
 * @file docs/css/geo.css
 * @description 여행지 위치 지도(geo.js)의 모양. 슬라이드 그림과 「지도」 탭의 지도 카드가 같이 쓴다.
 *   WebApp Common GUI 「지도」 규칙의 행정구역 보기를 따른다:
 *   - 지도 카드: 표면 색, 1px 테두리, --r-lg, 본체 높이 550px, 지도 본체는 바탕 색
 *   - 조작 묶음: 오른쪽 위 12px, 36px 아이콘 버튼을 세로로, 사이 4px, 묶음 사이 가는 선, 켜진 버튼은 채운 면
 *   - 가리킴 안내: 왼쪽 아래 12px, 글자색 면에 바탕색 글자 / 범례: 오른쪽 아래 12px
 *   - 구역 경계선은 표면 색, 채움은 건수 다섯 단계 진하기(글자색을 표면 색에 섞는다), 가리킨 구역은 글자색 2px
 *   일자별 동선 색은 팔레트 역할 색(--spN-ink / --spN-mid)이라 테마를 바꾸면 같이 바뀐다.
 */

:root {
  --g-l0: color-mix(in srgb, var(--fg) 7%, var(--surface));
  --g-l1: color-mix(in srgb, var(--fg) 18%, var(--surface));
  --g-l2: color-mix(in srgb, var(--fg) 31%, var(--surface));
  --g-l3: color-mix(in srgb, var(--fg) 45%, var(--surface));
  --g-l4: color-mix(in srgb, var(--fg) 60%, var(--surface));
  --g-ctx: color-mix(in srgb, var(--fg) 3%, var(--bg));
  --g-coast: color-mix(in srgb, var(--fg) 42%, var(--surface));
}

/* ---------- 그림 공통 ---------- */
.g-svg { display: block; width: 100%; height: auto; font-family: var(--font-body); user-select: none; }
.g-sea { fill: var(--bg); }
.g-inset { fill: var(--bg); stroke: var(--line); stroke-dasharray: 4 3; }
.g-note { font-size: 11px; fill: var(--muted); }

.g-pf { stroke: none; }
.g-l0 { fill: var(--g-l0); }
.g-l1 { fill: var(--g-l1); }
.g-l2 { fill: var(--g-l2); }
.g-l3 { fill: var(--g-l3); }
.g-l4 { fill: var(--g-l4); }
.g-ctx { fill: var(--g-ctx); }

/* 경계선: 구역 사이는 표면 색, 바닷가는 글자색을 옅게 */
.g-mesh-pref, .g-mesh-region, .g-mesh-muni, .g-mesh-pref2, .g-mesh-coast { fill: none; pointer-events: none; stroke-linejoin: round; }
.g-mesh-pref { stroke: var(--surface); stroke-width: 1.2; }
.g-mesh-region { stroke: var(--surface); stroke-width: 2.4; }
.g-mesh-muni { stroke: var(--surface); stroke-width: 0.8; }
.g-mesh-pref2 { stroke: var(--surface); stroke-width: 2.6; }
.g-mesh-coast { stroke: var(--g-coast); stroke-width: 0.7; }
.g-ctx-line { stroke: color-mix(in srgb, var(--fg) 22%, var(--surface)); }
.g-hover { fill: none; stroke: var(--fg); stroke-width: 2; pointer-events: none; stroke-linejoin: round; }

.g-locator { fill: none; stroke: var(--fg); stroke-width: 1.2; stroke-dasharray: 5 3; pointer-events: none; }
.g-rlabel { font-size: 12px; fill: var(--muted); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.g-rlabel.on { fill: var(--fg); font-weight: 700; }
.g-flight { fill: none; stroke: var(--fg); stroke-width: 1.6; stroke-dasharray: 6 4; }
.g-pt { fill: var(--fg); stroke: var(--surface); stroke-width: 1.5; }
.g-mlabel { font-size: 12px; font-weight: 700; fill: var(--fg); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }

/* 2단계: 현 이름 · 시정촌 이름 · 정류지 이름 — 표면 색 3px 테두리로 어떤 진하기 위에서도 읽히게 한다 */
.g-plabel, .g-slabel, .g-mname, .g-mcount { pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-linejoin: round; }
.g-plabel { font-size: 14px; font-weight: 800; fill: color-mix(in srgb, var(--fg) 72%, var(--surface)); stroke-width: 4px; letter-spacing: 0.04em; }
.g-slabel { font-size: 11px; font-weight: 600; fill: var(--fg); stroke-width: 3px; }
.g-mname { font-size: 10.5px; font-weight: 700; fill: var(--fg); stroke-width: 3px; }
.g-mcount { font-size: 9px; font-weight: 700; fill: var(--muted); stroke-width: 3px; }

/* 일자별 동선: 실선 = 계획 일정, 짧은 점선 = 선택 일정, 긴 점선 = 가이드 별도 숙소 */
.g-leg { fill: none; stroke-width: 2.6; stroke-linecap: round; }
.g-leg.opt { stroke-dasharray: 2 5; stroke-width: 2.2; }
.g-leg.guide { stroke-dasharray: 8 4; stroke-width: 1.6; }
.g-stop .g-mk-s { stroke: var(--surface); stroke-width: 1.5; }
.g-mk-h { fill: var(--fg); stroke: var(--surface); stroke-width: 1.5; }
.g-mk-h.g { fill: var(--surface); stroke: var(--fg); stroke-dasharray: 2 1.5; }
.g-mk-t { fill: var(--surface); font-size: 9.5px; font-weight: 800; pointer-events: none; }
.g-mk-t.g { fill: var(--fg); }
.g-mk-a { fill: var(--fg); stroke: var(--surface); stroke-width: 1.5; }

/* 일자 보기: 고른 날의 동선과 정류지만 진하게 */
.dd { transition: opacity 0.2s; }
svg[data-day="1"] .dd:not([data-d~="1"]),
svg[data-day="2"] .dd:not([data-d~="2"]),
svg[data-day="3"] .dd:not([data-d~="3"]),
svg[data-day="4"] .dd:not([data-d~="4"]) { opacity: 0.12; }

/* ---------- 슬라이드 안의 그림: 오른쪽 칸을 채운다 ---------- */
.slides-doc .map-fig { position: relative; min-height: 0; }
.slides-doc .map-fig > .g-svg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--r-md); }
.slides-doc .map-fig.is-loading::after { content: '지도를 불러오는 중…'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--c-muted, var(--muted)); font-size: 0.85em; }

/* ---------- 「지도」 탭의 지도 카드 ---------- */
.map-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.map-body { height: 550px; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.map-body > .g-svg { width: 100%; height: 100%; }
.map-card .g-pf[data-tip], .map-card .g-stop[data-tip], .map-card .g-leg[data-tip], .map-card .g-flight[data-tip], .map-card .g-pt[data-tip] { cursor: default; }
.map-card[data-level="1"] .g-pf.on, .map-card .g-stop[data-place] { cursor: pointer; }
.map-card .g-stop:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.map-card .g-flight { stroke-width: 2; }

.map-card.is-full { position: fixed; inset: 0; z-index: 900; border-radius: 0; border: 0; display: flex; flex-direction: column; }
.map-card.is-full .map-body { height: auto; flex: 1; }

.map-remote {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  display: flex; flex-direction: column; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.map-ctl {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg); cursor: pointer;
}
.map-ctl:hover { background: var(--active); }
.map-ctl[aria-pressed="true"] { background: var(--fg); color: var(--surface); }
.map-ctl[hidden] { display: none; }
.map-ctl .ico { width: 18px; height: 18px; }
.map-sep { display: block; height: 1px; margin: 0 4px; background: var(--line); }

.map-tip {
  position: absolute; left: 12px; bottom: 12px; z-index: 2; max-width: min(60%, 420px);
  padding: 6px 10px; border-radius: var(--r-md);
  background: var(--fg); color: var(--bg); font-size: 0.82rem; line-height: 1.45; pointer-events: none;
}
.map-legend {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent); font-size: 0.78rem; line-height: 1.5;
  display: flex; flex-direction: column; gap: 2px; min-width: 128px;
}
.map-legend[hidden], .map-tip[hidden] { display: none; }
.ml-head { font-weight: 700; color: var(--muted); font-size: 0.74rem; }
.ml-row { display: flex; align-items: center; gap: 8px; }
.ml-sw { display: inline-block; width: 18px; height: 11px; border-radius: 2px; border: 1px solid var(--line); flex: none; }
.ml-sw.g-l0 { background: var(--g-l0); }
.ml-sw.g-l1 { background: var(--g-l1); }
.ml-sw.g-l2 { background: var(--g-l2); }
.ml-sw.g-l3 { background: var(--g-l3); }
.ml-sw.g-l4 { background: var(--g-l4); }
.ml-line { display: inline-block; width: 22px; height: 3px; border-radius: 2px; background: var(--fg); flex: none; vertical-align: middle; }
.ml-line.dashed { background: repeating-linear-gradient(90deg, var(--fg) 0 6px, transparent 6px 10px); }
.ml-mk { display: inline-block; width: 11px; height: 11px; flex: none; background: var(--fg); }
.ml-mk.round { border-radius: 50%; }
.ml-mk.diamond { width: 8px; height: 8px; margin: 0 1.5px; transform: rotate(45deg); }
.ml-mk.hotel { border-radius: 2px; }

.map-days { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.map-days[hidden] { display: none; }

@media (max-width: 560px) {
  .map-body { height: 420px; }
  .map-legend { font-size: 0.72rem; min-width: 0; }
  .map-tip { max-width: calc(100% - 24px); bottom: auto; top: 12px; right: 64px; }
}
@media print {
  .map-remote, .map-tip { display: none; }
}
