/* 테마 색상은 map-app.js가 data.js의 theme 값으로 --primary를 덮어쓴다 */
:root {
  --primary: #e8590c;
  --ink: #17181a;
  --ink-soft: #5c6166;
  --ink-mute: #8b9096;
  --line: #ebedf0;
  --bg: #f6f7f8;
  --card: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  letter-spacing: -0.3px;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.page { max-width: 560px; margin: 0 auto; background: var(--card); min-height: 100%; }

/* ── 1. 히어로 ─────────────────────────────────── */
.hero { background: var(--card); }
.hero-photo { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #eef0f2; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-text { padding: 20px 20px 4px; }
.hero-text h1 {
  font-size: 24px; font-weight: 800; letter-spacing: -0.9px; line-height: 1.28;
}
.hero-text h1 .accent { color: var(--primary); }
.hero-text .tagline {
  margin-top: 8px; font-size: 15px; color: var(--ink-soft); line-height: 1.55;
}
.hero-text .subtitle {
  margin-top: 8px; font-size: 12.5px; color: var(--ink-mute); line-height: 1.5;
}

/* ── 공통 섹션 ─────────────────────────────────── */
.sec { padding: 22px 20px; border-top: 8px solid var(--bg); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sec-title {
  font-size: 17px; font-weight: 800; letter-spacing: -0.5px; color: var(--ink);
}

/* ── 2. 오시는 길 ──────────────────────────────── */
.addr-row {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  background: var(--bg); border-radius: 12px; padding: 13px 14px;
}
.addr-text { flex: 1; font-size: 15px; font-weight: 600; color: var(--ink); word-break: keep-all; }
.addr-copy {
  flex-shrink: 0; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 9px; padding: 8px 13px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit; letter-spacing: -0.3px;
}
.addr-copy:active { background: var(--bg); }

.nav-lead { margin-top: 16px; font-size: 13px; color: var(--ink-mute); }
.nav-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 9px; }
.nav-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 14px 4px; border-radius: 12px; text-decoration: none;
  font-size: 14px; font-weight: 700; letter-spacing: -0.4px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.nav-btn:active { transform: translateY(1px); }
.nav-kakao { background: #fee500; border-color: #fee500; color: #191600; }
.nav-naver { background: #03c75a; border-color: #03c75a; color: #fff; }
.nav-tmap  { background: #1b1b1b; border-color: #1b1b1b; color: #fff; }

/* ── 3. 꼭 알아두세요 ──────────────────────────── */
.sec-notice { background: #fffaf3; border-top-color: var(--bg); }
.sec-notice .sec-title::before { content: "⚠️ "; }
.notice-list { margin-top: 12px; list-style: none; }
.notice-list li {
  position: relative; padding: 12px 14px 12px 40px; margin-bottom: 8px;
  background: #fff; border: 1px solid #ffe8cc; border-radius: 12px;
  font-size: 14.5px; color: #6b4a1f; line-height: 1.6; word-break: keep-all;
}
.notice-list li::before {
  content: "!"; position: absolute; left: 13px; top: 12px;
  width: 19px; height: 19px; border-radius: 50%;
  background: #e8890c; color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.notice-list li:last-child { margin-bottom: 0; }

/* ── 4. 지도 ───────────────────────────────────── */
.chips-wrap { position: relative; margin-top: 12px; }
.chips-wrap::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 26px;
  background: linear-gradient(to right, rgba(255,255,255,0), #fff);
  pointer-events: none;
}
.chips {
  display: flex; gap: 6px; overflow-x: auto; padding-right: 18px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 20px;
  padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; cursor: pointer; transition: all .15s;
  font-family: inherit; letter-spacing: -0.3px;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.map-expand {
  flex-shrink: 0; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 8px; padding: 6px 11px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; letter-spacing: -0.3px;
}
.map-box {
  position: relative; margin-top: 12px; height: 58vh; min-height: 320px;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
}
#map { width: 100%; height: 100%; background: #e9edf0; }
.map-close {
  position: absolute; top: 12px; right: 12px; z-index: 1200;
  border: none; background: rgba(20,20,20,0.82); color: #fff;
  border-radius: 20px; padding: 9px 16px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.map-hint { margin-top: 9px; font-size: 12.5px; color: var(--ink-mute); text-align: center; }

/* 지도 크게 보기 */
body.map-full { overflow: hidden; }
body.map-full .map-box {
  position: fixed; inset: 0; height: 100vh; margin: 0;
  border-radius: 0; border: none; z-index: 1150;
}

/* ── 5. 장소 목록 ──────────────────────────────── */
.list-group {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 800; color: var(--ink-soft);
  margin: 20px 0 9px;
}
.list-group:first-child { margin-top: 14px; }
.list-group .dot { width: 8px; height: 8px; border-radius: 50%; }

.list-item {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 13px; padding: 13px 13px; margin-bottom: 8px;
  cursor: pointer; font-family: inherit; letter-spacing: -0.3px;
  position: relative;
}
.list-item:active { background: var(--bg); }
.li-icon, .li-booth {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.li-booth { font-size: 12px; font-weight: 800; }
.li-emoji { font-size: 17px; }
.li-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.li-name { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.li-meta { font-size: 12.5px; }
.li-hours { color: var(--ink-mute); }
.li-desc {
  font-size: 13px; color: var(--ink-soft); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.li-go {
  flex-shrink: 0; align-self: center; font-size: 11.5px; font-weight: 700;
  color: var(--primary); white-space: nowrap;
}

/* 운영 상태 (카드·목록 공통) */
.st-open   { color: #2b8a3e; font-weight: 700; }
.st-closed { color: #c92a2a; font-weight: 700; }
.st-before { color: #e8890c; font-weight: 700; }

/* ── 6. 문의 ───────────────────────────────────── */
.contact-btn {
  display: block; margin-top: 12px; text-align: center; text-decoration: none;
  background: var(--primary); color: #fff; border-radius: 13px;
  padding: 16px; font-size: 15.5px; font-weight: 700; letter-spacing: -0.4px;
}

.page-foot {
  padding: 26px 20px 34px; text-align: center;
  font-size: 12px; color: var(--ink-mute); border-top: 8px solid var(--bg);
}

/* ── 상세 카드 ─────────────────────────────────── */
.card {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1300;
  max-width: 536px; margin: 0 auto;
  background: #fff; border-radius: 18px; padding: 16px;
  box-shadow: 0 6px 30px rgba(0,0,0,0.28);
  transform: translateY(140%); transition: transform .26s ease;
  max-height: 70vh; overflow-y: auto;
}
.card.show { transform: translateY(0); }
.card .photo {
  margin: -16px -16px 12px; border-radius: 18px 18px 0 0; overflow: hidden;
  height: 160px; background: var(--bg);
}
.card .photo img { width: 100%; height: 160px; object-fit: cover; display: block; }
.card .cat-badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 10px; color: #fff; margin-bottom: 6px;
}
.card h2 {
  font-size: 18.5px; font-weight: 800; color: var(--ink); letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.card h2 .booth-no {
  font-size: 12px; background: var(--bg); color: var(--ink-soft);
  border-radius: 6px; padding: 2px 7px; font-weight: 800;
}
.card .hours { font-size: 13px; margin-top: 5px; color: var(--ink-soft); }
.card .desc {
  font-size: 13.5px; color: var(--ink-soft); margin-top: 8px;
  line-height: 1.65; white-space: pre-line;
}
.card .btns { display: flex; gap: 8px; margin-top: 14px; }
.card .btns a {
  flex: 1; text-align: center; padding: 12px 0; border-radius: 11px;
  font-size: 14.5px; font-weight: 700; text-decoration: none;
}
.btn-call { background: var(--bg); color: var(--ink); }
.btn-navi { background: var(--primary); color: #fff; }
.card .close {
  position: absolute; top: 10px; right: 12px; z-index: 5; border: none;
  background: rgba(255,255,255,0.9); border-radius: 50%; width: 30px; height: 30px;
  font-size: 15px; color: var(--ink-soft); cursor: pointer;
}
.card-icon { display: inline-flex; align-items: center; }
.card-icon svg { width: 20px; height: 20px; }

/* ── 핀 ────────────────────────────────────────── */
.icon-pin, .emoji-pin, .booth-pin {
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.30), 0 0 0 1px rgba(0,0,0,0.05);
}
.icon-pin  { width: 34px; height: 34px; border-radius: 50% 50% 50% 5px; }
.emoji-pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 5px; font-size: 16px; }
.booth-pin { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; font-weight: 800; color: #fff; }
.icon-pin svg { display: block; }

/* ── 구역 라벨 ─────────────────────────────────── */
.zone-label {
  background: none; border: none; box-shadow: none;
  font-size: 13px; font-weight: 700; pointer-events: none;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}

/* 래스터 폴백일 때만 적용 — 배경 채도를 낮춰 핀이 두드러지게 */
.basemap-muted { filter: saturate(0.35) brightness(1.06) contrast(0.92); }

/* ── 토스트 ────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(8px);
  z-index: 1400; background: rgba(20,20,20,0.9); color: #fff;
  padding: 11px 18px; border-radius: 22px; font-size: 13.5px; font-weight: 600;
  opacity: 0; transition: opacity .22s ease, transform .22s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 좌표 입력 모드 (?edit=1) ──────────────────── */
.edit-bar {
  position: fixed; bottom: 12px; left: 12px; right: 12px; z-index: 1500;
  background: #212529; color: #fff; border-radius: 12px;
  padding: 10px 14px; font-size: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.edit-coord {
  margin-top: 6px; font-family: Consolas, monospace; font-size: 14px;
  background: #343a40; border-radius: 8px; padding: 6px 10px; user-select: all;
}

/* ── 데이터 오류 안내 ──────────────────────────── */
.error-overlay {
  position: fixed; inset: 0; z-index: 2000; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.error-box {
  max-width: 420px; background: #fff; border: 1px solid #ffe3e3;
  border-radius: 16px; padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.error-box h2 { font-size: 18px; color: #c92a2a; margin-bottom: 8px; }
.error-box p { font-size: 14px; color: #495057; margin-bottom: 8px; }
.error-box ul { margin: 0 0 12px 20px; font-size: 13px; color: #333; line-height: 1.8; }
.error-hint { font-size: 12px; color: var(--ink-mute); }
