/* 제주 여행 안내서 — 공통 스타일
   모바일 세로(390px) 기준으로 설계. 어르신이 보는 화면이라 글씨를 크게 잡았습니다. */

:root {
  --bg: #FBF7F0;
  --bg-card: #FFFFFF;
  --ink: #2A2622;
  --ink-soft: #6B6259;
  --line: #E5DCCE;

  --sea: #14707F;
  --sea-light: #D6EDF0;
  --citrus: #E07B12;
  --citrus-light: #FCEBD6;
  --songi: #B44A33;
  --songi-light: #F8E2DC;
  --forest: #37704B;
  --forest-light: #DCEEE1;
  --sky: #2F6BA8;
  --sky-light: #DCE8F5;
  --gray: #8A8078;
  --gray-light: #EFEAE2;

  --r: 14px;
  --shadow: 0 1px 2px rgba(42,38,34,.06), 0 6px 18px rgba(42,38,34,.07);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ── 헤더 ─────────────────────────────────────── */
.hd {
  flex: 0 0 auto;
  padding: 14px 18px 0;
  background: var(--bg);
}
.hd-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hd h1 {
  margin: 0;
  font-size: 21px; font-weight: 800; letter-spacing: -.02em;
}
.hd .sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.hd .swap {
  font-size: 13px; font-weight: 600; color: var(--sea);
  text-decoration: none; white-space: nowrap;
  padding: 6px 10px; border: 1.5px solid var(--sea); border-radius: 999px;
}

/* 날짜 탭 — 손가락으로 누르는 곳이라 크게 */
.tabs {
  display: flex; gap: 8px;
  margin: 12px 0 10px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; min-width: 74px; min-height: 56px;
  border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--bg-card); color: var(--ink-soft);
  font-family: inherit; font-size: 15px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; cursor: pointer;
  transition: transform .25s var(--ease), background .25s var(--ease),
              border-color .25s var(--ease), color .25s var(--ease);
}
.tab .wd { font-size: 12px; font-weight: 600; opacity: .8; }
.tab[aria-selected="true"] {
  background: var(--sea); border-color: var(--sea); color: #fff;
  transform: translateY(-2px);
}
.tab:active { transform: scale(.96); }

/* ── 지도 ─────────────────────────────────────── */
/* 일정을 위로 올리면 지도가 따라 줄어듭니다.
   높이는 app.js 가 스크롤에 맞춰 --map-h 로 넣습니다. */
.map-wrap {
  flex: 0 0 auto;
  height: var(--map-h, 42vh);
  margin: 0 14px;
  position: relative;
  border-radius: 18px; overflow: hidden;
  background: var(--sea-light);
  box-shadow: var(--shadow);
}
#map { position: absolute; inset: 0; }

.map-badge {
  position: absolute; left: 12px; bottom: 12px; z-index: 500;
  background: #fff;
  border-radius: 999px; padding: 5px 12px;
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
  pointer-events: none;
}

/* 지도 위 핀 (B안 SVG / A안 divIcon 공통)
   바깥 .pin 은 44x44 터치 영역, 안쪽 .dot 이 눈에 보이는 원입니다. */
