@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600&display=swap");
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.css");
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--wdt-bg);
  color: var(--wdt-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); font-weight: 600; }

a {
  color: var(--wdt-coral);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
a:hover { border-bottom-color: var(--wdt-coral); }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

img { max-width: 100%; height: auto; }

button {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  border: 1px solid var(--wdt-border);
  color: var(--wdt-text);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
button:hover {
  background: var(--wdt-bg-soft);
  border-color: var(--wdt-border-strong);
}
button.primary {
  background: var(--wdt-coral);
  color: var(--wdt-bg);
  border-color: var(--wdt-coral);
}
button.primary:hover {
  background: var(--wdt-peach);
  border-color: var(--wdt-peach);
}

/* ─── Header / Nav ──────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--wdt-bg);
  border-bottom: 1px solid var(--wdt-border);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.site-header .inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.brand {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--wdt-text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.brand .bread { font-size: 1.2em; }
.nav {
  display: flex;
  gap: var(--s-1);
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-size: var(--fs-sm);
  color: var(--wdt-text-soft);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  border-bottom: none;
  white-space: nowrap;
}
.nav a:hover { background: var(--wdt-bg-soft); color: var(--wdt-text); }
.nav a.active {
  background: var(--wdt-text);
  color: var(--wdt-bg);
}

/* ─── Main layout ───────────────────────────────────────── */
main {
  min-height: calc(100vh - var(--header-h));
}
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) var(--s-8);
}
.page-title {
  margin-bottom: var(--s-2);
}
.page-subtitle {
  color: var(--wdt-text-soft);
  font-size: var(--fs-sm);
  margin-bottom: var(--s-6);
}

/* ─── Map page ──────────────────────────────────────────── */
.map-shell {
  position: relative;
  height: calc(100vh - var(--header-h));
  width: 100%;
}
#map {
  position: absolute;
  inset: 0;
  background: var(--wdt-bg-soft);
}
.map-overlay {
  position: absolute;
  top: var(--s-3);
  left: var(--s-3);
  right: var(--s-3);
  z-index: 500;
  background: var(--wdt-bg);
  border: 1px solid var(--wdt-border);
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4);
  pointer-events: auto;
  max-width: 480px;
}
.map-overlay h1 {
  font-size: var(--fs-lg);
  margin-bottom: var(--s-1);
}
.map-overlay p {
  font-size: var(--fs-xs);
  color: var(--wdt-text-soft);
  margin: 0;
}
.legend {
  margin-top: var(--s-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.legend .chip {
  font-size: var(--fs-xs);
  padding: 2px var(--s-2);
  border-radius: 999px;
  border: 1px solid var(--wdt-border);
  color: var(--wdt-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend .chip .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Leaflet override */
.leaflet-popup-content-wrapper {
  background: var(--wdt-bg);
  color: var(--wdt-text);
  border-radius: var(--r-md);
  border: 1px solid var(--wdt-border);
  box-shadow: 0 1px 2px rgba(51, 34, 20, 0.08);
}
.leaflet-popup-content {
  font-family: var(--font-body);
  margin: var(--s-3) var(--s-4);
  line-height: 1.5;
}
.leaflet-popup-tip {
  background: var(--wdt-bg);
  border: 1px solid var(--wdt-border);
}
.leaflet-popup-content .p-name {
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: var(--s-1);
}
.leaflet-popup-content .p-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--wdt-text-soft);
  margin-bottom: var(--s-2);
}
.leaflet-popup-content .p-highlight {
  font-size: var(--fs-sm);
  color: var(--wdt-text);
}
.leaflet-popup-content .p-tags {
  margin-top: var(--s-2);
  font-size: var(--fs-xs);
  color: var(--wdt-text-soft);
}

/* ─── Timeline cards ────────────────────────────────────── */
.country-section {
  margin-bottom: var(--s-8);
}
.country-section .section-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-2);
  border-bottom: 2px solid var(--wdt-text);
}
.country-section .section-head h2 {
  font-size: var(--fs-xl);
}
.country-section .section-head .dates {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--wdt-text-soft);
}
.day-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
.day-card {
  background: var(--wdt-bg);
  border: 1px solid var(--wdt-border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--s-4);
  align-items: start;
}
.day-card .when {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--wdt-text-soft);
}
.day-card .when .date {
  display: block;
  color: var(--wdt-text);
  font-size: var(--fs-sm);
  margin-bottom: 2px;
}
.day-card .body .city {
  font-size: var(--fs-sm);
  color: var(--wdt-text-soft);
  margin-bottom: var(--s-2);
}
.day-card .body .am,
.day-card .body .pm {
  font-size: var(--fs-sm);
  margin-bottom: 4px;
}
.day-card .body .am::before { content: "⏤ 오전  "; color: var(--wdt-text-soft); font-family: var(--font-mono); font-size: var(--fs-xs); }
.day-card .body .pm::before { content: "⏤ 오후  "; color: var(--wdt-text-soft); font-family: var(--font-mono); font-size: var(--fs-xs); }
.day-card .body .stay {
  margin-top: var(--s-2);
  font-size: var(--fs-xs);
  color: var(--wdt-text-soft);
}
.day-card .body .stay::before { content: "⌂  "; }
.day-card .body .transport {
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--wdt-coral);
}
.day-card .body .transport::before { content: "✈︎  "; }
.day-card .body .activity {
  margin-top: var(--s-2);
  font-size: var(--fs-xs);
  padding: 2px 8px;
  display: inline-block;
  border: 1px solid var(--wdt-coral);
  border-radius: 999px;
  color: var(--wdt-coral);
}

