/* 세 지도(A·B·C)가 함께 쓰는 판. 지도 바탕의 색은 각 갈래 파일에서 정한다. */
:root {
  --ink: #1d2422;
  --ink-2: #4b5653;
  --muted: #7a8481;
  --paper: #f6f3ec;
  --card: #fffdf8;
  --line: #dcd5c6;
  --line-2: #ebe5d8;
  --s1: #4f7d5a;   /* 1단계 상시 — 갈대 초록 */
  --s2: #c97d22;   /* 2단계 소규모 공연 — 해 질 녘 호박색 */
  --s3: #c4473a;   /* 3단계 가을 페스티벌 — 노을 빨강 */
  --focus: #1f6f7a;
  --panel-w: 400px;
  --bar-h: 52px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 36, 34, .08), 0 8px 24px rgba(29, 36, 34, .10);
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
button { font: inherit; color: inherit; }
a { color: inherit; }

/* 상단 띠 */
.bar {
  position: fixed; inset: 0 0 auto 0; height: var(--bar-h); z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: rgba(246, 243, 236, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar .virtual {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 4px 8px; border-radius: 999px; border: 1px solid var(--ink); background: var(--card);
}
.bar .brand { font-weight: 800; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .brand small { font-weight: 600; color: var(--muted); font-size: 12px; margin-left: 6px; }
.bar .spacer { flex: 1; }
.variants { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--line-2); flex: none; }
.variants a { text-decoration: none; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; color: var(--ink-2); white-space: nowrap; }
.variants a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.variants a .long { font-weight: 600; }

/* 지도 자리 */
#map { position: fixed; inset: var(--bar-h) 0 0 0; z-index: 1; }

/* 판(데스크톱 왼쪽) */
.panel {
  position: fixed; z-index: 20; top: calc(var(--bar-h) + 12px); left: 12px; bottom: 12px; width: var(--panel-w);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel .grip { display: none; }
.panel .scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.intro { padding: 20px 20px 14px; border-bottom: 1px solid var(--line-2); }
.intro .kicker { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.intro h1 { margin: 6px 0 8px; font-size: 26px; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; }
.intro h1 .tag { display: inline-block; font-size: 11px; font-weight: 700; vertical-align: middle; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; margin-left: 6px; letter-spacing: 0; }
.intro p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }

/* 단계 탭 */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-bottom: 1px solid var(--line-2); }
.stages button {
  border: 0; background: none; padding: 12px 6px 10px; cursor: pointer; text-align: left; border-bottom: 3px solid transparent;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.stages button .n { font-size: 11px; font-weight: 800; color: var(--muted); }
.stages button .t { font-size: 13px; font-weight: 700; line-height: 1.25; }
.stages button[aria-pressed="true"] { border-bottom-color: var(--ink); }
.stages button[data-stage="1"][aria-pressed="true"] { border-bottom-color: var(--s1); }
.stages button[data-stage="2"][aria-pressed="true"] { border-bottom-color: var(--s2); }
.stages button[data-stage="3"][aria-pressed="true"] { border-bottom-color: var(--s3); }
.stages button[data-stage="1"] .n { color: var(--s1); }
.stages button[data-stage="2"] .n { color: var(--s2); }
.stages button[data-stage="3"] .n { color: var(--s3); }
.stage-desc { padding: 12px 20px; font-size: 13px; line-height: 1.55; color: var(--ink-2); background: var(--paper); border-bottom: 1px solid var(--line-2); }
.stage-desc b { color: var(--ink); }

/* 분류 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .glyph { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .7; }
.chip.shuttle .glyph { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed currentColor; background: none; }

/* 장소 목록 */
.list { list-style: none; margin: 0; padding: 6px 8px 16px; }
.list li button {
  width: 100%; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px;
  border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.list li button:hover, .list li button:focus-visible { background: var(--paper); outline: none; }
.list .num { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.list .nm { font-size: 15px; font-weight: 700; line-height: 1.3; }
.list .ct { font-size: 12px; color: var(--muted); margin-top: 1px; }
.pips { display: flex; gap: 3px; }
.pip { width: 18px; height: 18px; border-radius: 5px; font-size: 10px; font-weight: 800; display: grid; place-items: center; color: #fff; }
.pip.s1 { background: var(--s1); } .pip.s2 { background: var(--s2); } .pip.s3 { background: var(--s3); }
.pip.off { background: var(--line-2); color: var(--muted); }
.count { padding: 10px 20px 0; font-size: 12px; color: var(--muted); font-weight: 600; }

/* 장소 카드 */
.card { padding: 0 0 20px; }
.card .back { border: 0; background: none; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 14px 20px 6px; }
.card .head { padding: 4px 20px 14px; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; border-bottom: 1px solid var(--line-2); }
.card .head .num { width: 40px; height: 40px; font-size: 16px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 800; }
.card .head h2 { margin: 0; font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }
.card .head .ct { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card .prog { padding: 8px 20px 4px; }
.card .prog .row { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.card .prog .row:last-child { border-bottom: 0; }
.card .prog .row .lab { font-size: 12px; font-weight: 800; }
.card .prog .row .lab.s1 { color: var(--s1); } .card .prog .row .lab.s2 { color: var(--s2); } .card .prog .row .lab.s3 { color: var(--s3); }
.card .prog .row .tx { font-size: 14px; line-height: 1.5; }
.card .prog .row.dim { opacity: .45; }
.card .sec { padding: 12px 20px 0; }
.card .sec h3 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 800; letter-spacing: .02em; }
.card .sec p, .card .sec li { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.card .sec ul { margin: 0; padding-left: 18px; }
.card .note { margin: 14px 20px 0; padding: 10px 12px; border-radius: 10px; background: var(--paper); font-size: 13px; line-height: 1.5; color: var(--ink-2); border: 1px solid var(--line-2); }
.card .src { padding: 12px 20px 0; font-size: 11px; color: var(--muted); }

/* 오는 길 */
.route { margin: 8px 20px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.route b { color: var(--ink); }

/* 지도 위 조작 안내·출처 */
.attrib { position: fixed; right: 10px; bottom: 8px; z-index: 15; font-size: 10px; color: var(--ink-2); background: rgba(255, 253, 248, .8); padding: 2px 6px; border-radius: 6px; }
.zoomctl { position: fixed; right: 14px; top: calc(var(--bar-h) + 14px); z-index: 15; display: flex; flex-direction: column; gap: 6px; }
.zoomctl button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); display: grid; place-items: center; }
.zoomctl button.light { background: var(--card); color: var(--ink); border: 1px solid var(--line); font-size: 12px; }

/* 폰: 판을 아래 시트로 */
@media (max-width: 760px) {
  :root { --bar-h: 48px; }
  .bar { padding: 0 12px; gap: 8px; }
  .bar .brand small { display: none; }
  .variants a .long { display: none; }
  .bar .brand { font-size: 14px; }
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 86vh; height: 86dvh; border-radius: 18px 18px 0 0;
    transform: translateY(calc(100% - var(--peek, 168px))); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    border-bottom: 0;
  }
  .panel.dragging { transition: none; }
  .panel .grip { display: block; padding: 8px 0 2px; cursor: grab; touch-action: none; }
  .panel .grip::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto; }
  .intro { padding: 6px 16px 10px; }
  .intro h1 { font-size: 20px; margin: 2px 0 4px; }
  .intro p { display: none; }
  .panel[data-snap="full"] .intro p { display: block; }
  .stages button { padding: 10px 4px 8px; }
  .stages button .t { font-size: 12px; }
  .chips { padding: 10px 16px; overflow-x: auto; flex-wrap: nowrap; }
  .chip { flex: none; }
  .stage-desc { padding: 10px 16px; }
  .zoomctl { top: calc(var(--bar-h) + 10px); right: 10px; }
  .attrib { bottom: auto; top: calc(var(--bar-h) + 6px); left: 8px; right: auto; max-width: calc(100% - 76px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
