/* ============================================================
   Monty The Land Rover — Adventure Theme
   ============================================================ */

/* --- Variables --- */
:root {
  --sand:      #f5ede0;
  --dust:      #e8d5b7;
  --earth:     #8b6c42;
  --terracotta:#c4622d;
  --deep:      #1a1208;
  --forest:    #2d4a1e;
  --sky:       #3a7bbf;
  --text:      #2c2415;
  --text-muted:#7a6a50;
  --border:    #ddd0b8;
  --white:     #ffffff;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', monospace;

  --radius:    4px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.1);
  --shadow-md: 0 4px 16px rgba(0,0,0,.15);
  --max-width: 1100px;
  --narrow:    720px;
}

/* --- Reset / Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout helpers --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 1.5rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-sans); font-size: .9rem; font-weight: 600;
  cursor: pointer; border: 2px solid transparent;
  transition: all .2s;
}
.btn-primary {
  background: var(--terracotta); color: var(--white); border-color: var(--terracotta);
}
.btn-primary:hover { background: #a8501f; border-color: #a8501f; text-decoration: none; }
.btn-outline {
  background: transparent; color: var(--white); border-color: rgba(255,255,255,.6);
}
.btn-outline:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.btn-outline.dark { color: var(--terracotta); border-color: var(--terracotta); }
.btn-outline.dark:hover { background: var(--sand); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(26, 18, 8, .95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
  height: 64px;
}
.site-logo {
  display: flex; flex-direction: column; gap: 0;
  color: var(--white); text-decoration: none; line-height: 1.1;
}
.site-logo:hover { text-decoration: none; }
.logo-main { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; color: var(--dust); }
.logo-sub { font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; color: var(--earth); }

.site-nav ul { display: flex; gap: 2rem; list-style: none; }
.site-nav a { color: rgba(255,255,255,.75); font-size: .9rem; font-weight: 500; letter-spacing: .02em; transition: color .2s; }
.site-nav a:hover, .site-nav a.active { color: var(--dust); text-decoration: none; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--white); border-radius: 2px; transition: .3s; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 90vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: var(--deep);
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(26,18,8,.25) 0%, rgba(26,18,8,.65) 100%),
    url('/images/hero-bg.jpg') center/cover no-repeat;
}
.hero-content {
  position: relative; z-index: 1;
  text-align: center; max-width: 720px; padding: 2rem 1.5rem;
}
.hero-eyebrow {
  font-size: .8rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--earth); font-weight: 600; margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-serif); font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--white); line-height: 1.1; margin-bottom: 1.25rem;
}
.hero-lead { font-size: 1.1rem; color: rgba(255,255,255,.75); max-width: 520px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  color: rgba(255,255,255,.4); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
}
.hero-scroll-hint svg { animation: bounce 2s infinite; }
@keyframes bounce { 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(6px) } }

/* ============================================================
   STATS BAR
   ============================================================ */
.stats-bar { background: var(--terracotta); color: var(--white); padding: 1.5rem 0; }
.stats-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
  display: flex; justify-content: space-around; flex-wrap: wrap; gap: 1.5rem;
}
.stat { text-align: center; }
.stat-number { display: block; font-family: var(--font-serif); font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }

/* ============================================================
   COUNTRY TRAIL
   ============================================================ */
.intro-section {
  padding: 5rem 0;
  background: var(--white);
}
.intro-section p {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text);
  text-align: center;
  margin-bottom: 1.4rem !important;
}

.country-trail { padding: 4rem 0; background: var(--sand); }
.section-title {
  font-family: var(--font-serif); font-size: 2rem; color: var(--deep);
  margin-bottom: 2rem; text-align: center;
}
.trail-countries {
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center;
  max-width: 800px; margin: 0 auto;
}
.trail-country {
  padding: .5rem 1.25rem;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 100px; color: var(--earth); font-size: .85rem; font-weight: 600;
  transition: all .2s;
}
.trail-country:hover { background: var(--earth); color: var(--white); border-color: var(--earth); text-decoration: none; }

/* ============================================================
   POST GRID
   ============================================================ */
