:root {
  --accent-blue: #1c6e8c;
  --accent-blue-dark: #14536a;
  --accent-green: #2e8b40;
  --accent-deep: #0d3b46;
  --bg-tint: #eef6f3;
  --text-dark: #1a1a1a;
  --text-muted: #5a6570;
  --border-light: #e3e6e8;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(13, 59, 70, 0.08);
  --shadow-md: 0 10px 28px rgba(13, 59, 70, 0.14);
  --font-heading: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text-dark);
  font-family: var(--font-body);
  line-height: 1.55;
  background: white;
}

section {
  padding: 3.5rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 600;
}

h2 {
  font-size: 1.7rem;
  margin: 0 0 0.5rem;
}

a {
  color: var(--accent-blue);
}

/* Header / nav */

#site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-light);
}

#site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-dark);
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  color: var(--accent-blue);
  flex-shrink: 0;
}

#site-header nav {
  display: flex;
  gap: 1.5rem;
}

#site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

#site-header nav a:hover {
  color: var(--accent-blue);
}

/* Hero */

#hero {
  position: relative;
  max-width: none;
  padding: 0;
  text-align: center;
  background: linear-gradient(180deg, #eef7f5 0%, #dcedee 55%, #cde6e9 100%);
  overflow: hidden;
}

#hero .section-inner {
  padding: 4rem 1.5rem 6.5rem;
}

#hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  margin: 0 0 0.75rem;
  color: var(--accent-deep);
}

#hero h1 em {
  color: var(--accent-blue);
  font-style: italic;
}

.subhead {
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2.25rem;
  font-size: 1.08rem;
}

.hero-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  line-height: 0;
}

.hero-wave svg {
  width: 100%;
  height: 56px;
  display: block;
}

.hero-wave path {
  fill: white;
}

#stats-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 2.75rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.stat-icon {
  width: 22px;
  height: 22px;
  color: var(--accent-blue);
  margin-bottom: 0.15rem;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

#search-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 640px;
  margin: 0 auto;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.search-row label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

#zip-input {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-size: 0.95rem;
  width: 140px;
  background: white;
}

#radius-select {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-size: 0.95rem;
  background: white;
}

#search-form button {
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--accent-blue);
  border-radius: 999px;
  background: var(--accent-blue);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

#search-form button:hover {
  background: var(--accent-blue-dark);
  box-shadow: var(--shadow-sm);
}

#search-form button:active {
  transform: translateY(1px);
}

#use-location-btn {
  background: white;
  color: var(--accent-blue);
}

#use-location-btn:hover {
  background: #f0f8fa;
}

#search-status {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Map section */

#map-section {
  position: relative;
  max-width: none;
  padding: 0;
  height: 70vh;
  min-height: 420px;
}

#map {
  height: 100%;
  width: 100%;
}

.site-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 2px solid white;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

#detail-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 90vw;
  height: 100%;
  overflow-y: auto;
  background: white;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  padding: 1.25rem;
  box-sizing: border-box;
  z-index: 400;
}

/* Unlike #detail-panel (which overlays the main map), this sits in normal
   document flow below the state map rather than popping up over it. */
#state-detail-panel {
  position: relative;
  flex: 0 0 auto;
  max-height: 45%;
  overflow-y: auto;
  background: white;
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  padding: 1.25rem;
  box-sizing: border-box;
}

/* Same [hidden]-vs-ID-selector specificity issue as the modal backdrop:
   this rule must exist or "flex: 0 0 auto" would win and the panel would
   never actually disappear when .hidden is set. */
#state-detail-panel[hidden] {
  display: none;
}

#detail-panel h2, #state-detail-panel h2 {
  font-family: var(--font-heading);
  margin: 0 1.5rem 0.75rem 0;
  font-size: 1.2rem;
}

.detail-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #555;
}

.detail-close-btn:hover {
  color: #000;
}

