/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a5632;       /* Wisconsin green */
  --primary-light: #2d7a4a;
  --primary-dark: #0f3a20;
  --accent: #c5a55a;        /* Gold accent */
  --accent-light: #dbc480;
  --bg: #faf9f7;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-light: #5a5a5a;
  --text-muted: #8a8a8a;
  --border: #e5e2dc;
  --border-light: #f0ede8;
  --success: #2d8a4e;
  --caution: #d4a017;
  --danger: #c0392b;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --header-h: 64px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }
img { max-width: 100%; display: block; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; border: none; transition: all 0.2s;
}
.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-light); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-clear {
  background: transparent; color: var(--text-muted);
  font-weight: 500; padding: 10px 12px;
}
.btn-clear:hover { color: var(--text); }

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 100%;
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; font-weight: 700; color: var(--text); }
.logo-icon { color: var(--primary); font-size: 1.5rem; }
.logo-accent { color: var(--primary); }
.header-nav { display: flex; gap: 24px; }
.header-nav a { color: var(--text-light); font-weight: 500; font-size: 0.9rem; }
.header-nav a:hover { color: var(--primary); }

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 380px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(26,86,50,0.92) 0%, rgba(15,58,32,0.88) 100%),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400"><rect fill="%231a5632" width="400" height="400"/><circle cx="200" cy="200" r="120" fill="none" stroke="%23ffffff08" stroke-width="60"/><circle cx="200" cy="200" r="200" fill="none" stroke="%23ffffff05" stroke-width="40"/></svg>');
  background-size: cover;
  color: #fff;
  padding: 60px 24px;
}
.hero-content { position: relative; z-index: 2; max-width: 700px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero-sub {
  font-size: 1.15rem;
  opacity: 0.92;
  margin-bottom: 16px;
  line-height: 1.6;
}
.hero-sub strong { color: var(--accent-light); }
.hero-stat {
  font-size: 0.95rem;
  opacity: 0.8;
  margin-bottom: 24px;
}
.stat-num { font-weight: 700; color: var(--accent-light); font-size: 1.1rem; }

/* ===== FILTER BAR ===== */
.filter-section {
  position: sticky; top: var(--header-h); z-index: 90;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 12px;
}
.filter-bar { max-width: 1400px; margin: 0 auto; }
.filter-row {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 140px; flex: 1; }
.filter-group label {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
}
.filter-group select, .filter-group input[type="text"] {
  padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 0.875rem;
  background: #fff; color: var(--text);
  font-family: var(--font-body);
}
.filter-group select:focus { border-color: var(--primary); outline: none; }
.range-wrapper { display: flex; align-items: center; gap: 8px; }
.range-wrapper input[type="range"] { flex: 1; accent-color: var(--primary); }
.range-val { font-size: 0.8rem; font-weight: 600; color: var(--primary); min-width: 40px; }

.more-filters {
  padding-top: 12px; margin-top: 12px;
  border-top: 1px solid var(--border-light);
}
.filter-toggles { gap: 16px; padding-top: 8px; }
.toggle-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.85rem; color: var(--text-light);
  cursor: pointer; white-space: nowrap;
}
.toggle-label input { accent-color: var(--primary); }

.results-count {
  max-width: 1400px; margin: 8px auto 0;
  font-size: 0.85rem; color: var(--text-muted);
}

/* ===== MAIN LAYOUT: CARDS LEFT + MAP RIGHT ===== */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h) - 120px);
}

.cards-panel {
  padding: 20px 20px 20px 24px;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-h) - 120px);
  display: flex; flex-direction: column; gap: 16px;
}

.map-panel {
  position: sticky;
  top: calc(var(--header-h) + 120px);
  height: calc(100vh - var(--header-h) - 120px);
  padding: 20px 24px 20px 0;
}
#map {
  width: 100%; height: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

/* ===== VENUE CARDS ===== */
.venue-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.venue-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.venue-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px;
}
.venue-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.venue-card-meta {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
  font-size: 0.8rem; color: var(--text-light);
}
.venue-card-meta span { display: flex; align-items: center; gap: 3px; }
.venue-card-desc {
  font-size: 0.875rem; color: var(--text-light);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 12px;
}