.pin {
  --c: var(--sea);
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: none; border: none;
  animation: pin-in .45s var(--ease) both;
}
.pin .dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--c); color: #fff;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(42,38,34,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; line-height: 1;
  transition: transform .2s var(--ease);
}
.pin.is-active { z-index: 900; }
.pin.is-active .dot { transform: scale(1.32); }
@keyframes pin-in {
  from { opacity: 0; transform: translateY(-14px) scale(.4); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.pin[data-kind="food"]  { --c: var(--citrus); }
.pin[data-kind="spot"]  { --c: var(--sea); }
.pin[data-kind="trail"] { --c: var(--forest); }
.pin[data-kind="stay"]  { --c: var(--songi); }
.pin[data-kind="move"]  { --c: var(--gray); }

/* B안 지도 위 지명 — SVG 밖 HTML 이라 확대해도 글씨 크기가 그대로입니다 */
.vlabel {
  position: absolute; z-index: 5;
  transform: translate(-50%, -50%);
  font-size: 11.5px; font-weight: 700; letter-spacing: -.02em;
  color: #7A6E5E; white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 3px #F4EFE3, 0 0 6px #F4EFE3;
}
.vlabel.city { font-size: 13.5px; color: #55493B; }
.vlabel.peak {
  font-size: 13px; color: #245234;
  text-shadow: 0 0 3px #E9E3D4, 0 0 6px #E9E3D4;
}
.vlabel.peak::before {
  content: '▲'; display: block; font-size: 15px; line-height: 1;
  margin-bottom: 1px; color: #4C8A62;
}

/* ── 일정 리스트 ───────────────────────────────── */
.sheet {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px 40px;
}
.day-note {
  background: var(--citrus-light);
  border-left: 4px solid var(--citrus);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 14.5px; line-height: 1.5;
  margin: 0 0 14px;
}

.card {
  background: var(--bg-card);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 13px 15px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  animation: card-in .4s var(--ease) both;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.card.is-active { border-color: var(--sea); border-width: 2.5px; padding: 12px 14px; }
.card:active { transform: scale(.99); }
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.c-top { display: flex; align-items: center; gap: 10px; }
.c-time {
  font-size: 15px; font-weight: 800; color: var(--sea);
  font-variant-numeric: tabular-nums; flex: 0 0 auto;
}
.c-kind {
  font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--gray-light); color: var(--ink-soft); flex: 0 0 auto;
}
.c-kind[data-kind="food"]   { background: var(--citrus-light); color: #8A4B04; }
.c-kind[data-kind="spot"]   { background: var(--sea-light);    color: #0C5561; }
.c-kind[data-kind="trail"]  { background: var(--forest-light); color: #245234; }
.c-kind[data-kind="stay"]   { background: var(--songi-light);  color: #7E3020; }
.c-kind[data-kind="flight"] { background: var(--sky-light);    color: #1E4C7A; }

.c-name { margin: 6px 0 0; font-size: 18.5px; font-weight: 700; letter-spacing: -.01em; }
.c-desc { margin: 5px 0 0; font-size: 15.5px; color: var(--ink-soft); line-height: 1.55; }
.c-tip {
  margin: 9px 0 0; padding: 8px 11px;
  background: var(--sea-light); border-radius: 9px;
  font-size: 14.5px; line-height: 1.5; color: #0C5561;
}
.c-warn {
  margin: 9px 0 0; padding: 8px 11px;
  background: var(--songi-light); border-radius: 9px;
  font-size: 14.5px; line-height: 1.5; color: #7E3020; font-weight: 600;
}

/* 버튼 — 최소 44px 높이 */
.c-acts { display: flex; gap: 8px; margin-top: 11px; }
.btn {
  flex: 1;
  min-height: 46px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 11px; border: none;
  font-family: inherit; font-size: 15.5px; font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), filter .15s var(--ease);
}
.btn:active { transform: scale(.97); filter: brightness(.95); }
.btn-map { background: var(--sea); color: #fff; }
.btn-tel { background: var(--citrus); color: #fff; }

/* 교통 요약 */
.transport {
  margin: 16px 0 0; padding: 13px 15px;
  background: var(--forest-light); border-radius: var(--r);
  font-size: 14.5px; line-height: 1.55;
}
.transport b { display: block; font-size: 15.5px; margin-bottom: 4px; color: #245234; }
.transport .alt { margin-top: 7px; color: var(--ink-soft); font-size: 13.5px; }

.foot { margin: 20px 4px 0; font-size: 12.5px; color: var(--gray); line-height: 1.6; }

/* 데스크톱에서는 폭을 묶어 폰처럼 */
@media (min-width: 720px) {
  body { align-items: center; }
  .hd, .map-wrap, .sheet { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
