:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface2: #eef1f4;
  --text: #1a2332;
  --muted: #5c6b7a;
  --accent: #1e3a5f;
  --border: #d8dee6;
  --epic: #EF7E24;
  --ikon: #F4CD32;
  --mc: #45C5B1;
  --indy: #D70300;
  --pa: #1B3174;
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --sidebar-width: 280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* ——— Header (consistent across pages) ——— */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}
.brand .name {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.15;
  color: var(--accent);
  text-transform: uppercase;
}
.logo-mark {
  display: block;
  flex-shrink: 0;
  width: 48px;
  height: 40px;
}
/* Square favicons (Indy / PA) — no rounded corners */
.pass-favicon[src*="indy"],
.pass-favicon[src*="powder_alliance"] {
  border-radius: 0 !important;
}
.nav { display: flex; gap: 0.15rem; }
.nav-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.5rem 0.95rem;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  transition: color 0.15s;
}
.nav-btn:hover { color: var(--text); }
.nav-btn.active {
  color: var(--accent);
  font-weight: 600;
}
.nav-btn.active::after {
  content: "";
  position: absolute;
  left: 0.95rem;
  right: 0.95rem;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

/* Pages */
main { flex: 1; }
.page { display: none; }
.page.active { display: block; }

/* ——— Home: Editorial hero ——— */
.hero-editorial {
  position: relative;
  background: #f7f3eb;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}
.hero-mountains {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-mountains svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-copy {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3.5rem 1.5rem 3rem;
  max-width: 780px;
}
.hero-copy h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 600;
  color: #1a2b3c;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.hero-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.1rem 0 0.9rem;
}
.hero-ornament .line {
  width: 48px;
  height: 1px;
  background: #8fa8b8;
}
.hero-ornament .flake {
  color: #8fa8b8;
  font-size: 0.85rem;
}
.hero-copy .lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36ch;
  margin: 0 auto;
}

/* Sections */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}
.section-wide { max-width: 1180px; }
.section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 1rem;
}
.page-title {
  font-size: 1.75rem;
  font-weight: 650;
  color: #0f172a;
  margin-bottom: 0.4rem;
}
.about h2 {
  font-size: 1.35rem;
  margin-bottom: 0.85rem;
  font-weight: 650;
}
.about p {
  color: var(--muted);
  margin-bottom: 0.75rem;
  max-width: 65ch;
}
.about strong { color: var(--text); }
.entry-points {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.primary:hover { opacity: 0.9; }
.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.secondary:hover { background: var(--surface2); }

/* ——— Bold brand pass cards ——— */
.pass-cards-bold {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.9rem;
}
@media (max-width: 1000px) {
  .pass-cards-bold { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
  .pass-cards-bold { grid-template-columns: 1fr 1fr; }
}
.pass-card-bold {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, transform 0.15s;
  min-width: 0;
}
.pass-card-bold:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.pass-card-bold .bar {
  width: 6px;
  flex-shrink: 0;
  align-self: stretch;
}
.pass-card-bold .body {
  padding: 1.15rem 1rem 1.05rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
}
.pass-card-bold .icon-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.1rem;
}
.pass-card-bold .icon-row svg {
  width: 26px;
  height: 26px;
}
.pass-card-bold .pass-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.pass-card-bold .count {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.05;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.pass-card-bold .count span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: block;
  margin-top: 0.2rem;
}
.pass-card-bold .pitch {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  flex: 1;
  margin-top: 0.2rem;
}
.pass-card-bold .card-btn {
  margin-top: 0.85rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1.5px solid;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.pass-card-bold .card-btn:hover {
  color: #fff !important;
}

/* ——— Map (Map-First Utility) ——— */
#page-map {
  height: calc(100vh - 57px - 44px);
  display: none;
  flex-direction: row;
}
#page-map.active { display: flex; }

.map-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.1rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 500;
}
.sidebar-section h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.55rem;
  font-weight: 650;
}
.sidebar-stats {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.stat-big {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Map sidebar: toggle rows (icon + label + switch) */
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fafbfc;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.filter-row:hover { background: #f3f5f7; }
.filter-row.off { opacity: 0.55; }
.filter-row .filter-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.filter-row .filter-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.filter-row .filter-icon svg {
  width: 18px;
  height: 18px;
}
.filter-row .filter-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter-row .filter-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 0.25rem;
}

/* Toggle switch */
.toggle {
  --toggle-color: #94a3b8;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s;
}
.filter-row.on .toggle {
  background: var(--toggle-color);
}
.toggle .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.15s;
}
.filter-row.on .toggle .knob {
  transform: translateX(18px);
}

/* Resorts page type chips (keep compact pills) */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 550;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  user-select: none;
  transition: all 0.12s;
}
.filter-chip.on {
  background: #1e3a5f;
  color: #fff;
  border-color: #1e3a5f;
}