.detail-description {
  white-space: pre-line;
  color: #333;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

.detail-label {
  color: #666;
  flex-shrink: 0;
}

.availability-block {
  margin: 0.9rem 0;
  padding: 0.9rem;
  background: var(--bg-tint);
  border-radius: 8px;
}

.availability-btn {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--accent-green);
  border-radius: 999px;
  background: var(--accent-green);
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.availability-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.availability-result {
  margin-top: 0.6rem;
}

.availability-rows {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.availability-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.availability-row.avail-open {
  background: #e3f3e6;
  color: #1e6b2c;
  font-weight: 600;
}

.availability-row.avail-none {
  background: #f3e6e6;
  color: #8a3a3a;
}

.availability-row.avail-unknown {
  color: var(--text-muted);
}

.availability-note, .availability-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.detail-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1rem;
}

.detail-links a {
  font-size: 0.88rem;
  font-weight: 500;
}

.detail-value {
  text-align: right;
  word-break: break-word;
}

/* Campgrounds / cards */

#campgrounds-section {
  background: var(--bg-tint);
  border-radius: 20px;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

#campgrounds-section h2 {
  margin-bottom: 0.25rem;
  color: var(--accent-deep);
}

#campgrounds-subhead {
  color: var(--text-muted);
  margin-top: 0;
  font-size: 0.9rem;
}

#campground-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
  margin-top: 1.5rem;
}

.campground-card {
  background: white;
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--accent-blue);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.campground-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-location {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.card-name {
  font-family: var(--font-heading);
  margin: 0;
  font-size: 1.1rem;
}

.card-lake {
  color: var(--accent-blue);
  font-size: 0.85rem;
  font-weight: 500;
}

.card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.25rem 0;
}

.card-distance {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-green);
}

.card-detail-btn {
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--accent-blue);
  border-radius: 999px;
  background: white;
  color: var(--accent-blue);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.card-detail-btn:hover {
  background: var(--accent-blue);
  color: white;
}

/* History */

#history-section h2 {
  color: var(--accent-deep);
}

#purpose-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}

#purpose-list li {
  background: var(--bg-tint);
  border-left: 3px solid var(--accent-green);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
}

#trip-steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: 1.5rem 0 0;
}

#trip-steps li {
  counter-increment: step;
  position: relative;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1rem 1rem 1rem 2.75rem;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
}

#trip-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 0.95rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--accent-blue);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

#timeline {
  list-style: none;
  padding-left: 0;
  border-left: 2px solid var(--border-light);
  margin-top: 1.5rem;
}

#timeline li {
  padding: 0 0 1rem 1.1rem;
  position: relative;
  font-size: 0.92rem;
}

#timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-blue);
}

/* Trip planner */

#trip-planner-section {
  background: var(--bg-tint);
  border-radius: 20px;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

#trip-planner-section h2 {
  color: var(--accent-deep);
}

/* Footer */

#site-footer {
  max-width: none;
  padding: 0;
  background: var(--accent-deep);
  color: #cfe3e6;
}

#site-footer .section-inner {
  padding: 2.5rem 1.5rem 3rem;
  font-size: 0.85rem;
}

#site-footer a {
  color: #a9d8e0;
}

#footer-updated {
  font-size: 0.8rem;
  color: #9fbcc2;
}

/* State drill-down modal */

#state-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The [hidden] attribute selector needs to beat the plain ID selector
   above, or "display: flex" wins and the modal never actually hides. */
#state-modal-backdrop[hidden] {
  display: none;
}

#state-modal {
  position: relative;
  background: white;
  width: 92vw;
  max-width: 1100px;
  height: 85vh;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  padding: 1rem;
  box-sizing: border-box;
}

#state-modal h2 {
  margin: 0 2rem 0.75rem 0;
  font-size: 1.3rem;
  color: var(--accent-deep);
}

#state-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #555;
}

#state-modal-close:hover {
  color: #000;
}

#state-modal-body {
  flex: 1;
  display: flex;
  gap: 1rem;
  min-height: 0;
}

#state-map-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1 1 68%;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
}

#state-map {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

#state-list {
  flex: 1 1 32%;
  overflow-y: auto;
  border-left: 1px solid #eee;
  padding-left: 1rem;
}

.state-list-lake-heading {
  font-family: var(--font-heading);
  margin: 1rem 0 0.25rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-green);
  border-bottom: 2px solid var(--accent-green);
  padding-bottom: 0.25rem;
}

.state-list-lake-heading:first-child {
  margin-top: 0;
}

.state-list-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.12s ease;
}

.state-list-item:hover {
  background: #f7faf7;
}

.state-list-item:hover .state-list-name {
  color: var(--accent-blue);
}

.state-list-number {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent-green);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.state-list-number.unplaced {
  background: #999;
}

.state-list-name {
  flex: 1;
}

.site-marker-numbered {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 2px solid white;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.site-tooltip {
  font-size: 0.85rem;
  line-height: 1.4;
}
