/* ── Stats strip ────────────────────────────────────────────────────── */

.parks-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 1.1em;
  margin: 0 0 1em;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  font-family: var(--mono);
  text-align: left;
  padding: 0.15em 0.4em;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
}

button.stat {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

button.stat:hover {
  background-color: var(--accent-bg-soft);
  border-color: var(--rule);
}

.stat-label {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.stat-value {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--fg);
}

/* ── Toolbar ────────────────────────────────────────────────────────── */

.parks-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5em 1em;
  margin: 0 0 0.8em;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.parks-bar .sep {
  color: var(--rule);
  margin: 0 0.4ch;
}

.parks-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35em;
}

.parks-filters {
  display: flex;
  gap: 0.15em;
}

.parks-filters button {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  color: var(--fg);
  background-color: transparent;
  padding: 0.2em 0.7em;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.parks-filters button:hover {
  background-color: var(--accent-bg-soft);
  border-color: var(--rule);
}

.parks-filters button.current {
  background-color: var(--accent-bg);
  border-color: #c0d4a8;
}

#parks-prov,
#parks-search {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  color: var(--fg);
  background-color: transparent;
  padding: 0.2em 0.5em;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

#parks-prov {
  cursor: pointer;
}

#parks-search {
  width: 11ch;
}

/* ── Map ────────────────────────────────────────────────────────────── */

.map-box {
  position: relative;
  background-color: var(--warm-bg);
  box-shadow: inset 0 0 0 1px var(--rule);
}

#parks-map {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
}

#parks-map:active {
  cursor: grabbing;
}

.province {
  fill: var(--bg);
  stroke: var(--rule);
}

.province:hover,
.province.lit {
  fill: var(--accent-bg-soft);
}

.pin {
  fill: var(--accent);
  stroke: var(--bg);
  cursor: pointer;
}

.pin.hidden {
  display: none;
}

/* reserves read as hollow: page background inside, accent on the ring */
.pin.reserve {
  fill: var(--bg);
  stroke: var(--accent);
}

.pin.selected {
  stroke: var(--fg);
}

.map-zoom {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 0.15em;
}