/* Catering badges — THE MOAT */
.catering-badges {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
  white-space: nowrap;
}
.badge-yes {
  background: #e8f5e9; color: #2e7d32;
  border: 1px solid #a5d6a7;
}
.badge-no {
  background: #fbe9e7; color: #c62828;
  border: 1px solid #ef9a9a;
}
.badge-preferred {
  background: #fff8e1; color: #f57f17;
  border: 1px solid #ffe082;
}
.badge-unknown {
  background: #f5f5f5; color: #757575;
  border: 1px solid #e0e0e0;
}
.badge-info {
  background: #e3f2fd; color: #1565c0;
  border: 1px solid #90caf9;
}
.badge-type {
  background: #f3e5f5; color: #6a1b9a;
  border: 1px solid #ce93d8;
}

.price-tag {
  font-weight: 700; color: var(--primary);
  font-size: 0.9rem;
}

/* No results */
.no-results {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted); grid-column: 1 / -1;
}
.no-results h3 { font-family: var(--font-display); margin-bottom: 8px; color: var(--text-light); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: var(--radius-lg);
  max-width: 680px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-sm { max-width: 420px; }
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none;
  font-size: 1.8rem; color: var(--text-muted);
  cursor: pointer; line-height: 1; z-index: 10;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 32px; }
.modal-body h2 {
  font-family: var(--font-display); font-size: 1.5rem;
  margin-bottom: 8px;
}
.modal-section { margin-top: 20px; }
.modal-section h4 {
  font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
  margin-bottom: 8px;
}
.modal-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.modal-detail { font-size: 0.9rem; }
.modal-detail .label { color: var(--text-muted); font-size: 0.8rem; }
.modal-detail .value { font-weight: 500; }
.modal-catering-notes {
  background: #f9f8f5; border-radius: var(--radius);
  padding: 12px 16px; font-size: 0.875rem;
  color: var(--text-light); margin-top: 12px;
  border-left: 3px solid var(--accent);
}

/* Email gate */
#email-form { display: flex; gap: 8px; margin-top: 16px; }
#email-input {
  flex: 1; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 0.9rem; font-family: var(--font-body);
}
#email-input:focus { border-color: var(--primary); outline: none; }
.fine-print { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; }

/* Gated content placeholder */
.gated-info {
  background: #f9f8f5; border-radius: var(--radius);
  padding: 16px; text-align: center; margin-top: 12px;
  border: 1px dashed var(--border);
}
.gated-info a { font-weight: 600; }

/* ===== HOW SECTION ===== */
.how-section {
  max-width: 1000px; margin: 60px auto; padding: 0 24px;
  text-align: center;
}
.how-section h2 {
  font-family: var(--font-display); font-size: 1.8rem;
  margin-bottom: 32px;
}
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.how-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
}
.how-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin: 0 auto 12px;
}
.how-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.how-card p { font-size: 0.875rem; color: var(--text-light); }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--primary-dark); color: rgba(255,255,255,0.7);
  padding: 32px 24px; text-align: center; font-size: 0.85rem;
}
.footer-inner { max-width: 1400px; margin: 0 auto; }
.footer-tagline { margin-top: 4px; opacity: 0.6; }

/* ===== MAP MARKERS ===== */
.leaflet-popup-content { font-family: var(--font-body); font-size: 0.85rem; }
.leaflet-popup-content h4 { font-family: var(--font-display); margin-bottom: 4px; }
.marker-catering-yes { filter: hue-rotate(100deg); }
.marker-catering-no { filter: hue-rotate(-30deg) saturate(2); }

/* Custom marker cluster */
.venue-marker {
  width: 28px; height: 28px;
  background: var(--primary);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .map-panel {
    position: relative; top: auto;
    height: 350px;
    padding: 0 24px 20px;
    order: -1;
  }
  .cards-panel {
    max-height: none; overflow: visible;
    padding: 20px 24px;
  }
}

@media (max-width: 768px) {
  .filter-row { flex-direction: column; gap: 10px; }
  .filter-group { min-width: 100%; }
  .hero { min-height: 280px; padding: 40px 20px; }
  .hero h1 { font-size: 1.8rem; }
  .how-grid { grid-template-columns: 1fr; }
  .modal-detail-grid { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .filter-section { position: relative; top: auto; }
  #email-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .hero { min-height: 240px; }
  .venue-card { padding: 16px; }
  .map-panel { height: 250px; }
}

/* ===== LOADING STATE ===== */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
  height: 120px;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Ad unit placeholder */
.ad-unit {
  background: #f5f5f5; border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 20px;
  text-align: center; color: var(--text-muted);
  font-size: 0.8rem; margin: 16px 0;
}
