/* ============================================================
   Design system — minimalistic, monochrome + one accent
   ============================================================ */
:root {
  /* color */
  --bg: #fbfaf6;
  --bg-elev: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #444;
  --ink-3: #777;
  --line: #e7e3da;
  --line-2: #d8d2c4;
  --accent: #b85c38;   /* sienna */
  --accent-soft: #b85c3815;

  /* type */
  --serif: "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 72px;
  --sp-9: 112px;

  --maxw: 760px;
  --maxw-wide: 1080px;
  --radius: 2px;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ============================================================
   Layout
   ============================================================ */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
.wrap-wide {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  padding: var(--sp-8) 0 var(--sp-7);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--sp-6);
  align-items: center;
}
.author-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 25%;
  border: 1px solid var(--line);
  background: var(--bg);
  filter: saturate(0.95);
}
.author-text { min-width: 0; }
.site-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 var(--sp-3);
}
.site-title a { display: inline-block; }
.author-bio {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
  max-width: 56ch;
}

@media (max-width: 600px) {
  .site-header-inner {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }
  .author-photo {
    width: 96px;
    height: 96px;
  }
  .site-title { font-size: 44px; }
}

/* ============================================================
   View toggle
   ============================================================ */
.toggle {
  display: flex;
  gap: var(--sp-6);
  padding: var(--sp-5) 0 var(--sp-3);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.toggle-btn {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.toggle-btn:hover { color: var(--ink); }
.toggle-btn.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.toggle-meta {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-3);
  align-self: center;
}

/* ============================================================
   Section heading (used for month/year + country groupings)
   ============================================================ */
.section-heading {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  padding: var(--sp-8) 0 var(--sp-4);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-6);
}
.section-heading h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-heading .count {
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

/* ============================================================
   Post card
   ============================================================ */
.post {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  padding: var(--sp-6) 0;
  border-bottom: 1px solid var(--line);
}
.post:last-child { border-bottom: 0; }

.post-meta {
  display: flex;
  gap: var(--sp-4);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  align-items: center;
}
.post-meta .dot {
  width: 3px; height: 3px;
  background: var(--ink-3);
  border-radius: 50%;
}
.post-country { color: var(--accent); }

.post-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin: 0;
}
.post-title a {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .25s ease;
}
.post-title a:hover { background-size: 100% 1px; }

.post-excerpt {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0;
  max-width: 640px;
}

.post-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
  margin-top: var(--sp-2);
}
.post-locations {
  font-size: 13px;
  color: var(--ink-3);
}
.post-locations span:not(:last-child)::after {
  content: " · ";
  color: var(--line-2);
}
.post-link {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-left: auto;
}
.post-link::after {
  content: " →";
  transition: margin-left .15s ease;
  display: inline-block;
}
.post-link:hover::after { margin-left: 4px; }

/* ============================================================
   Map view
   ============================================================ */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--sp-6);
  padding: var(--sp-6) 0;
  align-items: start;
}
#map {
  height: 70vh;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.map-list {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: var(--sp-3);
}
.map-list-item {
  display: block;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.map-list-item:first-child { padding-top: 0; }
.map-list-item:last-child { border-bottom: 0; }
.map-list-item .country {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}
.map-list-item .title {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.3;
  color: var(--ink);
}
.map-list-item:hover .title { color: var(--accent); }
.map-list-item.active {
  background: var(--accent-soft);
  margin: 0 calc(-1 * var(--sp-3));
  padding-left: var(--sp-3);
  padding-right: var(--sp-3);
}

/* Leaflet popup override to match design */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
  background: var(--bg-elev) !important;
  box-shadow: 0 4px 24px rgba(26,26,26,0.12) !important;
}
.leaflet-popup-content {
  margin: var(--sp-4) var(--sp-4) !important;
  font-family: var(--sans);
  color: var(--ink);
  min-width: 200px;
}
.leaflet-popup-content .pop-country {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.leaflet-popup-content .pop-title {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.25;
  margin: 0 0 var(--sp-3);
  color: var(--ink);
}
.leaflet-popup-content .pop-link {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Custom marker pin */
.pin {
  width: 14px; height: 14px;
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--accent);
  transition: transform .15s ease;
}
.pin:hover { transform: scale(1.4); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: var(--sp-8) 0 var(--sp-7);
  margin-top: var(--sp-8);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}
.site-footer a {
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
}
.site-footer a:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .site-title { font-size: 40px; }
  .section-heading h2 { font-size: 24px; }
  .post-title { font-size: 22px; }
  .toggle { gap: var(--sp-4); }
  .toggle-meta { display: none; }
  .map-layout {
    grid-template-columns: 1fr;
  }
  #map { height: 50vh; min-height: 360px; }
  .map-list { max-height: none; padding-right: 0; }
}

@media (max-width: 480px) {
  .site-header { padding: var(--sp-7) 0 var(--sp-6); }
  .site-title { font-size: 34px; }
  .toggle { gap: var(--sp-3); overflow-x: auto; }
  .toggle-btn { white-space: nowrap; font-size: 12px; }
  .post-footer { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
  .post-link { margin-left: 0; }
}
