/* ==============================================
   코난 마을 반나절 가이드 — 모바일 특화 모던 다크 UI
   (지브리파크 가이드 디자인 시스템 기반, 블루 테마)
   ============================================== */

:root {
  /* 배경 */
  --bg:          #0d0f0e;
  --bg-card:     #13161a;
  --bg-card2:    #181c22;
  --bg-dark:     #0f1114;
  --bg-overlay:  rgba(13,15,14,.82);

  /* 메인 컬러 — 코난 블루 */
  --blue:        #3a7bd5;
  --blue-dim:    #1a3d7a;
  --blue-pale:   rgba(58,123,213,.12);
  --blue-glow:   rgba(58,123,213,.18);

  /* 포인트 — 앰버 */
  --amber:       #c8963a;
  --amber-dim:   rgba(200,150,58,.15);

  /* 텍스트 */
  --t1:          #f0ece4;
  --t2:          #a0a090;
  --t3:          #6a6a58;

  /* 선/구분 */
  --line:        rgba(255,255,255,.07);
  --line2:       rgba(255,255,255,.04);

  /* 반지름 */
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;

  /* 그림자 */
  --sh-card: 0 2px 16px rgba(0,0,0,.4);
  --sh-pop:  0 8px 32px rgba(0,0,0,.6);
}

/* ─── 리셋 ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--t1);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ─── 공통 레이아웃 ─── */
.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 18px;
}

section { position: relative; }

.section-dark { background: var(--bg-dark); }

.section-pad { padding: 60px 0; }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 10px;
}

.section-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.section-title em { color: var(--blue); font-style: normal; }

.section-sub {
  font-size: 14px;
  color: var(--t2);
  margin-bottom: 28px;
}

/* ─── NAV ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: transparent;
  transition: background .3s, backdrop-filter .3s, box-shadow .3s;
}
.nav.scrolled {
  background: var(--bg-overlay);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 18px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }

.nav-menu-btn {
  width: 40px; height: 40px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  border-radius: 10px;
}
.nav-menu-btn span {
  display: block;
  width: 22px; height: 2px;
  background: var(--t1);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.nav-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-menu-btn.open span:nth-child(2) { opacity: 0; }
.nav-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 드로어 */
.nav-drawer {
  position: fixed;
  top: 58px; left: 0; right: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, opacity .3s;
  opacity: 0;
  z-index: 199;
}
.nav-drawer.open {
  max-height: 460px;
  opacity: 1;
}
.nav-drawer-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 18px 22px;
}
.nav-drawer a {
  display: block;
  padding: 13px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--t1);
  border-radius: var(--r-sm);
  transition: background .2s, color .2s;
}
.nav-drawer a:hover { background: var(--blue-pale); color: var(--blue); }

/* ─── HERO ─── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: opacity .5s ease;
}
/* 초기 src(외부 URL)로 바로 표시, base64 교체 시 부드럽게 전환 */
.hero-bg-img[src]:not([src=""]) {
  opacity: 1;
}
.hero-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(13,15,14,.55) 0%, rgba(13,15,14,.35) 35%, rgba(13,15,14,.92) 100%),
    radial-gradient(120% 80% at 50% 0%, rgba(58,123,213,.18), transparent 60%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  padding: 0 18px 72px;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #ffffff;
  padding: 6px 12px;
  border: 1px solid var(--blue-dim);
  border-radius: 999px;
  background: var(--blue-pale);
  margin-bottom: 18px;
}
.hero-title {
  font-size: 45px;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.03em;
  margin-bottom: 16px;
}
.hero-title em {
  display: block;
  color: var(--blue);
  font-style: normal;
}
.hero-sub {
  font-size: 15px;
  color: var(--t2);
  margin-bottom: 28px;
  max-width: 380px;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  transition: transform .18s, box-shadow .18s, background .2s;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 20px var(--blue-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px var(--blue-glow); }
.btn-ghost {
  background: rgba(255,255,255,.06);
  color: var(--t1);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255,255,255,.12); transform: translateY(-2px); }

