/* =========================================================
   Local Lab — 공통 스타일
   기기 대응: 폴더블 커버(280px~) · 휴대폰 · 펼친 폴더블/태블릿
             · 데스크톱 · 듀얼 화면(Surface Duo, 폴더블 분할 모드)
   ========================================================= */
:root {
  --page: #dde9fb;
  --white: #ffffff;
  --cream: #fff6c7;
  --lilac: #e9c9ff;
  --sky: #e2edfc;
  --plum: #5b1236;
  --plum-2: #7a1d4b;
  --ink: #5b1236;
  --ink-soft: #7d4a62;
  --radius: 22px;
  --gap: 14px;
  --pad: 16px;
  --display: "Bricolage Grotesque", "Noto Sans KR", system-ui, sans-serif;
  --body: "Noto Sans KR", system-ui, -apple-system, sans-serif;
  /* 듀얼 화면 값 (기본은 단일 화면) */
  --seg-a: 1fr;
  --seg-b: 1fr;
  --hinge: var(--gap);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 4vw, 44px); font-weight: 800; }
h3 { font-size: clamp(19px, 2.2vw, 26px); font-weight: 800; }
p { margin: 0; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
button { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); font-size: 14px; }

.container {
  max-width: 1240px; margin: 0 auto;
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}
section.container { margin-top: var(--gap); }
.card { border-radius: var(--radius); padding: clamp(18px, 3vw, 36px); }

.bg-white { background: var(--white); }
.bg-cream { background: var(--cream); }
.bg-lilac { background: var(--lilac); }
.bg-sky { background: var(--sky); }
.bg-plum { background: var(--plum); color: var(--cream); }

/* 두 칸 레이아웃 (듀얼 화면에서는 힌지 기준으로 나뉨) */
.split { display: grid; grid-template-columns: var(--seg-a) var(--seg-b); column-gap: var(--hinge); row-gap: var(--gap); }

