/* 스크롤바 숨기기 */
html, body { overflow-x: hidden; scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

/* ============================================
   제주 2026 — style.css
   Design: Clean Mobile-First, Slate × Coral
   Fonts: DM Sans (body) + Playfair Display (accent)
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@700;900&display=swap');

/* ─── 토큰 ─── */
:root {
  --bg:       #f7f8fa;
  --surface:  #ffffff;
  --surface2: #f2f4f7;
  --border:   #e4e7ec;
  --text:     #111827;
  --text2:    #6b7280;
  --text3:    #9ca3af;

  /* accent palette — jeju teal + coral */
  --teal:     #0ea5a0;
  --teal-lt:  #e0f5f4;
  --coral:    #f25c3d;
  --coral-lt: #fef0ed;
  --amber:    #e8971a;
  --amber-lt: #fef6e0;
  --violet:   #7c3aed;
  --violet-lt:#f0ebff;
  --jade:     #059669;
  --jade-lt:  #dcfce7;
  --slate:    #334155;

  /* region colors */
  --c-east:    #0ea5a0;
  --c-south:   #f25c3d;
  --c-west:    #e8971a;
  --c-city:    #7c3aed;

  --r: 14px;   /* base radius */
  --r-lg: 20px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --shadow:    0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
}

/* ─── 리셋 ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.6; font-size: 15px;
  min-height: 100vh;
}
img { display: block; width: 100%; object-fit: cover; }
button { font-family: inherit; cursor: pointer; }

/* ─── 레이아웃 wrapper ─── */
.wrap { max-width: 480px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { max-width: 720px; } }

/* ─── 섹션 타이틀 ─── */
.sec-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem; font-weight: 700;
  color: var(--text); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.sec-title::after { content:''; flex:1; height:1px; background:var(--border); }

/* ──────────────────────────────
   HERO
────────────────────────────── */
.hero {
  background: var(--slate);
  color: #fff;
  padding: 52px 20px 44px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(14,165,160,.35) 0%, transparent 55%),
    radial-gradient(circle at 10% 80%, rgba(242,92,61,.25) 0%, transparent 50%);
}
.hero-inner { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; }
.hero-year {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 100px; padding: 5px 14px; margin-bottom: 18px;
  backdrop-filter: blur(6px);
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 900; line-height: 1.15; margin-bottom: 10px;
}
.hero-title em { font-style: normal; color: #5eead4; }
.hero-sub {
  font-size: 13.5px; color: rgba(255,255,255,.7);
  line-height: 1.65; max-width: 320px; margin-bottom: 24px;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 100px; padding: 5px 13px;
  font-size: 12px; color: rgba(255,255,255,.85);
  backdrop-filter: blur(4px);
}

/* ──────────────────────────────
   FLIGHT & STAY
────────────────────────────── */
.flight-section { padding: 28px 16px 0; max-width: 480px; margin: 0 auto; }
@media (min-width:640px) { .flight-section { max-width:720px; } }

.flight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flight-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm);
}
.flight-day {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 10px;
}
.flight-route { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.flight-time { font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.flight-city { font-size: 10.5px; color: var(--text2); margin-top: 2px; }
.flight-arrow { font-size: .9rem; color: var(--coral); flex: 1; text-align: center; }
.flight-note {
  font-size: 11.5px; color: var(--text2);
  padding-top: 9px; border-top: 1px dashed var(--border);
}

.stay-card {
  background: var(--slate); color: #fff;
  border-radius: var(--r-lg); padding: 16px 18px;
  margin-top: 10px; display: flex; align-items: center; gap: 14px;
}
.stay-icon { font-size: 1.5rem; flex-shrink: 0; }
.stay-card h3 { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.stay-card p  { font-size: 12px; opacity: .75; }

/* ──────────────────────────────
   DAY PLANNER
────────────────────────────── */
.day-section { padding: 28px 16px 0; max-width: 480px; margin: 0 auto; }
@media (min-width:640px) { .day-section { max-width:720px; } }

.day-blocks { display: flex; flex-direction: column; gap: 10px; }
.day-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.day-block-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.day-block-head:active { background: var(--surface2); }
.day-block-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 100px; margin-bottom: 4px;
}
.day-block-head h3 { font-size: 1rem; font-weight: 700; }
.day-block-head .sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.day-chevron {
  font-size: 11px; color: var(--text3);
  transition: transform .2s; flex-shrink: 0; margin-left: 8px;
}
.day-block.open .day-chevron { transform: rotate(180deg); }
.day-body { display: none; padding: 0 18px 18px; border-top: 1px solid var(--border); }
.day-block.open .day-body { display: block; }

/* 타임라인 */
.timeline { padding-top: 16px; }
.tl-row {
  display: grid;
  /* 시간 52px 고정, dot 16px, 내용 나머지 */
  grid-template-columns: 52px 16px 1fr;
  gap: 0 10px; position: relative; margin-bottom: 0;
  align-items: flex-start;
}
/* 세로선: 절대위치로 dot 중심~다음 dot 중심까지 */
.tl-row::after {
  content: ''; position: absolute;
  left: 68px;          /* 52(시간) + 10(gap) + 8(dot반지름) = 70... 살짝 조정 */
  top: 18px;           /* dot 중심 */
  bottom: -14px;       /* 다음 row와 이어지도록 */
  width: 2px; background: var(--border); z-index: 0;
}
.tl-row:last-child::after, .tl-row.no-line::after { display: none; }
.tl-time {
  font-size: 11px; font-weight: 600; color: var(--teal);
  text-align: right; padding-top: 2px; line-height: 1.5;
  white-space: nowrap;   /* 시간이 줄바꿈 안 되도록 */
  flex-shrink: 0;
}
.tl-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--surface); z-index: 1; position: relative;
  margin-top: 2px; flex-shrink: 0;
  box-shadow: 0 0 0 1.5px var(--border);
}
.tl-dot.d-flight { background: var(--slate); }
.tl-dot.d-food   { background: var(--coral); }
.tl-dot.d-cafe   { background: var(--amber); }
.tl-dot.d-sight  { background: var(--jade); }
.tl-dot.d-move   { background: var(--text3); }
.tl-dot.d-star   { background: #e91e63; }
.tl-text {
  font-size: 13px; padding: 1px 0 18px;
  line-height: 1.55; color: var(--text);
  word-break: keep-all;   /* 한글 단어 중간 줄바꿈 방지 */
}
.tl-text strong { font-weight: 600; }
.tl-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--teal);
  background: var(--teal-lt); border-radius: 100px; padding: 2px 10px;
  margin-top: 4px; text-decoration: none; cursor: pointer;
}
.tl-link:hover { background: #c5eceb; }

/* 옵션 카드 */
.opt-toggle-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1.5px dashed var(--border);
  border-radius: 100px; padding: 5px 14px;
  font-size: 12px; font-weight: 600; color: var(--text2);
  margin: 4px 0 8px 0; transition: all .15s;
}
.opt-toggle-btn.active { border-color: var(--teal); color: var(--teal); background: var(--teal-lt); }
.opt-panel { display: none; }
.opt-panel.open { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.opt-card {
  background: var(--surface2); border-radius: var(--r); padding: 10px 12px;
  border: 1.5px solid var(--border); font-size: 12.5px;
}
.opt-card .opt-label {
  font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text3); margin-bottom: 5px;
}
.opt-card.a { border-left: 3px solid var(--teal); }
.opt-card.b { border-left: 3px solid var(--coral); }
.opt-card li { list-style: none; color: var(--text); padding: 3px 0; line-height: 1.5; word-break: keep-all; }
/* opt-card 안 tl-row 세로선 제거 */
.opt-card .tl-row::after { display: none; }
.opt-card .tl-row { align-items: flex-start; }
.day-note {
  background: var(--surface2); border-radius: var(--r);
  padding: 10px 13px; font-size: 12px; color: var(--text2); margin-top: 8px;
}