.latest-posts { padding: 5rem 0; }
.post-grid {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.post-grid-full { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.post-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2); overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.post-card-country {
  display: block; padding: .4rem 1rem;
  background: var(--terracotta); color: var(--white);
  font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700;
  position: relative; z-index: 1;
}

.post-card-image-link { display: block; }
.post-card-image {
  height: 200px;
  background-size: cover; background-position: center;
  background-color: var(--dust);
}
.post-card-image--placeholder {
  height: 200px;
  background: linear-gradient(135deg, var(--dust) 0%, var(--border) 100%);
}
.post-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.post-card-date { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.post-card-title { font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.3; }
.post-card-title a { color: var(--deep); }
.post-card-title a:hover { color: var(--terracotta); text-decoration: none; }
.post-card-location {
  display: flex; align-items: center; gap: .3rem;
  font-size: .8rem; color: var(--text-muted);
}
.post-card-excerpt { font-size: .9rem; color: var(--text-muted); flex: 1; }
.post-card-read-more { font-size: .85rem; font-weight: 600; color: var(--terracotta); margin-top: .5rem; }

.section-cta { text-align: center; margin-top: 2.5rem; }

/* ============================================================
   MAP TEASER
   ============================================================ */
.map-teaser {
  background: var(--forest); color: var(--white);
  padding: 5rem 1.5rem; text-align: center;
}
.map-teaser h2 { font-family: var(--font-serif); font-size: 2.25rem; margin-bottom: 1rem; }
.map-teaser p { max-width: 500px; margin: 0 auto 2rem; opacity: .85; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  background: var(--deep); color: var(--white);
  padding: 3rem 0;
}
.page-header h1 { font-family: var(--font-serif); font-size: 2.5rem; }
.page-lead { margin-top: .75rem; color: rgba(255,255,255,.7); font-size: 1.05rem; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar { padding: 1.5rem 0; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.filter-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); white-space: nowrap; }
.filter-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  padding: .3rem .9rem;
  background: var(--sand); border: 1px solid var(--border);
  border-radius: 100px; font-size: .8rem; font-weight: 500; color: var(--text);
  transition: all .15s;
}
.chip:hover { border-color: var(--terracotta); color: var(--terracotta); text-decoration: none; }
.chip-active { background: var(--terracotta); border-color: var(--terracotta); color: var(--white) !important; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-single { padding-bottom: 4rem; }

.post-hero {
  width: 100%; height: 420px;
  background-size: cover; background-position: center;
  background-color: var(--sand);
}

/* Inline photo shortcode */
.post-photo { margin: 2rem 0; }
.post-photo img { width: 100%; border-radius: var(--radius); display: block; }
.post-photo figcaption { font-size: .82rem; color: var(--text-muted); margin-top: .5rem; text-align: center; }

.post-header {
  background: var(--deep); color: var(--white);
  padding: 3rem 0 2.5rem;
}
.post-country-tag {
  display: inline-block; padding: .25rem .8rem;
  background: var(--terracotta); color: var(--white);
  border-radius: 100px; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; font-weight: 700; margin-bottom: 1rem;
}
.post-country-tag:hover { text-decoration: none; background: #a8501f; }
.post-title {
  font-family: var(--font-serif); font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.15; color: var(--white); margin-bottom: 1rem;
}
.post-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  font-size: .85rem; color: rgba(255,255,255,.6);
}
.post-meta-sep { opacity: .4; }
.post-author { font-style: italic; }
.post-location, .post-miles { display: flex; align-items: center; gap: .25rem; }
.post-day-badge {
  display: inline-block; margin-top: 1rem;
  padding: .3rem .9rem; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2); border-radius: 100px;
  font-size: .78rem; color: rgba(255,255,255,.7); letter-spacing: .06em;
}

.post-body {
  padding-top: 2.5rem; padding-bottom: 2rem;
  font-size: 1.05rem; line-height: 1.8; color: var(--text);
}
.post-body p { margin-bottom: 1.4rem; }
.post-body h2 { font-family: var(--font-serif); font-size: 1.6rem; margin: 2rem 0 .8rem; color: var(--deep); }
.post-body h3 { font-family: var(--font-serif); font-size: 1.25rem; margin: 1.5rem 0 .6rem; }
.post-body img {
  border-radius: var(--radius); margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}
.post-body a { color: var(--terracotta); }
.post-body strong { color: var(--deep); }
.post-body blockquote {
  border-left: 3px solid var(--terracotta);
  padding: .5rem 1.25rem; margin: 1.5rem 0;
  color: var(--text-muted); font-style: italic;
}

/* Photo gallery inside post */
.post-body .gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem;
  margin: 1.5rem 0;
}
.post-body .gallery a { display: block; overflow: hidden; border-radius: var(--radius); aspect-ratio: 4/3; }
.post-body .gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-body .gallery a:hover img { transform: scale(1.04); }