/* ---------- NAV ---------- */
.nav-wrap {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding-top: env(safe-area-inset-top);
}
.nav {
  max-width: 1240px; margin: 0 auto; position: relative;
  padding: 12px max(var(--pad), env(safe-area-inset-right)) 12px max(var(--pad), env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 20px; text-decoration: none; white-space: nowrap; }
.logo svg { width: 22px; height: 22px; flex: none; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; align-items: center; }
.menu a { text-decoration: none; font-weight: 500; font-size: 15px; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; background: var(--plum); color: var(--cream) !important; padding: 6px 18px; border-radius: 999px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: transform .15s; }
.pill-cream { background: var(--cream); color: var(--plum) !important; }
.pill-outline { background: transparent; border: 1.5px solid var(--cream); }
.pill-lg { font-size: 20px; padding: 10px 30px; min-height: 52px; }
.menu-btn { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 11px; color: var(--ink); }
.menu-btn span { display: block; height: 2px; background: currentColor; margin: 6px 0; transition: transform .2s; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- HERO ---------- */
.hero { --seg-a: 1fr; --seg-b: 2fr; margin-top: 4px; }
.hero-left { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.hero-copy { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 360px; }
.hero h1 { font-size: clamp(56px, 9vw, 132px); font-weight: 800; letter-spacing: -0.04em; line-height: 0.9; }
.hero h1.h1-ko { line-height: 1.04; letter-spacing: -0.03em; }
.hero-sub { font-size: 16px; font-weight: 500; }
.eyebrow { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .14em; margin-bottom: 12px; opacity: .8; }
.hero-art { padding: 0; overflow: hidden; position: relative; min-height: 440px; }
.hero-art > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-badge { position: absolute; right: 18px; bottom: 18px; left: auto; display: flex; gap: 10px; align-items: center; background: var(--white); border-radius: 16px; padding: 10px 16px; font-size: 13px; line-height: 1.35; max-width: calc(100% - 36px); }
.hero-badge svg { width: 28px; height: 28px; flex: none; }
.hero-cta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 28px; min-height: 64px; font-family: var(--display); font-weight: 700; font-size: clamp(18px, 2vw, 22px); text-decoration: none; transition: background .2s; }
.hero-cta span { transition: transform .2s; }

/* ---------- WHY ---------- */
.why { display: grid; gap: 24px; }
.why-lines { font-size: 15px; }
.why-head { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
/* 가로로 이어지는 색 카드 (마지막 카드는 살짝 잘려 보여 넘겨볼 수 있음) */
.why-cards {
  list-style: none; margin: 0; padding: 0 0 4px;
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * var(--gap)) / 2.7);
  gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.why-cards::-webkit-scrollbar { display: none; }
.why-cards li { scroll-snap-align: start; border-radius: 18px; padding: clamp(18px, 2.5vw, 28px); min-height: 170px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.why-cards b { font-family: var(--display); font-size: clamp(20px, 2.4vw, 28px); font-weight: 500; line-height: 1.15; }
.why-cards span { font-size: 13px; }

/* ---------- STATS ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); align-items: end; }
.stat { border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat strong { font-family: var(--display); font-size: clamp(36px, 5.5vw, 72px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.stat span { font-size: 13px; font-weight: 500; }
.h1 { height: 300px; } .h2 { height: 220px; } .h3 { height: 340px; } .h4 { height: 180px; }

/* ---------- PLAN FORM ---------- */
.plan { --seg-a: 1fr; --seg-b: 1.1fr; margin-top: 22px; align-items: start; }
.plan-title { font-size: clamp(52px, 8vw, 116px); color: var(--lilac); letter-spacing: -0.04em; line-height: 1.04; }
.plan-form { color: var(--plum); display: grid; gap: 14px; min-width: 0; }
.plan-form h3 { font-size: 22px; }
.plan-form > p { font-size: 15px; }
fieldset { border: 0; padding: 0; margin: 6px 0; display: grid; gap: 4px; min-width: 0; }
fieldset label { display: flex; gap: 10px; align-items: center; font-size: 15px; cursor: pointer; min-height: 40px; }
fieldset label b { margin-right: 4px; white-space: nowrap; min-width: 4.2em; }
input[type="checkbox"] { width: 20px; height: 20px; flex: none; accent-color: var(--plum); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 4px; font-size: 13px; font-weight: 700; min-width: 0; }
.field input, .field select { font: inherit; font-weight: 400; font-size: 16px; color: var(--plum); background: transparent; border: 0; border-bottom: 1.5px solid var(--plum); padding: 10px 2px; border-radius: 0; width: 100%; min-height: 44px; }
.field input:focus, .field select:focus { outline: none; border-bottom-width: 3px; }
.field input.is-bad { border-bottom-color: #c0263f; }
.btn-plum { font: inherit; font-weight: 700; font-size: 16px; background: var(--plum); color: var(--cream); border: 0; padding: 14px; min-height: 50px; border-radius: 999px; cursor: pointer; margin-top: 6px; transition: background .2s; }
.form-msg { font-size: 14px; font-weight: 700; min-height: 1.4em; }

/* ---------- TESTIMONIAL ---------- */
.quote-card { position: relative; margin: 22px 0 0; padding: 0; overflow: hidden; min-height: 460px; display: flex; align-items: flex-end; }
.quote-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.quote { position: relative; margin: clamp(16px, 3vw, 32px); padding: 24px 28px; border-radius: 18px; max-width: 420px; }
.quote p { font-family: var(--display); font-size: clamp(17px, 2vw, 22px); font-weight: 500; line-height: 1.4; }
.quote figcaption { margin-top: 12px; font-size: 13px; }

/* ---------- SECTION HEAD + CHIPS ---------- */
.section-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; padding: 36px 4px 18px; }
.section-head .muted { max-width: 460px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 14px; font-weight: 500; border: 1.5px solid var(--plum); background: transparent; color: var(--plum); padding: 6px 16px; min-height: 40px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s; }
.chip.is-on { background: var(--plum); color: var(--cream); }

/* ---------- DESTINATIONS ---------- */
.dest-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); grid-auto-flow: dense; }
.dest { display: flex; flex-direction: column; gap: 14px; min-height: 250px; min-width: 0; transition: transform .2s; }
.dest.wide { grid-column: span 2; }
.dest.tall { grid-row: span 2; }
.dest p { font-size: 14.5px; }
.dest-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; flex-wrap: wrap; }
.tag { background: rgba(255,255,255,.7); padding: 3px 10px; border-radius: 999px; }
.bg-plum .tag { background: rgba(255,246,199,.15); }
.bg-white .tag { background: var(--sky); }
.days { opacity: .75; }
.dest.tall h3 { font-size: clamp(26px, 3vw, 40px); margin-top: auto; }
.link-light, .link-dark { font-weight: 700; text-decoration: none; }
.link-dark { margin-top: auto; }
.dest.is-hidden { display: none; }
.empty { text-align: center; padding: 40px; font-weight: 500; }