/* ──────────────────────────────
   MAP
────────────────────────────── */
.map-section { padding: 28px 16px 0; max-width: 480px; margin: 0 auto; }
@media (min-width:640px) { .map-section { max-width:720px; padding: 28px 24px 0; } }
.map-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow);
}
.map-svg-wrap { position: relative; background: #c5dff0; }
.map-svg-wrap svg {
  display: block; width: 100%;
  /* 모바일 높이 = 화면폭 × (720/1400) 자동계산 */
  height: auto; min-height: 200px;
}

/* 툴팁 */
.map-tip {
  position: absolute; z-index: 20; pointer-events: none;
  background: var(--slate); color: #fff;
  border-radius: 10px; padding: 9px 13px;
  font-size: 12px; line-height: 1.45;
  box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .15s;
  max-width: 200px;
}
.map-tip.show { opacity: 1; }
.map-tip strong { display: block; font-size: 13px; margin-bottom: 3px; }
.map-tip::after {
  content: ''; position: absolute; top: 100%; left: 14px;
  border: 5px solid transparent; border-top-color: var(--slate);
}

/* 지도 핀 */
.mp { cursor: pointer; }
.mp circle { transition: r .15s; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }

/* 범례 */
.map-legend {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--border);
  background: var(--surface); font-size: 11.5px; font-weight: 500;
}
.leg-item { display: flex; align-items: center; gap: 6px; }
.leg-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ──────────────────────────────
   FILTER TABS
