:root {
  --bg: #f4f8f7;
  --text: #11181d;
  --muted: #4b5560;
  --line: #d7e3de;
  --card: #ffffff;
  --accent: #4f7d76;
  --accent-soft: #dfeee8;
  --accent-alt: #5b7ca8;
  --max: 1040px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

a { color: inherit; text-decoration-color: rgba(79, 125, 118, 0.35); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

body.map-page .container {
  max-width: 1040px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

body.map-page .map-wrapper {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.site-header,
.site-footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.25rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.site-branding {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-title {
  font-weight: 800;
  text-decoration: none;
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 1px 4px rgba(79, 125, 118, 0.2);
  transition: transform 0.2s ease, text-shadow 0.2s ease;
}

.site-title:hover {
  transform: translateY(-1px);
  text-shadow: 0 2px 8px rgba(79, 125, 118, 0.35);
}

.site-description {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Compact header layout on wider screens: keep nav buttons on one line and
   place title + subtitle inline to save vertical space. */
@media (min-width: 800px) {
  .site-branding {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    flex: 1 1 auto;
    min-width: 0; /* allow shrinking for flex child overflow handling */
  }
  .site-title {
    font-size: 1.15rem;
  }
  .site-description {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
    opacity: 0.95;
    flex: 1 1 auto;
    max-width: 48ch;
    white-space: normal; /* allow wrapping */
    line-height: 1.15;
  }
  /* ensure title doesn't shrink and nav keeps one line */
  .site-title { flex: 0 0 auto; }
  nav { flex: 0 0 auto; }
  nav a { white-space: nowrap; }
  nav {
    flex-wrap: nowrap;
  }
  nav a {
    white-space: nowrap;
  }
}

nav {
  display: flex;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

nav a {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #000000;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s ease, color 0.2s ease;
}

nav a:hover {
  background: #d3e7e0;
  color: #000000;
}

.intro,
.page-intro {
  padding: 1.5rem 0 1rem;
}

.page-intro h1 {
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  margin-bottom: 0.35rem;
}

/* Grouped country / city list under the map statistics */
.places-list {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}
.country-group {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
}
.country-group strong {
  display: block;
  margin-bottom: 0.35rem;
}
.country-group ul {
  margin: 0;
  padding-left: 1.1rem;
}
.country-group li {
  margin: 0.15rem 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.eyebrow,
.meta {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

h1, h2, h3 {
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(2.2rem, 7vw, 4.6rem); letter-spacing: -0.05em; }

.post-header h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
h2 { font-size: 1.8rem; margin-top: 2rem; }
h3 { font-size: 1.25rem; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

.post-card,
.destination {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem;
  margin: 1rem 0;
}

.post-card-link {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  color: inherit;
  text-decoration: none;
}

.post-card-link:hover {
  color: inherit;
}

.post-card-image {
  width: 160px;
  height: 110px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.post-card-image.placeholder {
  background: linear-gradient(135deg, #e2efe9, #f4faf8);
}

.post-card-content {
  flex: 1;
}

.post-card h3 {
  margin-bottom: 0.35rem;
}

.gallery-week {
  margin: 2rem 0 2.5rem;
}

.gallery-week h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 0;
}

.gallery-card {
  margin: 0;
}

.gallery-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  display: block;
}

.gallery-card figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.tags span,
.trip-facts span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.post-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.dek {
  font-size: 1.2rem;
  color: var(--muted);
}

.trip-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.hero-image {
  display: block;
  width: min(70%, 640px);
  max-height: 320px;
  object-fit: cover;
  border-radius: 16px;
  margin: 0 0 2rem;
}

.post-footer-link {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.post-footer-link a {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-alt);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.post-footer-link a:hover {
  background: #d3e7e0;
  color: var(--accent);
}

.post-content img {
  max-width: 100%;
  border-radius: 16px;
}

.map-wrapper {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(17, 24, 29, 0.07);
}

.map-legend-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #11181d;
}

.map-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #33404d;
  font-size: 0.9rem;
}

.map-legend-line {
  width: 24px;
  height: 4px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.travel-map {
  height: 560px;
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #f7faf9;
}

.map-marker-wrapper {
  background: transparent;
  border: none;
}

.map-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.map-marker-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  text-shadow: none;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0,0,0,0.06);
}

.map-marker-week,
.map-marker-label {
  display: none;
}

.map-marker-dot.zero {
  /* subtle home marker: white center with accent border and muted label */
  background: #ffffff !important;
  color: var(--muted);
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

blockquote {
  border-left: 3px solid var(--accent);
  margin-left: 0;
  padding-left: 1rem;
  color: var(--muted);
}

.site-footer {
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  nav { flex-wrap: wrap; }
  .intro { padding-top: 1rem; }
  .post-card-link { flex-direction: column; }
  .post-card-image { width: 100%; height: 150px; }
  .gallery-grid { grid-template-columns: 1fr; }
}

/* Map stats tab styling */
.map-tabs { margin-top: 1rem; }
.map-tabs .tab { font-size: 0.9rem; }
.map-stats h3 { margin: 0 0 0.5rem 0; }
.map-stats ol { margin: 0.25rem 0 0.5rem 1.25rem; }
.map-stats table th { width: 220px; color: var(--muted); font-weight:600 }