/* ---------- GUIDES ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.guide { display: flex; flex-direction: column; gap: 14px; }
.guide .num { font-family: var(--display); font-weight: 800; font-size: 15px; background: var(--lilac); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.guide p { font-size: 14.5px; color: var(--ink-soft); }

/* ---------- BUDGET ---------- */
.budget { margin-top: 22px; display: grid; gap: 12px; }
.budget-bars { display: grid; grid-template-columns: 2fr 1.35fr 1fr 0.85fr; gap: var(--gap); align-items: end; margin-top: 20px; }
.bar { border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bar strong { font-family: var(--display); font-size: clamp(34px, 5vw, 68px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin-bottom: 8px; }
.bar b { font-size: 14px; }
.bar span { font-size: 12.5px; color: var(--ink-soft); }
.b1 { height: 320px; } .b2 { height: 250px; } .b3 { height: 200px; } .b4 { height: 170px; }
.budget-total { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 4px; padding: 24px 32px; }
.budget-total > span { font-family: var(--display); font-size: clamp(22px, 3vw, 34px); font-weight: 700; }
.budget-total small { font-size: 14px; font-weight: 400; opacity: .75; }
.btn-pair { display: flex; flex-direction: column; gap: 8px; }
.trust { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 13px; color: var(--ink-soft); }

/* ---------- CLOSING ---------- */
.closing { position: relative; overflow: hidden; padding: 0; min-height: 560px; margin-top: 22px; background: var(--cream); border: 10px solid var(--cream); }
.closing-photo { border-radius: calc(var(--radius) - 8px); }
.closing::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: calc(var(--radius) - 8px); background: linear-gradient(180deg, rgba(35, 8, 22, .62) 0%, rgba(35, 8, 22, .25) 45%, rgba(35, 8, 22, 0) 70%); }
.closing-in { position: relative; z-index: 2; --seg-a: 1.2fr; --seg-b: 1fr; padding: clamp(22px, 4vw, 44px); color: var(--white); align-items: start; }
.closing-in h2 { font-size: clamp(34px, 5vw, 64px); font-weight: 500; letter-spacing: -0.03em; }
.closing-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; font-size: 13.5px; line-height: 1.6; }
.closing-cols b { display: block; margin-bottom: 4px; }

/* ---------- FOOTER ---------- */
.site-footer { background: var(--plum); color: var(--cream); margin-top: var(--gap); padding: 48px 0 max(36px, env(safe-area-inset-bottom)); }
.footer-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.logo-xl { font-size: clamp(40px, 7vw, 88px); gap: 14px; letter-spacing: -0.03em; }
.logo-xl svg { width: 0.8em; height: 0.8em; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 40px; font-size: 13.5px; }
.footer-cols > div { display: grid; gap: 6px; align-content: start; }
.footer-cols a { text-decoration: none; opacity: .9; }
.footer-copy { opacity: .7; }

/* 예전 단순 푸터 (부산 페이지) */
.footer { margin: var(--gap) auto 24px; }
.footer-in { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 14px; }
.feature { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; text-decoration: none; margin-top: 22px; }
.feature h2 { color: var(--lilac); margin-bottom: 10px; }

/* =========================================================
   부산 페이지
   ========================================================= */
.weather { position: absolute; left: 18px; bottom: 18px; padding: 14px 18px; border-radius: 16px; display: grid; gap: 2px; max-width: calc(100% - 36px); }
.w-label { font-size: 12px; font-weight: 700; opacity: .7; }
.w-temp { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1.1; }
.w-desc { font-size: 13px; }