────────────────────────────── */
.filter-section { padding: 28px 16px 0; max-width: 480px; margin: 0 auto; }
@media (min-width:640px) { .filter-section { max-width:720px; } }
.region-tabs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.region-tabs::-webkit-scrollbar { display: none; }
.rtab {
  flex-shrink: 0; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 100px; padding: 7px 16px; font-size: 12.5px; font-weight: 600;
  color: var(--text2); transition: all .18s; white-space: nowrap;
}
.rtab:hover { border-color: var(--teal); color: var(--teal); }
.rtab.active { background: var(--slate); border-color: var(--slate); color: #fff; }
.rtab[data-f="east"].active   { background: var(--c-east);   border-color: var(--c-east); }
.rtab[data-f="south"].active  { background: var(--c-south);  border-color: var(--c-south); }
.rtab[data-f="west"].active   { background: var(--c-west);   border-color: var(--c-west); }
.rtab[data-f="city"].active   { background: var(--c-city);   border-color: var(--c-city); }

/* 세부 필터 */
.subfilter-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px;
}
.sfbtn {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 100px; padding: 5px 13px;
  font-size: 12px; font-weight: 500; color: var(--text2); transition: all .15s;
}
.sfbtn.active { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600; }

/* 결과 카운트 */
.result-count {
  font-size: 12px; color: var(--text2); margin-top: 10px;
  font-weight: 500;
}
.result-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text3); font-size: 14px;
}

/* ──────────────────────────────
   PLACE CARDS
────────────────────────────── */
.places-wrap { padding: 14px 16px 0; max-width: 480px; margin: 0 auto; }
@media (min-width:640px) { .places-wrap { max-width:720px; } }

.region-block { margin-bottom: 36px; }
.region-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-lg) var(--r-lg) 0 0;
  margin-bottom: 2px;
}
.region-head.east   { background: var(--teal-lt); }
.region-head.south  { background: var(--coral-lt); }
.region-head.west   { background: var(--amber-lt); }
.region-head.city   { background: var(--violet-lt); }
.region-head-icon { font-size: 1.3rem; }
.region-head h2 { font-size: 1rem; font-weight: 700; }
.region-head p  { font-size: 11.5px; color: var(--text2); margin-top: 1px; }

.place-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 10px; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.place-card:active { transform: scale(.99); }

/* 사진 그리드 */
.card-photos {
  display: grid; grid-template-columns: 2fr 1fr;
  grid-template-rows: 110px 110px; gap: 2px; height: 222px;
}
.card-photos img { height: 100%; }
.card-photos img:first-child { grid-row: 1/3; height: 222px; }