/* ─── Archive cards ─────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-4);
}
.place-card {
  background: var(--wdt-bg);
  border: 1px solid var(--wdt-border);
  border-radius: var(--r-md);
  padding: var(--s-4);
}
.place-card .country-flag {
  font-size: var(--fs-lg);
  margin-right: var(--s-1);
}
.place-card .p-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-base);
  margin: var(--s-1) 0;
}
.place-card .p-city {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--wdt-text-soft);
  margin-bottom: var(--s-2);
}
.place-card .p-highlight {
  font-size: var(--fs-sm);
  color: var(--wdt-text);
}
.place-card .p-category {
  display: inline-block;
  font-size: var(--fs-xs);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--wdt-border);
  color: var(--wdt-text-soft);
  margin-top: var(--s-2);
}

.empty-state {
  padding: var(--s-8) var(--s-4);
  text-align: center;
  color: var(--wdt-text-soft);
  border: 1px dashed var(--wdt-border);
  border-radius: var(--r-lg);
  background: var(--wdt-bg-soft);
}
.empty-state .bread-ico {
  font-size: 2rem;
  display: block;
  margin-bottom: var(--s-2);
}
.empty-state h3 {
  color: var(--wdt-text);
  margin-bottom: var(--s-2);
}

/* ─── Footer ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--wdt-border);
  padding: var(--s-5) var(--s-4);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--wdt-text-soft);
}
.site-footer .mono {
  font-family: var(--font-mono);
  margin-top: 4px;
  display: block;
}

/* ─── Responsive ───────────────────────────────────────── */
@media (min-width: 720px) {
  :root { --header-h: 64px; }
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  .day-grid { grid-template-columns: repeat(2, 1fr); }
  .map-overlay { max-width: 380px; }
}

@media (min-width: 1024px) {
  .day-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Small phones */
@media (max-width: 400px) {
  .site-header .inner { gap: var(--s-3); padding: 0 var(--s-3); }
  .brand { font-size: var(--fs-sm); }
  .day-card { grid-template-columns: 60px 1fr; gap: var(--s-3); padding: var(--s-3); }
  .map-overlay { padding: var(--s-3); }
  .map-overlay h1 { font-size: var(--fs-base); }
}