.search-wrap { position: relative; width: 100%; }
#map-search, #resort-search {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
}
#map-search:focus, #resort-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30,58,95,0.12);
}
.search-results {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 2000;
  list-style: none;
  box-shadow: 0 10px 28px rgba(0,0,0,0.12);
}
.search-results li {
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--surface2);
}
.search-results li:hover { background: var(--surface2); }
.search-results li .meta { color: var(--muted); font-size: 0.78rem; }
.hidden { display: none !important; }

#map { flex: 1; min-height: 400px; background: #e8eef3; }

.leaflet-container { background: #e8eef3; font-family: var(--font); }
.leaflet-popup-content-wrapper {
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  border: 1px solid var(--border);
}
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 0.75rem 0.9rem; font-size: 0.9rem; }
.leaflet-popup-content h3 { margin-bottom: 0.35rem; font-size: 1rem; }
.leaflet-popup-content .pass-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.4rem 0; }

.pie-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  color: #fff;
}
.tag.epic { background: var(--epic); }
.tag.ikon { background: var(--ikon); color: #1a1a1a; }
.tag.mc { background: var(--mc); color: #0f172a; }
.tag.indy { background: var(--indy); }
.tag.pa { background: var(--pa); }
.tag.dim { opacity: 0.55; }

/* Compare & tables */
.note { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; max-width: 80ch; }
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.compare-table, .resorts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  table-layout: fixed;
}
.compare-table th, .compare-table td,
.resorts-table th, .resorts-table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--surface2);
  vertical-align: top;
}
.compare-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
}
.th-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.compare-table td:first-child {
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
}
.compare-table tbody tr:hover { background: #f8fafc; }

/* Resorts */
.resorts-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}
.resorts-toolbar .type-filters.inline {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.resorts-toolbar .filter-chip {
  width: auto;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}
#resort-sort {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.map-stats { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }

.resorts-table-wrap {
  max-height: calc(100vh - 220px);
  overflow: auto;
}
.resorts-table { min-width: 640px; }
.resorts-table .col-name { width: 32%; }
.resorts-table .col-passes { width: 22%; }
.resorts-table .col-location { width: 28%; }
.resorts-table .col-type { width: 18%; }
.resorts-table th {
  background: #f8fafc;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
  color: #0f172a;
  box-shadow: 0 1px 0 var(--border);
}
.resorts-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resorts-table tbody tr { cursor: pointer; }
.resorts-table tbody tr:hover { background: #f1f5f9; }

.pass-icons { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.pass-icon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.pass-icon.epic { background: var(--epic); }
.pass-icon.ikon { background: var(--ikon); color: #1a1a1a; }
.pass-icon.mc { background: var(--mc); color: #0f172a; }
.pass-icon.indy { background: var(--indy); }
.pass-icon.pa { background: var(--pa); }
.pass-icon.dim { opacity: 0.5; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.4);
}
.modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}
.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
#modal-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  padding-right: 1.5rem;
  color: #0f172a;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
  font-size: 0.9rem;
}
.detail-grid dt { color: var(--muted); font-size: 0.8rem; }
.detail-grid dd { font-weight: 500; margin-bottom: 0.35rem; }

.site-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  #page-map {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 57px - 44px);
  }
  .map-sidebar {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 42vh;
  }
  #map { min-height: 50vh; }
  .hero-copy { padding: 2.5rem 1rem; }
}

/* Pass favicons */
.pass-favicon {
  display: block;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}
.pass-icon-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.pass-icon-fav.dim {
  opacity: 0.45;
}
.pass-icon-fav .pass-favicon {
  width: 20px;
  height: 20px;
}
.filter-row .filter-icon .pass-favicon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}
.pass-card-bold .icon-row .pass-favicon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