.card-body { padding: 14px 15px 15px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-name { font-size: 1rem; font-weight: 700; line-height: 1.25; }
.card-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  padding: 3px 9px; border-radius: 100px; white-space: nowrap; flex-shrink: 0;
}
.bg-nature  { background: var(--jade-lt);   color: var(--jade); }
.bg-cafe    { background: var(--amber-lt);  color: var(--amber); }
.bg-food    { background: var(--coral-lt);  color: var(--coral); }
.bg-culture { background: #dbeafe;          color: #1d4ed8; }
.bg-art     { background: var(--violet-lt); color: var(--violet); }
.bg-market  { background: var(--jade-lt);   color: var(--jade); }
.bg-pub     { background: #f8fafc;          color: var(--slate); border:1px solid var(--border); }
.bg-shop    { background: var(--amber-lt);  color: var(--amber); }

.card-summary { font-size: 12.5px; color: var(--text2); line-height: 1.6; margin-bottom: 10px; }

.card-info { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.ci { display: flex; gap: 6px; font-size: 11.5px; align-items: flex-start; }
.ci-icon  { font-size: 12px; flex-shrink: 0; margin-top: 1px; }
.ci-label { color: var(--text3); flex-shrink: 0; min-width: 36px; }
.ci-val   { color: var(--text); font-weight: 500; }

.card-menu { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.menu-pill { background: var(--surface2); color: var(--text2); font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 100px; }

/* ──────────────────────────────
   PLACE DETAIL MODAL (일정 클릭 팝업)
────────────────────────────── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 200;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-bg.open { display: flex; }
.modal-sheet {
  background: var(--surface); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 480px; max-height: 85vh;
  overflow-y: auto; padding-bottom: env(safe-area-inset-bottom,16px);
  animation: slideUp .25s cubic-bezier(.16,1,.3,1);
}
@keyframes slideUp { from { transform: translateY(60px); opacity:0; } to { transform: translateY(0); opacity:1; } }
.modal-handle {
  width: 36px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 12px auto 0;
}
.modal-photos { height: 200px; overflow: hidden; }
.modal-photos img { width:100%; height:200px; object-fit:cover; }
.modal-content { padding: 16px 18px 20px; }
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: rgba(0,0,0,.4); color: #fff;
  border: none; border-radius: 100%; width: 28px; height: 28px;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.modal-wrap { position: relative; }

/* ──────────────────────────────
   TIP BOX
────────────────────────────── */
.tip-box {
  background: var(--amber-lt); border: 1px solid #fcd34d;
  border-radius: var(--r-lg); padding: 16px 18px; margin-top: 10px;
}
.tip-box h3 { font-size: .9rem; font-weight: 700; color: #92400e; margin-bottom: 10px; }
.tip-box ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.tip-box li { font-size: 12.5px; color: #78350f; line-height: 1.55; }

/* ──────────────────────────────
   FOOTER
────────────────────────────── */
.footer {
  background: var(--slate); color: rgba(255,255,255,.5);
  text-align: center; padding: 28px 20px; font-size: 12px; margin-top: 36px;
}
.footer strong { color: #fff; }

/* ──────────────────────────────
   MOBILE SAFE AREA
────────────────────────────── */
@media (max-width: 480px) {
  .flight-grid { grid-template-columns: 1fr 1fr; }
  .opt-panel.open { grid-template-columns: 1fr; }
}

/* ── 필터 hidden ── */
.region-block.hidden { display: none; }


/* ── 후기 요약 / 체크포인트 ── */
.card-tip, .card-check {
  display: flex; gap: 9px; align-items: flex-start;
  margin-top: 10px; padding: 10px 12px;
  border-radius: 10px; font-size: 12px; line-height: 1.6;
}
.card-tip  { background: #f0faf9; border: 1px solid #b2e4e0; }
.card-check{ background: #f6f9f0; border: 1px solid #c6ddb0; }
.card-tip  strong { color: var(--teal); }
.card-check strong { color: var(--jade); }
.card-tip p, .card-check p { color: var(--text2); margin-top: 2px; }
.tip-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

/* ── 이미지 클릭 뷰어 ── */
.img-viewer-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.88); z-index: 300;
  align-items: center; justify-content: center;
  padding: 16px;
}
.img-viewer-bg.open { display: flex; }
.img-viewer-bg img {
  max-width: 100%; max-height: 90vh;
  border-radius: 10px; object-fit: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.img-viewer-close {
  position: fixed; top: 16px; right: 16px;
  background: rgba(255,255,255,.15); color: #fff;
  border: none; border-radius: 100%; width: 36px; height: 36px;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.card-photos img { cursor: zoom-in; }

/* ── 지도 폰트·핀 크기 업 (모바일) ── */
@media (max-width: 480px) {
  .map-tip strong { font-size: 14px; }
  .map-tip        { font-size: 12.5px; max-width: 240px; padding: 10px 14px; }
}

/* ── 렌트카 토글 ── */
.rc-body { display: none !important; }
.rc-body.open { display: block !important; }

/* ── 지도 툴팁 화살표 — JS로 left 덮어씀, ::after 제거 ── */
.map-tip::after { display: none; }

/* 툴팁 화살표를 JS-injected pseudo span으로 대체 */
.map-tip-arrow {
  position: absolute;
  width: 0; height: 0;
  border: 6px solid transparent;
  pointer-events: none;
}
.map-tip-arrow.down  { border-top-color:   #334155; top: 100%; }
.map-tip-arrow.up    { border-bottom-color: #334155; bottom: 100%; }

/* ── 지도 컨트롤 바 ── */
.map-controls {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; margin-bottom: 8px;
}
.map-zoom-btns, .map-area-btns {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.map-btn {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 5px 12px; font-size: 13px;
  font-weight: 600; cursor: pointer; color: var(--text);
  font-family: inherit; transition: all .15s; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.map-btn:hover   { border-color: var(--teal); color: var(--teal); }
.map-btn:active  { background: var(--teal-lt); }
.map-area-btn    { font-size: 11.5px; padding: 5px 10px; color: var(--text2); }
.map-area-btn.active { background: var(--teal); border-color: var(--teal); color: white; }

/* SVG 래퍼 — 터치/휠 줌을 위한 overflow 설정 */
.map-svg-wrap {
  overflow: hidden;
  cursor: grab;
  touch-action: none;     /* JS 터치 핸들링 직접 처리 */
  user-select: none;
}
.map-svg-wrap.grabbing { cursor: grabbing; }
.map-svg-wrap svg {
  transform-origin: 0 0;
  will-change: transform;
  transition: transform .25s ease;
  text-rendering: geometricPrecision;
  shape-rendering: geometricPrecision;
}
.map-svg-wrap svg.no-transition {
  transition: none;   /* 드래그/핀치 중에는 transition 끔 */
}