.map-zoom button {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  color: var(--fg);
  background-color: var(--bg);
  padding: 0.2em 0.6em;
  border: 1px solid var(--rule);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.map-zoom button:hover {
  background-color: var(--accent-bg-soft);
}

.map-tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  max-width: 260px;
  padding: 0.35em 0.5em;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
  color: var(--fg);
  background-color: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

.map-tip .tip-meta {
  color: var(--muted);
}

.map-hint {
  margin-top: 0.5em;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ── Legend ─────────────────────────────────────────────────────────── */

.parks-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 1.2em;
  margin: 0.45em 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.parks-legend li {
  display: flex;
  align-items: center;
  gap: 0.6ch;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.dot-park {
  background-color: var(--accent);
}

.dot-reserve {
  background-color: var(--bg);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.dot-sm {
  width: 5px;
  height: 5px;
  background-color: var(--accent);
}

.dot-lg {
  width: 11px;
  height: 11px;
  background-color: var(--accent);
}

/* ── Timeline ───────────────────────────────────────────────────────── */

.timeline-box {
  position: relative;
  margin-top: 1.2em;
}

#parks-timeline {
  display: block;
  width: 100%;
}

.tl-bar {
  fill: var(--accent-bg);
  cursor: pointer;
}

.tl-bar:hover,
.tl-bar.active {
  fill: var(--accent);
}

.tl-bar.empty {
  fill: var(--rule);
  cursor: default;
}

.tl-bar.empty:hover {
  fill: var(--rule);
}

.tl-bar:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.tl-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--muted);
}

/* ── Details panel ──────────────────────────────────────────────────── */

.parks-details {
  margin: 1.4em 0 1.2em;
  padding-top: 1em;
  border-top: 1px dashed var(--rule);
}

.details-empty {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.details-empty .prompt {
  color: var(--accent);
  margin-right: 0.4ch;
}

.details-grid {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: 1.2em;
  align-items: start;
}

.details-photo img,
.photo-none {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background-color: var(--warm-bg);
  box-shadow: 0 0 0 1px var(--rule);
}

.photo-none {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.photo-credit {
  margin-top: 0.45em;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.photo-credit .sep {
  color: var(--rule);
  margin: 0 0.4ch;
}

.details-name {
  font-weight: 500;
  font-size: 18px;
  line-height: 1.3;
}

.details-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25em;
  margin-top: 0.5em;
}

.badge {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.3;
  color: var(--fg);
  background-color: var(--accent-bg);
  padding: 0.2em 0.7em;
  border: 1px solid #c0d4a8;
  border-radius: 2px;
}

.details-meta {
  margin-top: 0.5em;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.details-meta .sep {
  color: var(--rule);
  margin: 0 0.4ch;
}

.details-text {
  margin: 0.7em 0 0;
  max-width: 64ch;
}

.details-highlights {
  margin: 0.8em 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}

.details-highlights .prompt {
  color: var(--accent);
  margin-right: 0.6ch;
}

.details-activities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25em;
  margin-top: 0.8em;
}

.activity {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  padding: 0.2em 0.7em;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.details-gateway,
.details-weather {
  margin-top: 0.7em;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.details-weather:empty {
  display: none;
}

.details-weather .sep {
  color: var(--rule);
  margin: 0 0.4ch;
}

.details-links {
  margin-top: 0.9em;
  font-family: var(--mono);
  font-size: 12px;
}

.details-links .sep {
  color: var(--rule);
  margin: 0 0.4ch;
}

/* ── List ───────────────────────────────────────────────────────────── */

.parks-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13px;
}

.parks-table th {
  padding: 0;
  font-weight: 400;
  border-bottom: 1px dashed var(--rule);
}

.parks-table th button {
  display: block;
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  color: var(--muted);
  background-color: transparent;
  padding: 0.4em 0.6em;
  border: 0;
  cursor: pointer;
}

.parks-table th button:hover {
  color: var(--fg);
}

.parks-table th.col-est button,
.parks-table th.col-area button,
.parks-table th.col-visitors button {
  text-align: right;
}

.parks-table .arrow {
  color: var(--accent);
  margin-left: 0.5ch;
}

.parks-table td {
  padding: 0.32em 0.6em;
  border-bottom: 1px dashed var(--rule);
  white-space: nowrap;
}

.parks-table td.col-name {
  white-space: normal;
}

.parks-table td.col-prov {
  color: var(--muted);
}

.parks-table td.col-est,
.parks-table td.col-area,
.parks-table td.col-visitors {
  color: var(--muted);
  text-align: right;
}

.parks-table tr[hidden] {
  display: none;
}

.parks-table tbody tr:not(.parks-none) {
  cursor: pointer;
}

.parks-table tbody tr:not(.parks-none):hover {
  background-color: var(--accent-bg-soft);
}

.parks-table tbody tr.selected {
  background-color: var(--accent-bg);
}

.parks-table .parks-none td {
  color: var(--muted);
  white-space: normal;
}

.row-name {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  color: var(--fg);
  background-color: transparent;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.row-name:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

/* ── Empty state ────────────────────────────────────────────────────── */

.parks-empty {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.parks-empty .prompt {
  color: var(--accent);
  margin-right: 0.4ch;
}

/* ── Focus ──────────────────────────────────────────────────────────── */

.pin:focus-visible,
.row-name:focus-visible,
.parks-table th button:focus-visible,
.parks-filters button:focus-visible,
.map-zoom button:focus-visible,
button.stat:focus-visible,
#parks-prov:focus-visible,
#parks-search:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .col-est,
  .col-visitors {
    display: none;
  }

  .details-grid {
    grid-template-columns: 1fr;
    gap: 1em;
  }

  .parks-table {
    font-size: 12px;
  }

  .row-name {
    font-size: 12px;
  }

  .parks-controls {
    width: 100%;
  }

  #parks-search {
    flex: 1;
    min-width: 6ch;
  }
}
