/* Region map — all selectors scoped under .cach-region-map to avoid theme collisions.
   CSS variables are declared on the root element (not :root) for the same reason. */
.cach-region-map {
  --teal-deep: #0d5d5c;
  --teal: #01706a;
  --teal-soft: #e3efee;
  --orange: #f36f4f;
  --orange-dark: #cf6149;
  --ink: #2c3a3a;
  --muted: #7d9594;
  --line: #e4eceb;
  --bg: #f6f8f8;
  --unassigned: #d7dedd;
  --unassigned-hover: #c5cfce;

  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}
.cach-region-map * {
  box-sizing: border-box;
}

.cach-region-map .title {
  color: var(--teal-deep);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
/* Filters — coalition / county dropdowns above the map. */
.cach-region-map .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 16px;
}
.cach-region-map .filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 320px;
}
.cach-region-map .filter-label {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.cach-region-map .filter-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: #fff
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1l5 5 5-5" fill="none" stroke="%237d9594" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>')
    no-repeat right 14px center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 38px 11px 14px;
  font: inherit;
  /* 16px keeps native option text readable and stops iOS from zooming the
     viewport when the select is focused. */
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
  cursor: pointer;
}
.cach-region-map .filter-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 124, 123, 0.15);
}
.cach-region-map .filter-select:disabled {
  color: var(--muted);
  cursor: not-allowed;
  background-color: var(--bg);
}

/* Stage — map and coalition panel side by side (75% / 25%) on desktop,
   stacked on mobile. */
.cach-region-map .stage {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 880px) {
  .cach-region-map .stage {
    grid-template-columns: 1fr;
  }
}

/* Map */
.cach-region-map .map {
  height: 560px;
  width: 100%;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
}
@media (max-width: 880px) {
  .cach-region-map .map {
    height: 420px;
  }
}
.cach-region-map .leaflet-container {
  background: var(--bg);
  font: inherit;
}
.cach-region-map .county-label {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #1d191d;
  font-size: 10px;
  font-weight: 600;
  text-shadow:
    0 1px 2px #fff,
    0 0 2px #fff;
}

/* Recenter control — matches Leaflet's zoom buttons. */
.cach-region-map .recenter-bar {
  margin-top: 8px;
}
.cach-region-map .recenter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--ink);
  cursor: pointer;
}
.cach-region-map .recenter-btn:hover {
  color: var(--teal-deep);
  background: #f4f4f4;
}

/* Reservation labels — visually distinct from counties. */
.cach-region-map .resv-label {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #4a2f6b;
  font-size: 10.5px;
  font-weight: 700;
  font-style: italic;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff,
    0 0 4px #fff;
}
.cach-region-map .resv-label::before {
  display: none;
}

/* Region list — the panel's default (closed) state; also serves as the map key. */
.cach-region-map .region-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cach-region-map .list-intro {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 6px;
}
.cach-region-map .region-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition:
    border-color 0.12s,
    box-shadow 0.12s,
    background 0.12s;
}
.cach-region-map .region-card:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 1px 3px rgba(13, 93, 92, 0.12);
}
.cach-region-map .region-card .swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex: none;
}
.cach-region-map .region-card .rc-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cach-region-map .region-card .rc-name {
  font-size: 14.5px;
  font-weight: 600;
}
.cach-region-map .region-card .rc-sub {
  font-size: 12.5px;
  color: var(--muted);
}

/* Panel — the 25% content column beside the map; stacks below it on mobile. */
.cach-region-map .panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

/* Desktop: cap the panel to the map's height and scroll long content within. */
@media (min-width: 881px) {
  .cach-region-map .panel {
    max-height: 560px;
    overflow-y: auto;
  }
  /* Keep the teal header pinned while the body scrolls. */
  .cach-region-map .panel-head {
    position: sticky;
    top: 0;
    z-index: 1;
  }
}

.cach-region-map--hub .panel-head {
  background: var(--orange);
}

.cach-region-map--ach .panel-head {
  background: var(--teal-deep);
}
.cach-region-map .panel-head {
  color: #fff;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cach-region-map .panel-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  color: #fff;
}
.cach-region-map .panel-head .close {
  background: none;
  border: none;
  color: #cfe3e2;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.cach-region-map .panel-head .close:hover {
  color: #fff;
}
.cach-region-map .panel-body {
  padding: 20px 22px 24px;
}

.cach-region-map .subregion {
  color: var(--teal);
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 4px;
}
.cach-region-map .counties {
  color: var(--ink);
  font-size: 14px;
  margin: 0 0 16px;
}
.cach-region-map .rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0 0 16px;
}
.cach-region-map .desc {
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 20px;
  color: #3a4a49;
}

.cach-region-map .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 8px;
}
.cach-region-map .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.cach-region-map .chip {
  background: var(--teal);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 5px;
}
.cach-region-map .field {
  margin: 0 0 18px;
}
.cach-region-map .field .val {
  font-size: 14.5px;
  line-height: 1.5;
}
.cach-region-map .field .val a {
  color: var(--teal);
  text-decoration: none;
}
.cach-region-map .field .val a:hover {
  text-decoration: underline;
}

.cach-region-map .ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.cach-region-map .btn {
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  padding: 13px 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.cach-region-map .btn-teal {
  background: var(--teal);
  color: #fff;
}
.cach-region-map .btn-teal:hover {
  background: var(--teal-deep);
}
.cach-region-map .btn-orange {
  background: var(--orange);
  color: #fff;
}
.cach-region-map .btn-orange:hover {
  background: var(--orange-dark);
}

.cach-region-map .empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  color: var(--muted);
  padding: 40px;
}
.cach-region-map .empty .big {
  font-size: 16px;
  color: #58706f;
  font-weight: 600;
  margin: 0 0 6px;
}