.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.tool { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; align-items: center; text-decoration: none; padding: 20px 22px; min-width: 0; transition: transform .2s; }
.tool .ico { grid-row: span 2; font-size: 26px; width: 52px; height: 52px; display: grid; place-items: center; background: var(--sky); border-radius: 14px; }
.tool.bg-cream .ico { background: var(--white); }
.tool b { font-size: 16px; }
.tool span:last-child { font-size: 13px; color: var(--ink-soft); }

.now-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.now-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap); }
.now-list li { display: grid; gap: 10px; align-content: start; background: var(--sky); border-radius: 18px; padding: 20px; }
.now-list li:nth-child(2), .now-list li:nth-child(5) { background: var(--lilac); }
.now-list li:nth-child(3) { background: var(--cream); }
.now-list .n { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; }
.now-list b { display: block; font-size: 16px; margin-bottom: 4px; }
.now-list p { font-size: 13.5px; }

.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.place { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-height: 190px; }
.place p { font-size: 14.5px; }

.popular { --seg-a: 1fr; --seg-b: 1.6fr; margin-top: 22px; column-gap: max(32px, var(--hinge)); }
.popular h2 { color: var(--lilac); font-size: clamp(40px, 6vw, 80px); letter-spacing: -0.04em; }
.pop-sub { margin-top: 16px; font-size: 15px; opacity: .9; }
.pop-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pop-list li { display: flex; gap: 14px; align-items: center; background: rgba(255,246,199,.08); border-radius: 14px; padding: 12px 16px; }
.pop-list .rank { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--lilac); }
.pop-list b { display: block; font-size: 15px; }
.pop-list div span { font-size: 12.5px; opacity: .7; }

.fest-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.fest .season { display: inline-block; font-family: var(--display); font-weight: 800; font-size: 34px; margin-bottom: 12px; }
.fest ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fest li { display: grid; gap: 2px; }
.fest li b { font-size: 15px; }
.fest li span { font-size: 13.5px; color: var(--ink-soft); }