.scroll-hint {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--t2);
  font-size: 20px;
  animation: bounce 1.8s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ─── INFO CARD (요약) ─── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--sh-card);
  transition: transform .2s, border-color .2s;
}
.info-card:hover { transform: translateY(-3px); border-color: var(--blue-dim); }
.info-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--blue-pale);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.info-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.info-card p { font-size: 13px; color: var(--t2); }

.tag-warn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  padding: 10px 16px;
  background: var(--amber-dim);
  border: 1px solid rgba(200,150,58,.3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
}

/* ─── ROUTE STEP (가는 법) ─── */
.route-list { position: relative; margin-top: 6px; }
.route-step {
  position: relative;
  display: flex;
  gap: 16px;
  padding-bottom: 26px;
}
.route-step:last-child { padding-bottom: 0; }
.route-marker {
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.route-dot {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  z-index: 2;
  box-shadow: 0 0 0 5px var(--blue-pale);
}
.route-dot.arrival { background: var(--amber); box-shadow: 0 0 0 5px var(--amber-dim); }
.route-line {
  position: absolute;
  top: 38px; bottom: -4px;
  width: 2px;
  background: linear-gradient(var(--blue-dim), var(--line));
}
.route-step:last-child .route-line { display: none; }
.route-body { flex: 1; padding-top: 2px; }
.route-time {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.route-body h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.route-body p { font-size: 13px; color: var(--t2); }
.route-body .route-note { font-size: 12px; color: var(--t3); margin-top: 4px; }

.alert-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-top: 14px;
}
.alert-card .alert-ic { flex-shrink: 0; font-size: 17px; margin-top: 1px; }
.alert-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.alert-card p { color: var(--t2); }
.alert-info {
  background: var(--blue-pale);
  border: 1px solid var(--blue-dim);
}
.alert-info .alert-ic, .alert-info h4 { color: var(--blue); }
.alert-warn {
  background: var(--amber-dim);
  border: 1px solid rgba(200,150,58,.3);
}
.alert-warn .alert-ic, .alert-warn h4 { color: var(--amber); }

/* ─── MAP ─── */
#map {
  height: 420px;
  width: 100%;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-pop);
  overflow: hidden;
  background: var(--bg-card);
}
@media (min-width: 600px) { #map { height: 500px; } }

.dist-list {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dist-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line2);
}
.dist-item:last-child { border-bottom: none; }
.dist-emoji { font-size: 18px; flex-shrink: 0; }
.dist-item strong { font-size: 14px; font-weight: 700; }
.dist-item span { font-size: 13px; color: var(--t2); }