/* Post navigation */
.post-footer {
  padding-top: 2rem; border-top: 1px solid var(--border); margin-top: 2rem;
}
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.post-nav-prev, .post-nav-next {
  display: flex; flex-direction: column; gap: .2rem;
  flex: 1; padding: 1rem 1.25rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text);
}
.post-nav-prev:hover, .post-nav-next:hover { border-color: var(--terracotta); text-decoration: none; }
.post-nav-next { text-align: right; }
.post-nav-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.post-nav-title { font-family: var(--font-serif); font-size: 1rem; color: var(--deep); }
.back-to-blog { display: inline-block; font-size: .85rem; color: var(--text-muted); margin-top: .5rem; }

/* ============================================================
   MAP PAGE
   ============================================================ */
.map-page { padding: 0; }
.map-container {
  height: calc(100vh - 64px);
  position: relative;
}
#route-map { width: 100%; height: 100%; }

.map-controls {
  position: absolute; top: 1rem; right: 1rem; z-index: 1000;
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 1rem; min-width: 220px;
}
.map-controls h3 { font-size: .85rem; font-weight: 700; margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.gpx-upload-label {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: .8rem; color: var(--text-muted);
  transition: all .2s;
}
.gpx-upload-label:hover { border-color: var(--terracotta); color: var(--terracotta); }
#gpx-file-input { display: none; }
#gpx-status { font-size: .75rem; color: var(--text-muted); margin-top: .5rem; text-align: center; }

/* ============================================================
   ABOUT / CONTENT PAGES
   ============================================================ */
.content-page { padding: 3rem 0 5rem; }
.content-page h2 { font-family: var(--font-serif); font-size: 1.75rem; margin: 2rem 0 .75rem; color: var(--deep); }
.content-page p { margin-bottom: 1.2rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--deep); color: rgba(255,255,255,.7); padding: 3rem 0 0; }
.footer-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem;
}
.footer-brand .logo-main { font-family: var(--font-serif); font-size: 1.25rem; color: var(--dust); }
.footer-brand .logo-sub { font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; color: var(--earth); }
.footer-brand p { font-size: .85rem; margin-top: .75rem; color: rgba(255,255,255,.45); }
.footer-links h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--earth); margin-bottom: .75rem; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .875rem; }
.footer-links a:hover { color: var(--white); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); margin-top: 2.5rem;
  padding: 1.25rem 1.5rem; text-align: center; font-size: .8rem;
  color: rgba(255,255,255,.35);
  max-width: 100%;
}
.footer-bottom a { color: rgba(255,255,255,.5); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--deep); padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 1rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .post-nav { flex-direction: column; }
  .post-nav-next { text-align: left; }
  .stats-inner { gap: 1rem; }
  .map-controls { position: static; margin: 1rem; }
  .map-container { height: 60vh; }
}

/* ============================================================
   PAGINATION  (matches Hugo internal template output)
   ============================================================ */
.pagination {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: .35rem; padding: 2rem 0;
  list-style: none;
}
.page-item { display: flex; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; padding: .4rem .75rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .875rem; color: var(--text);
  background: var(--white); text-decoration: none;
  transition: background .15s, border-color .15s;
  line-height: 1.4;
}
.page-link:hover { background: var(--sand); border-color: var(--earth); color: var(--text); text-decoration: none; }
.page-item.active .page-link {
  background: var(--terracotta); border-color: var(--terracotta); color: var(--white);
  pointer-events: none;
}
.page-item.disabled .page-link { opacity: .4; pointer-events: none; }