.field-legend { font-size: 13px; font-weight: 700; margin-bottom: 8px; padding: 0; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.check-grid label { display: flex; gap: 8px; align-items: center; font-size: 15px; cursor: pointer; min-height: 40px; }
.plan-result { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.plan-result:empty { display: none; }
.plan-result .form-msg { color: var(--cream); }
.day { color: var(--plum); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.day-head b { font-family: var(--display); font-size: 22px; }
.day-head span { font-size: 12.5px; color: var(--ink-soft); }
.day ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.day li { display: grid; grid-template-columns: 48px 1fr; gap: 10px; }
.slot { font-size: 12px; font-weight: 700; background: var(--lilac); border-radius: 999px; text-align: center; height: 24px; line-height: 24px; }
.day li b { font-size: 15px; }
.day li p { font-size: 13.5px; color: var(--ink-soft); }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.info ul { margin: 14px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14.5px; }
.newsletter { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 22px; }
.newsletter h2 { margin-bottom: 8px; }
.nl-form { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; max-width: 460px; }
.nl-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--plum); border: 1.5px solid var(--plum); background: var(--white); border-radius: 999px; padding: 12px 18px; min-height: 48px; }
.nl-form .btn-plum { margin-top: 0; padding: 12px 22px; }
.nl-form .form-msg { flex-basis: 100%; }

/* =========================================================
   가이드맵
   ========================================================= */
.map-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-top: 4px; }
.map-kicker { font-family: "Gaegu", var(--body); font-size: 22px; color: #2f7fd8; margin-bottom: 6px; }
.map-title h1 { font-size: clamp(38px, 6vw, 72px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.map-big { font-size: 1.15em; color: #2f7fd8; letter-spacing: 0.02em; }
.chip-mini { display: inline-block; font-size: .32em; vertical-align: middle; background: #2f7fd8; color: #fff; padding: .25em .7em; border-radius: 999px; letter-spacing: 0; transform: translateY(-.4em); }
.map-intro { max-width: 420px; font-size: 14.5px; }

.map-layout { --seg-a: 1.75fr; --seg-b: 1fr; margin-top: var(--gap); align-items: start; }
.map-card { scroll-margin-top: 76px; position: relative; padding: 0; overflow: hidden; background: #cfe4f7; min-height: 0; border: 6px solid var(--white); }
#map { height: min(78vh, 760px); min-height: 420px; width: 100%; background: #cfe4f7; font-family: var(--body); }
.map-page .leaflet-container a { color: var(--plum); }
/* 일반 지도를 일러스트 지도처럼 부드러운 파스텔 톤으로 */
.map-page .leaflet-tile-pane { filter: saturate(.5) brightness(1.06) contrast(.92) hue-rotate(-6deg); }
.leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 38px !important; font-size: 20px !important; color: var(--plum) !important; }
.leaflet-bar { border: 0 !important; box-shadow: 0 4px 14px rgba(91,18,54,.18) !important; border-radius: 14px !important; overflow: hidden; }

/* 핀 */
.pin-wrap { background: none; border: 0; }
.pin {
  --c: var(--plum);
  position: relative; display: grid; place-items: center; width: 40px; height: 40px;
  background: var(--white); border: 3px solid var(--c); border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  box-shadow: 0 4px 10px rgba(30, 20, 40, .25); transition: transform .18s, box-shadow .18s, opacity .2s;
}
.pin i { transform: rotate(45deg); font-style: normal; font-size: 18px; line-height: 1; }
.pin b { position: absolute; top: -8px; right: -8px; transform: rotate(45deg); min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px; background: var(--c); color: #fff; font: 700 11px/20px var(--body); text-align: center; }
.pin-wrap:hover .pin, .pin-wrap:focus-visible .pin { transform: rotate(-45deg) scale(1.12); }
.pin-wrap.is-selected { z-index: 9999 !important; }
.pin-wrap.is-selected .pin { transform: rotate(-45deg) scale(1.3); background: var(--c); box-shadow: 0 8px 20px rgba(30, 20, 40, .35); }
.pin-wrap.is-dim .pin { opacity: .28; transform: rotate(-45deg) scale(.85); }
.pin-wrap.is-off { display: none; }
.pin-wrap:focus-visible { outline: none; }
.pin-wrap:focus-visible .pin { outline: 3px solid var(--plum); outline-offset: 3px; }

/* 설명창 */
.place-card {
  position: absolute; z-index: 1000; left: 14px; bottom: 14px; width: min(360px, calc(100% - 28px));
  background: var(--white); border-radius: 20px; padding: 20px 20px 18px; color: var(--plum);
  box-shadow: 0 16px 40px rgba(30, 20, 40, .25); display: grid; gap: 10px;
  animation: pc-in .22s ease;
}
.place-card[hidden] { display: none; }
@keyframes pc-in { from { opacity: 0; transform: translateY(12px); } }
.pc-close { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border: 0; background: var(--sky); border-radius: 50%; font-size: 22px; line-height: 1; color: var(--plum); cursor: pointer; }
.pc-head { display: flex; gap: 12px; align-items: center; padding-right: 40px; }
.pc-num { --c: var(--plum); flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font: 800 16px var(--display); }
.pc-head h2 { font-size: 21px; line-height: 1.2; }
.pc-area { font-size: 12.5px; color: var(--ink-soft); }
.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-tag { --c: var(--plum); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, white); color: color-mix(in srgb, var(--c) 80%, black); }
.pc-desc { font-size: 14.5px; line-height: 1.6; }
.pc-meta { font-size: 13px; color: var(--ink-soft); }
.pc-courses { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.pc-courses:empty { display: none; }
.pc-courses span { font-weight: 700; margin-right: 2px; }
.pc-courses button { --c: var(--plum); font: inherit; font-weight: 700; border: 1.5px solid var(--c); color: var(--c); background: none; padding: 4px 10px; min-height: 32px; border-radius: 999px; cursor: pointer; }
.pc-link { justify-self: start; min-height: 40px; font-size: 14px; }

.map-reset { position: absolute; z-index: 999; left: 12px; top: 12px; font: inherit; font-weight: 700; font-size: 13px; background: var(--white); color: var(--plum); border: 0; border-radius: 999px; padding: 8px 14px; min-height: 40px; box-shadow: 0 4px 14px rgba(91,18,54,.18); cursor: pointer; }

/* 오른쪽: 범례 + 코스 */
.map-side { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.legend h2, .courses h2 { font-size: 22px; }
.legend .muted { margin: 4px 0 12px; font-size: 13px; }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.lg b { white-space: nowrap; }
.lg { --c: var(--plum); width: 100%; display: flex; align-items: center; gap: 8px; font: inherit; text-align: left; background: color-mix(in srgb, var(--c) 10%, white); border: 2px solid var(--c); color: var(--plum); border-radius: 14px; padding: 8px 10px; min-height: 48px; cursor: pointer; transition: opacity .15s, background .15s; }
.lg .dot { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--white); display: grid; place-items: center; font-size: 15px; box-shadow: inset 0 0 0 2px var(--c); }
.lg b { font-size: 14px; }
.lg small { margin-left: auto; font-size: 12px; color: var(--ink-soft); }
.lg:not(.is-on) { opacity: .45; background: var(--white); border-style: dashed; }

.courses h2 { margin-bottom: 14px; line-height: 1.2; }
.course-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.course { --c: var(--plum); width: 100%; text-align: left; font: inherit; color: var(--plum); background: var(--white); border: 0; border-left: 6px solid var(--c); border-radius: 14px; padding: 12px 14px; display: grid; gap: 3px; cursor: pointer; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 30%, white); transition: background .15s, box-shadow .15s; }
.course .c-name { font-weight: 800; font-size: 15.5px; color: var(--c); }
.course .c-meta { font-size: 12.5px; font-weight: 700; }
.course .c-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.course .c-stops { font-size: 12px; font-weight: 700; color: var(--c); margin-top: 2px; }
.course.is-on { background: color-mix(in srgb, var(--c) 12%, white); box-shadow: inset 0 0 0 2px var(--c); }

/* 장소 목록 */
.area-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.area-box h3 { font-size: 17px; margin-bottom: 10px; }
.area-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.area-box button { width: 100%; display: flex; align-items: center; gap: 10px; font: inherit; font-size: 14px; text-align: left; color: var(--plum); background: none; border: 0; border-radius: 10px; padding: 6px 6px; min-height: 40px; cursor: pointer; }
.ln { --c: var(--plum); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font: 700 11px var(--body); }

@media (hover: hover) {
  .area-box button:hover, .course:hover { background: var(--sky); }
  .pc-close:hover { background: var(--lilac); }
}

@media (max-width: 1023px) {
  .map-layout { --seg-a: 1fr; --seg-b: 1fr; grid-template-columns: 1fr; }
  .map-side { grid-template-columns: 1fr 1fr; }
  .area-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 719px) {
  .map-card { border-width: 4px; }
  #map { height: 72vh; height: 72svh; min-height: 360px; }
  .map-side { grid-template-columns: 1fr; }
  /* 휴대폰: 설명창을 지도 아래쪽 시트로 */
  .place-card { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 62%; overflow-y: auto; padding: 18px 16px 16px; border-radius: 18px; }
  .place-card::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: #d9cfe0; }
  .map-intro { font-size: 14px; }
}
@media (max-width: 359px) {
  .legend-list, .area-grid { grid-template-columns: 1fr; }
  .pc-head h2 { font-size: 18px; }
  .map-kicker { font-size: 19px; }
}
/* 듀얼 화면: 왼쪽 화면은 지도, 오른쪽 화면은 범례·코스 */
@media (horizontal-viewport-segments: 2) {
  .map-layout { grid-template-columns: env(viewport-segment-width 0 0) env(viewport-segment-width 1 0); }
  .map-side { grid-template-columns: 1fr; padding-right: 20px; }
  #map { height: calc(100vh - 140px); }
  .area-grid { grid-template-columns: var(--seg-a) var(--seg-b); }
}
@media (vertical-viewport-segments: 2) {
  /* 반쯤 접은 플렉스 모드: 위 화면은 지도, 아래 화면은 설명창 */
  #map { height: calc(env(viewport-segment-height 0 0) - 70px); }
  .place-card { position: fixed; left: 12px; right: 12px; width: auto; top: calc(env(viewport-segment-top 0 1) + 12px); bottom: auto; max-height: calc(env(viewport-segment-height 0 1) - 24px); overflow-y: auto; }
}

/* ---------- 공통 상호작용 ---------- */
:focus-visible { outline: 3px solid var(--plum); outline-offset: 2px; }
.bg-plum :focus-visible { outline-color: var(--cream); }
@media (hover: hover) {
  .menu a:not(.pill):hover { text-decoration: underline; text-underline-offset: 4px; }
  .pill:hover { transform: translateY(-1px); }
  .hero-cta:hover, .feature:hover { background: var(--plum-2); }
  .hero-cta:hover span { transform: translateX(6px); }
  .chip:not(.is-on):hover { background: var(--white); }
  .dest:hover, .tool:hover { transform: translateY(-3px); }
  .btn-plum:hover { background: var(--plum-2); }
  .link-light:hover, .link-dark:hover, .footer-cols a:hover { text-decoration: underline; }
}
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   반응형
   ========================================================= */

/* 펼친 폴더블 · 태블릿 (720~1023px) */
@media (max-width: 1023px) {
  .dest-grid { grid-template-columns: repeat(2, 1fr); }
  .dest.tall { grid-row: auto; }
  .guide-grid, .info-grid { grid-template-columns: 1fr; }
  .tools-grid, .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .now-list { grid-template-columns: repeat(2, 1fr); }
  .now-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .fest-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .closing-in, .popular { --seg-a: 1fr; --seg-b: 1fr; }
}

/* 휴대폰 (719px 이하) */
@media (max-width: 719px) {
  :root { --radius: 18px; --gap: 10px; }
  html { scroll-padding-top: 72px; }
  .menu-btn { display: block; }
  .menu {
    display: none; position: absolute; top: calc(100% + 4px);
    left: max(var(--pad), env(safe-area-inset-left)); right: max(var(--pad), env(safe-area-inset-right));
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--white); border-radius: 18px; padding: 10px;
    box-shadow: 0 12px 30px rgba(91,18,54,.15);
  }
  .menu.open { display: flex; }
  .menu a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; font-size: 16px; }
  .menu .pill { justify-content: center; margin-top: 4px; }

  .split { grid-template-columns: 1fr; }
  .hero-copy { min-height: 0; gap: 20px; }
  .hero-art { min-height: 300px; }
  .why-head { grid-template-columns: 1fr; }
  .why-cards { grid-auto-columns: 72%; }
  .why-cards li { min-height: 150px; }
  .stats, .budget-bars { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .h1, .h2, .h3, .h4, .b1, .b2, .b3, .b4 { height: auto; min-height: 140px; }
  .dest-grid, .tools-grid, .theme-grid, .fest-grid, .pop-list, .now-list { grid-template-columns: 1fr; }
  .dest.wide { grid-column: auto; }
  .dest { min-height: 0; }
  .row { grid-template-columns: 1fr; }
  .chips { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .section-head { padding: 28px 2px 14px; }
  .quote-card { min-height: 420px; }
  .budget-total { padding: 20px; }
  .btn-pair { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .btn-pair .pill { flex: 1; min-height: 44px; }
  .closing { min-height: 620px; border-width: 6px; }
  .closing-cols { grid-template-columns: 1fr 1fr; }
  .footer-top .pill-lg { width: 100%; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .check-grid { grid-template-columns: 1fr 1fr; }
  .weather, .hero-badge { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

/* 접힌 폴더블 커버 화면 · 아주 좁은 화면 (359px 이하, 갤럭시 폴드 커버 280~344px 포함) */
@media (max-width: 359px) {
  :root { --pad: 10px; --radius: 16px; }
  .card { padding: 16px; }
  .logo:not(.logo-xl) { font-size: 18px; }
  fieldset label b { min-width: 0; }
  fieldset label { flex-wrap: wrap; column-gap: 8px; }
  .hero h1 { font-size: clamp(48px, 19vw, 72px); }
  .hero-sub, .why-lines { font-size: 14px; }
  .hero-art { min-height: 240px; }
  .stats, .budget-bars, .check-grid, .closing-cols, .footer-cols { grid-template-columns: 1fr; }
  .stat strong, .bar strong { font-size: 40px; }
  .plan-title { font-size: 48px; }
  .quote { margin: 10px; padding: 18px; }
  .tool { padding: 16px; column-gap: 10px; }
  .tool .ico { width: 44px; height: 44px; font-size: 22px; }
  .pill-lg { font-size: 17px; }
}

/* 가로로 눕힌 휴대폰 (높이가 낮은 화면) */
@media (max-height: 500px) and (orientation: landscape) {
  .nav-wrap { position: static; }
  .hero-art { min-height: 260px; }
  .hero-copy { min-height: 0; }
}

/* =========================================================
   듀얼 화면 · 폴더블 분할 모드
   (Viewport Segments API: Surface Duo, Galaxy Fold/Flip 등)
   ========================================================= */

/* 좌우로 나뉜 화면: 두 칸 레이아웃을 힌지에 맞춰 정렬 */
@media (horizontal-viewport-segments: 2) {
  :root {
    --seg-a: env(viewport-segment-width 0 0);
    --seg-b: env(viewport-segment-width 1 0);
    --hinge: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0));
  }
  .container { max-width: none; padding-left: 0; padding-right: 0; }
  .nav { max-width: none; }
  .split, .hero, .plan, .closing-in, .popular {
    --seg-a: env(viewport-segment-width 0 0);
    --seg-b: env(viewport-segment-width 1 0);
    grid-template-columns: var(--seg-a) var(--seg-b);
    column-gap: var(--hinge);
  }
  .plan, .popular, .closing-in { padding-left: 0; padding-right: 0; }
  .plan > .split-a, .popular > :first-child, .closing-in > .split-a { padding-left: 20px; }
  .plan > .split-b, .popular > :last-child, .closing-in > .split-b { margin-right: 20px; }
  .plan-result { padding: 0 20px 20px; }
  /* 나머지 격자도 힌지를 피해 두 칸으로 */
  .stats, .budget-bars, .dest-grid, .tools-grid, .theme-grid, .fest-grid, .info-grid, .guide-grid, .now-list, .why-tiles, .footer-cols {
    grid-template-columns: var(--seg-a) var(--seg-b);
    column-gap: var(--hinge);
  }
  .dest.wide, .dest.tall { grid-column: auto; grid-row: auto; }
  .h1, .h2, .h3, .h4, .b1, .b2, .b3, .b4 { height: auto; min-height: 160px; }
  .card, .stat, .bar { border-radius: 0; }
  .menu-btn { display: none; }
  .menu { display: flex; position: static; flex-direction: row; background: none; box-shadow: none; padding: 0; }
  .nav { padding-left: 20px; padding-right: 20px; }
}

/* 위아래로 나뉜 화면 (폴더블 반쯤 접은 '플렉스 모드'): 첫 화면을 위쪽 화면에 맞춤 */
@media (vertical-viewport-segments: 2) {
  .hero { min-height: env(viewport-segment-height 0 0); grid-template-columns: 1fr 1fr; }
  .hero-copy { min-height: 0; }
  .hero-art { min-height: 0; }
  .hero h1 { font-size: clamp(48px, 7vw, 96px); }
  .hero + section { margin-top: calc(env(viewport-segment-top 0 1) - env(viewport-segment-bottom 0 0) + var(--gap)); }
}

/* 예전 Surface Duo 브라우저용 (spanning 미디어 쿼리) */
@media (spanning: single-fold-vertical) {
  :root {
    --seg-a: env(fold-left);
    --seg-b: calc(100vw - env(fold-right));
    --hinge: env(fold-width);
  }
  .container { max-width: none; padding-left: 0; padding-right: 0; }
  .split, .hero, .plan, .closing-in, .popular,
  .stats, .budget-bars, .dest-grid, .tools-grid, .theme-grid, .fest-grid, .info-grid, .guide-grid, .now-list, .why-tiles, .footer-cols {
    grid-template-columns: var(--seg-a) var(--seg-b);
    column-gap: var(--hinge);
  }
  .dest.wide, .dest.tall { grid-column: auto; grid-row: auto; }
  .h1, .h2, .h3, .h4, .b1, .b2, .b3, .b4 { height: auto; min-height: 160px; }
}