/* ─── 탭 (코스) ─── */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.tab {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--t2);
  background: var(--bg-card);
  border: 1px solid var(--line);
  transition: all .2s;
}
.tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── TIMELINE (코스) ─── */
.timeline { position: relative; }
.tl-card {
  position: relative;
  display: flex;
  gap: 16px;
  padding-bottom: 24px;
}
.tl-card:last-child { padding-bottom: 0; }
.tl-rail {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 56px;
}
.tl-time {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 6px;
}
.tl-bead {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-pale);
  z-index: 2;
}
.tl-stem {
  flex: 1;
  width: 2px;
  background: linear-gradient(var(--blue-dim), var(--line));
  margin-top: 4px;
}
.tl-card:last-child .tl-stem { display: none; }
.tl-body {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--sh-card);
}
.tl-body .tl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.tl-body h3 { font-size: 15px; font-weight: 700; }
.tl-dur {
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  background: rgba(255,255,255,.05);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.tl-area-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.tag-station { background: rgba(14,165,233,.16); color: #4cb6ef; }
.tag-tour    { background: var(--blue-pale); color: var(--blue); }
.tag-museum  { background: rgba(122,90,200,.16); color: #a78bdc; }
.tag-food    { background: var(--amber-dim); color: var(--amber); }
.tag-shop    { background: rgba(80,180,120,.14); color: #6cc99a; }
.tl-body p { font-size: 13px; color: var(--t2); margin-bottom: 4px; }

.photo-spots {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.photo-spots .ps-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
}
.photo-spots ul { list-style: none; }
.photo-spots li {
  font-size: 12px;
  color: var(--t2);
  padding-left: 16px;
  position: relative;
  margin-bottom: 3px;
}
.photo-spots li::before {
  content: '📸';
  position: absolute;
  left: 0;
  font-size: 11px;
}

.tl-tip {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.tl-tip .tip-ic { flex-shrink: 0; }
.tip-info { background: var(--blue-pale); color: var(--blue); }
.tip-warn { background: var(--amber-dim); color: var(--amber); }
.tip-shop { background: rgba(80,180,120,.12); color: #6cc99a; }
.tl-tip span { color: var(--t2); }
.tip-info span, .tip-warn span, .tip-shop span { color: inherit; opacity: .9; }

/* ─── AREA CARD (스팟 가이드) ─── */
.area-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.area-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-card);
  transition: transform .2s, border-color .2s;
}
.area-card:hover { transform: translateY(-3px); border-color: var(--blue-dim); }
.area-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--blue-pale);
  color: var(--blue);
  margin-bottom: 10px;
}
.area-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.area-card p { font-size: 13px; color: var(--t2); margin-bottom: 6px; }
.area-meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line2);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.area-meta span {
  font-size: 12px;
  color: var(--t3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.area-meta i { color: var(--blue); }

/* ─── FOOD ─── */
.food-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.food-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--sh-card);
  transition: transform .2s, border-color .2s;
}
.food-item:hover { transform: translateY(-3px); border-color: var(--amber); }
.food-emoji {
  flex-shrink: 0;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--amber-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.food-item h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.food-loc { font-size: 11px; font-weight: 600; color: var(--blue); margin-bottom: 5px; }
.food-item p { font-size: 13px; color: var(--t2); }

.food-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 16px;
  background: var(--amber-dim);
  border: 1px solid rgba(200,150,58,.3);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--t2);
}
.food-notice .fn-ic { color: var(--amber); font-size: 17px; flex-shrink: 0; margin-top: 1px; }

/* ─── CHECKLIST ─── */
.cl-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.cl-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  user-select: none;
}
.cl-item:hover { border-color: var(--blue-dim); }
.cl-box {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--t3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all .2s;
}
.cl-item.checked .cl-box {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.cl-item .cl-text { font-size: 14px; transition: color .2s; }
.cl-item.checked .cl-text { color: var(--t3); text-decoration: line-through; }

.cl-progress {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cl-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-card);
  overflow: hidden;
  border: 1px solid var(--line);
}
.cl-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 999px;
  transition: width .4s ease;
}
.cl-count { font-size: 13px; font-weight: 700; color: var(--blue); white-space: nowrap; }

/* ─── FAQ ─── */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 12px;
  color: var(--blue);
  transition: transform .3s;
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item summary .faq-q { color: var(--blue); font-weight: 800; margin-right: 8px; }
.faq-answer {
  padding: 0 18px 18px;
  font-size: 13px;
  color: var(--t2);
  line-height: 1.7;
}

/* ─── FOOTER ─── */
.footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--line);
  padding: 44px 0 110px;
  text-align: center;
}
.footer-logo { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.footer-note {
  font-size: 13px;
  color: var(--t2);
  max-width: 420px;
  margin: 0 auto 20px;
  line-height: 1.7;
}
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--blue-dim);
  background: var(--blue-pale);
  color: var(--blue);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s, transform .2s;
}
.footer-link:hover { background: var(--blue); color: #fff; transform: translateY(-2px); }
.footer-copy { margin-top: 22px; font-size: 12px; color: var(--t3); }

/* ─── BOTTOM NAV ─── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 150;
  background: var(--bg-overlay);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-inner {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--t2);
  transition: color .2s;
}
.bn-item i { font-size: 17px; }
.bn-item.active { color: var(--blue); }

/* ─── FADE-IN 애니메이션 ─── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── 반응형 ─── */
@media (min-width: 600px) {
  .info-grid { grid-template-columns: 1fr 1fr; }
  .area-grid { grid-template-columns: 1fr 1fr; }
  .food-grid { grid-template-columns: 1fr 1fr; }
  .cl-list   { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 45px; }
  .section-title { font-size: 30px; }
}

@media (min-width: 860px) {
  .bottom-nav { display: none; }
  .footer { padding-bottom: 44px; }
  body { padding-bottom: 0; }
}
