:root {
  --cream: #F6F1E6;
  --paper: #FFFDF8;
  --ink: #162338;
  --ink-soft: #4A5568;
  --navy: #1F3A5F;
  --clay: #BC5B39;
  --gold: #D7A23B;
  --line: #E3DBC8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

.topnav {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1001;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 700;
}

.nav-links { display: flex; gap: 18px; }
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}
.nav-links a:hover { background: var(--line); }

.map-header {
  background: var(--paper);
  border-bottom: 1.5px solid var(--line);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  z-index: 1000;
}

.map-title h1 {
  font-family: Georgia, serif;
  font-size: 20px;
  margin: 0 0 2px;
}

.map-title p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.filters { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 5px 12px 5px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.chip:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(22,35,56,0.15); }
.chip.off { opacity: 0.35; }

.chip .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--dot-color, var(--ink));
  border: 1.5px solid rgba(0,0,0,0.2);
  flex-shrink: 0;
}

#map {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: #E8E2D2;
}

.leaflet-popup.tourney-tip .leaflet-popup-content-wrapper {
  background: var(--paper);
  border: none;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(22,35,56,0.25);
  padding: 0;
}
.leaflet-popup.tourney-tip .leaflet-popup-content { margin: 0; }
.leaflet-popup.tourney-tip .leaflet-popup-tip { background: var(--paper); }
.leaflet-popup.tourney-tip .leaflet-popup-close-button {
  top: 6px; right: 8px;
  color: var(--ink-soft);
  font-size: 18px;
}

.tip-card {
  border-left: 5px solid var(--ink);
  border-radius: 10px;
  padding: 10px 28px 10px 11px;
  min-width: 200px;
  max-width: 240px;
}
.tip-card .org { font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; color: var(--ink-soft); margin-bottom: 3px; }
.tip-card .name { font-family: Georgia, serif; font-size: 14.5px; font-weight: 700; line-height: 1.25; margin-bottom: 5px; }
.tip-card .loc { font-size: 12px; color: var(--ink); margin-bottom: 2px; }
.tip-card .date { font-size: 11.5px; font-family: "SFMono-Regular", Menlo, Consolas, monospace; color: var(--ink-soft); margin-bottom: 6px; }
.tip-card .cta {
  display: inline-block;
  font-size: 10.5px; font-weight: 600;
  color: var(--paper);
  background: var(--gold);
  border-radius: 6px;
  padding: 4px 9px;
  text-decoration: none;
}
.tip-card .cta:hover { opacity: 0.85; }

.marker-pin {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
}

.cluster-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  border: 2px solid var(--paper);
  box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

@media (max-width: 640px) {
  .map-title h1 { font-size: 17px; }
  .chip { font-size: 11px; padding: 4px 10px 4px 8px; }
}

.age-tabs { display: flex; gap: 6px; margin-top: 6px; }
.age-tab {
  text-decoration: none;
  font-size: 12px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  transition: all 0.15s;
}
.age-tab:hover { background: var(--line); }
.age-tab.active { background: var(--ink); color: var(--paper); }

/* ── Home page hero ─────────────────────────────────────────── */
.page-hero {
  background: var(--navy);
  color: var(--paper);
  padding: 80px 24px 72px;
  text-align: center;
}

.hero-inner {
  max-width: 640px;
  margin: 0 auto;
}

.hero-title {
  font-family: Georgia, serif;
  font-size: 52px;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.1;
  color: var(--paper);
}

.hero-tagline {
  font-size: 18px;
  color: #C8BDAD;
  margin: 0 0 36px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  background: var(--clay);
  color: var(--paper);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.88; }

.btn-outline {
  background: transparent;
  border: 2px solid var(--paper);
  color: var(--paper);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); opacity: 1; }

/* ── Content sections ───────────────────────────────────────── */
.posts-section,
.complexes-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-header h2 {
  font-family: Georgia, serif;
  font-size: 26px;
  margin: 0;
  color: var(--ink);
}

