/* ==========================================================================
   WayLog — Base
   컨셉: "Route Note" — 지도 위에 찍은 핀과 점선 경로, 여행 노트.
   색상은 원본 WayLog 를 기준으로 잡았다.
   - 주색: 원본 버튼 파랑(#2878ED)과 같은 계열의 #2563EB (흰 글자 대비 5.2:1 로 AA 충족)
   - 보조색: 원본 로고 그라데이션(#2F6CFD → #29A0F8)의 하늘색 — 핀 · 현재 위치
   - 글자 · 면 · 테두리: 원본의 남색 글자(#17263A)와 청회색 면 · 테두리
   - 푸터: 원본 남색 #14345F
   ========================================================================== */

:root {
  /* Surface */
  --c-bg: #f4f7fb;
  --c-surface: #ffffff;
  --c-surface-2: #e9eff7;
  --c-line: #dbe4ee;
  --c-line-strong: #c3cfdd;

  /* Text (모두 --c-bg 위 4.5:1 이상) */
  --c-ink: #17263a;
  --c-ink-2: #405168;
  --c-ink-3: #5b6a7e;

  /* Brand */
  --c-primary: #2563eb;          /* 주요 버튼 · 경로 · 저장 */
  --c-primary-hover: #1d4ed8;
  --c-on-primary: #ffffff;
  --c-primary-soft: #e8f1fe;
  --c-primary-text: #1d56c2;
  --c-accent: #38a8f8;           /* 핀 · 현재 위치 (위 글자는 --c-on-accent) */
  --c-on-accent: #0f2742;
  --c-accent-soft: #e1f2fe;
  --c-accent-text: #0a659e;
  --c-like: #e5484d;             /* 좋아요 */
  --c-like-text: #c4303a;

  /* Semantic */
  --c-danger: #b42318;
  --c-danger-soft: #fdecea;
  --c-ok: #1d7a4a;
  --c-ok-soft: #def3e6;

  --c-focus: #2563eb;
  --c-overlay: rgb(15 32 57 / 0.5);
  --c-shade: 15 32 57;           /* 사진 위 어두운 막 (원본 코스 상세의 #0F2039) */
  --c-photo-bg: #142b46;
  --c-photo-shade: linear-gradient(180deg, rgb(var(--c-shade) / 0) 30%, rgb(var(--c-shade) / 0.8) 100%);

  /* Footer (원본 남색) */
  --c-footer-bg: #14345f;
  --c-footer-ink: #ffffff;
  --c-footer-text: #c9d6e8;
  --c-footer-muted: #9fb3cf;
  --c-footer-line: rgb(255 255 255 / 0.14);

  /* Typography */
  --font-display: 'Hahmlet', 'Noto Serif KR', 'AppleMyungjo', serif;
  --font-sans: 'IBM Plex Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: clamp(1.875rem, 1.3rem + 2.4vw, 2.75rem);
  --fs-display: clamp(2.375rem, 1.4rem + 4.4vw, 4.25rem);

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;

  /* Shape · Depth */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(23 38 58 / 0.06);
  --shadow-md: 0 1px 2px rgb(23 38 58 / 0.05), 0 8px 24px -8px rgb(38 79 125 / 0.14);
  --shadow-lg: 0 24px 56px -16px rgb(23 38 58 / 0.3);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;

  /* Layout */
  --container: 1200px;
  --gutter: 16px;
  --header-h: 64px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #0d1726;
    --c-surface: #142238;
    --c-surface-2: #1b2d47;
    --c-line: #263b59;
    --c-line-strong: #34507a;
    --c-ink: #e8eef7;
    --c-ink-2: #b4c2d6;
    --c-ink-3: #8fa0b8;
    --c-primary: #5b9dff;
    --c-primary-hover: #7db1ff;
    --c-on-primary: #0d1726;
    --c-primary-soft: #16305a;
    --c-primary-text: #8ab8ff;
    --c-accent: #4cb8fa;
    --c-accent-soft: #0f3150;
    --c-accent-text: #7fcdfc;
    --c-like: #ff6b70;
    --c-like-text: #ff9ea1;
    --c-danger: #f97066;
    --c-danger-soft: #3b1512;
    --c-ok: #6ad39a;
    --c-ok-soft: #12301f;
    --c-focus: #8ab8ff;
    --c-overlay: rgb(0 0 0 / 0.62);
    --c-footer-bg: #0e2442;
    --shadow-md: 0 1px 2px rgb(0 0 0 / 0.35), 0 8px 24px -8px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --c-bg: #0d1726;
  --c-surface: #142238;
  --c-surface-2: #1b2d47;
  --c-line: #263b59;
  --c-line-strong: #34507a;
  --c-ink: #e8eef7;
  --c-ink-2: #b4c2d6;
  --c-ink-3: #8fa0b8;
  --c-primary: #5b9dff;
  --c-primary-hover: #7db1ff;
  --c-on-primary: #0d1726;
  --c-primary-soft: #16305a;
  --c-primary-text: #8ab8ff;
  --c-accent: #4cb8fa;
  --c-accent-soft: #0f3150;
  --c-accent-text: #7fcdfc;
  --c-like: #ff6b70;
  --c-like-text: #ff9ea1;
  --c-danger: #f97066;
  --c-danger-soft: #3b1512;
  --c-ok: #6ad39a;
  --c-ok-soft: #12301f;
  --c-focus: #8ab8ff;
  --c-overlay: rgb(0 0 0 / 0.62);
  --c-footer-bg: #0e2442;
  --shadow-md: 0 1px 2px rgb(0 0 0 / 0.35), 0 8px 24px -8px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; --header-h: 72px; }
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.3; letter-spacing: -0.015em; text-wrap: balance; }
p { text-wrap: pretty; }
img { height: auto; }

button, [role="button"], summary, select, label[for], input[type="checkbox"], input[type="radio"] { cursor: pointer; }
button:disabled { cursor: not-allowed; }

:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--c-primary-soft); color: var(--c-ink); }

.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--fill { fill: currentColor; }

[hidden] { display: none !important; }

/* SVG 아이콘 스프라이트: 화면에는 그리지 않고 <use> 로만 참조 */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Utilities ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: 1000;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  background: var(--c-ink);
  color: var(--c-bg);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* 지도 좌표 · 날짜 같은 데이터 글자 */
.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: 0; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