.view-all {
  font-size: 14px;
  font-weight: 600;
  color: var(--clay);
  text-decoration: none;
}
.view-all:hover { text-decoration: underline; }

/* ── Page header (list pages) ───────────────────────────────── */
.page-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 0;
  border-bottom: 2px solid var(--line);
}

.page-header h1 {
  font-family: Georgia, serif;
  font-size: 32px;
  margin: 0 0 20px;
  color: var(--ink);
}

/* ── Category filter tabs ───────────────────────────────────── */
.cat-tabs {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-tab {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}
.cat-tab:hover { border-color: var(--ink); color: var(--ink); }
.cat-tab.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ── Post grid ──────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 2-column variant used on list page */
.post-grid-2col {
  grid-template-columns: repeat(2, 1fr);
  padding: 28px 24px 64px;
}

/* ── Post card ──────────────────────────────────────────────── */
.post-card {
  display: block;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 22px 22px 18px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(22,35,56,0.12);
}

.post-card-title {
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  margin: 10px 0 8px;
  line-height: 1.3;
  color: var(--ink);
}

.post-card-excerpt {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.55;
}

/* ── Category badge ─────────────────────────────────────────── */
.category-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--paper);
  background: var(--ink-soft);
}
.category-gear    { background: var(--gold); color: var(--ink); }
.category-guide   { background: #2F6F4E; }
.category-general { background: var(--ink-soft); }

/* ── Post meta line ─────────────────────────────────────────── */
.post-meta {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}

/* ── Article layout ─────────────────────────────────────────── */
.article-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.back-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--clay);
  text-decoration: none;
  margin-bottom: 28px;
}
.back-link:last-child { margin-top: 48px; margin-bottom: 0; }
.back-link:hover { text-decoration: underline; }

.article {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 40px 44px 44px;
}

.article-title {
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 700;
  margin: 12px 0 8px;
  line-height: 1.2;
  color: var(--ink);
}

.article-subtitle {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

/* ── Prose (markdown body) ──────────────────────────────────── */
.prose {
  margin-top: 28px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}

.prose h2, .prose h3 {
  font-family: Georgia, serif;
  color: var(--ink);
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.prose h2 { font-size: 22px; }
.prose h3 { font-size: 18px; }

.prose p { margin: 0 0 1.1em; }

.prose a { color: var(--clay); }
.prose a:hover { text-decoration: none; }

.prose ul, .prose ol {
  padding-left: 1.5em;
  margin: 0 0 1.1em;
}

.prose li { margin-bottom: 0.4em; }

.prose blockquote {
  border-left: 4px solid var(--gold);
  margin: 1.5em 0;
  padding: 8px 20px;
  color: var(--ink-soft);
  font-style: italic;
}

.prose code {
  background: var(--cream);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 15px;
}

.prose pre {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}

.prose pre code { background: none; padding: 0; }

.prose img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
}

/* ── Complex card ───────────────────────────────────────────── */
.complex-card {
  display: block;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 22px 22px 18px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}
.complex-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(22,35,56,0.12);
}

.complex-location {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

/* ── Star rating ────────────────────────────────────────────── */
.stars { display: inline-flex; gap: 2px; margin-bottom: 10px; }
.stars-large { font-size: 22px; margin-bottom: 12px; }

.star { font-size: 16px; line-height: 1; }
.star.filled { color: var(--gold); }
.star.empty  { color: var(--line); }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  color: var(--ink-soft);
  font-size: 15px;
  padding: 40px 24px;
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid-2col { grid-template-columns: 1fr; }
  .hero-title { font-size: 38px; }
}

@media (max-width: 640px) {
  .post-grid,
  .post-grid-2col { grid-template-columns: 1fr; }
  .article { padding: 28px 22px 32px; }
  .article-title { font-size: 26px; }
  .hero-title { font-size: 30px; }
  .hero-tagline { font-size: 16px; }
}
