:root {
  --cnstops-gold: #f2b01e;
  --cnstops-navy: #0f1d3a;
  --cnstops-teal: #2ba7b3;
  --cnstops-cream: #f7eedb;
  --cnstops-kraft: #c49a5a;
  --cnstops-paper: #fffaf0;
}
.cnstops-map-section {
  box-sizing: border-box;
  width: min(1180px, calc(100% - 32px));
  margin: clamp(24px, 5vw, 68px) auto;
  color: var(--cnstops-navy);
}

.cnstops-map-section *,
.cnstops-map-section *::before,
.cnstops-map-section *::after {
  box-sizing: border-box;
}

.cnstops-map-heading {
  max-width: 760px;
  margin: 0 0 22px;
}

.cnstops-map-kicker {
  margin: 0 0 7px !important;
  color: #087f8a;
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.cnstops-map-heading h2 {
  margin: 0;
  color: var(--cnstops-navy);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.cnstops-map-heading > p:last-child {
  max-width: 670px;
  margin: 13px 0 0;
  color: #3d475d;
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  line-height: 1.65;
}

.cnstops-map-shell {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  border: 1px solid rgb(196 154 90 / 62%);
  border-radius: 24px 24px 46px 24px;
  background: var(--cnstops-cream);
  box-shadow: 0 18px 48px rgb(15 29 58 / 14%), 7px 8px 0 rgb(242 176 30 / 22%);
  isolation: isolate;
}

.cnstops-map-canvas {
  position: absolute;
  inset: 0;
  min-height: 520px;
}

.cnstops-map-canvas .maplibregl-canvas {
  outline: none;
}

.cnstops-map-canvas .maplibregl-canvas:focus-visible {
  outline: 3px solid var(--cnstops-teal);
  outline-offset: -5px;
}

.cnstops-map-marker-overlay {
  position: absolute;
  z-index: 4;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.cnstops-map-marker,
.cnstops-map-cluster {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
}

.cnstops-map-marker {
  width: 42px;
  height: 54px;
  padding: 0;
  border: 0;
  background: url('./cnstops-map-pin.svg') center bottom / 37.5% auto no-repeat;
  filter: drop-shadow(0 1.5px 1.875px rgb(15 29 58 / 24%));
  transform-origin: center bottom;
  transition: background-size 180ms ease, filter 180ms ease;
}

/* Keep scroll-safe cooperative gestures, but remove MapLibre's obscured hint. */
.cnstops-map-canvas .maplibregl-cooperative-gesture-screen,
.cnstops-map-canvas .maplibregl-desktop-message,
.cnstops-map-canvas .maplibregl-mobile-message {
  display: none;
}

.cnstops-map-marker:focus-visible,
.cnstops-map-cluster:hover,
.cnstops-map-cluster:focus-visible {
  z-index: 2;
  outline: 4px solid rgb(43 167 179 / 45%);
  outline-offset: 3px;
}

.cnstops-map-marker:hover {
  z-index: 2;
  background-size: 75% auto;
  filter: drop-shadow(0 3px 3.75px rgb(15 29 58 / 24%));
}

.cnstops-map-cluster {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 4px solid var(--cnstops-paper);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgb(15 29 58 / 28%);
  color: white;
  font: 800 0.95rem/1 system-ui, sans-serif;
  place-items: center;
}

.cnstops-map-card {
  position: absolute;
  z-index: 8;
  top: var(--cnstops-card-top, 24px);
  left: var(--cnstops-card-left, 24px);
  overflow: hidden;
  width: min(330px, calc(100% - 32px));
  border: 1px solid rgb(196 154 90 / 70%);
  border-radius: 16px 16px 28px;
  background: var(--cnstops-paper);
  box-shadow: 0 18px 44px rgb(15 29 58 / 24%);
}

.cnstops-map-card[hidden] {
  display: none;
}

.cnstops-map-card > img {
  display: block;
  width: 100%;
  height: 150px;
  margin: 0;
  object-fit: cover;
}

.cnstops-map-card-body {
  padding: 18px 19px 20px;
}

.cnstops-map-card h3 {
  margin: 0 30px 8px 0;
  color: var(--cnstops-navy);
  font-size: 1.18rem;
  line-height: 1.25;
}

.cnstops-map-card h3 a {
  color: inherit;
  text-decoration: none;
}

.cnstops-map-card h3 a:hover,
.cnstops-map-card h3 a:focus-visible {
  color: #087f8a;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.cnstops-map-card p {
  margin: 0 0 14px;
  color: #465067;
  font-size: 0.93rem;
  line-height: 1.55;
}

.cnstops-map-card-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--cnstops-gold);
  color: var(--cnstops-navy) !important;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none !important;
}

.cnstops-map-card-link::after {
  margin-left: 8px;
  content: '→';
}

.cnstops-map-card-link:hover,
.cnstops-map-card-link:focus-visible {
  background: var(--cnstops-teal);
  color: white !important;
  outline: 3px solid rgb(15 29 58 / 18%);
  outline-offset: 2px;
}

.cnstops-map-card-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgb(15 29 58 / 18%);
  border-radius: 50%;
  background: rgb(255 250 240 / 94%);
  color: var(--cnstops-navy);
  cursor: pointer;
  font: 500 1.55rem/1 system-ui, sans-serif;
  place-items: center;
}

.cnstops-map-card-close:focus-visible,
.cnstops-map-card-close:hover {
  outline: 3px solid var(--cnstops-teal);
  outline-offset: 2px;
}

.cnstops-map-status {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  width: min(460px, calc(100% - 40px));
  padding: 14px 18px;
  border: 1px solid rgb(196 154 90 / 55%);
  border-radius: 14px;
  background: rgb(255 250 240 / 94%);
  box-shadow: 0 10px 30px rgb(15 29 58 / 15%);
  color: var(--cnstops-navy);
  line-height: 1.5;
  text-align: center;
  transform: translate(-50%, -50%);
}

.cnstops-map-status[data-state='error'] {
  border-color: #a34a3b;
}

.cnstops-map-reset {
  position: absolute;
  z-index: 7;
  right: 10px;
  bottom: 30px;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid rgb(15 29 58 / 22%);
  border-radius: 10px;
  background: rgb(255 250 240 / 96%);
  box-shadow: 0 2px 8px rgb(15 29 58 / 18%);
  color: var(--cnstops-navy);
  cursor: pointer;
  font: 700 0.78rem/1.2 system-ui, sans-serif;
}

.cnstops-map-reset span:first-child {
  margin-right: 6px;
  font-size: 1.1rem;
}

.cnstops-map-reset:hover,
.cnstops-map-reset:focus-visible {
  border-color: var(--cnstops-teal);
  outline: 3px solid rgb(43 167 179 / 35%);
  outline-offset: 2px;
}

.cnstops-map-canvas .maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid rgb(15 29 58 / 18%);
  border-radius: 10px;
  background: rgb(255 250 240 / 96%);
  box-shadow: 0 2px 8px rgb(15 29 58 / 18%);
}

.cnstops-map-canvas .maplibregl-ctrl button:focus-visible {
  outline: 3px solid var(--cnstops-teal);
  outline-offset: -3px;
}

.cnstops-map-canvas .maplibregl-ctrl-attrib {
  color: #374156;
  font-size: 10px;
}

.cnstops-map-index {
  display: flex;
  align-items: flex-start;
  gap: 18px 28px;
  margin: 20px 4px 0;
  padding-top: 14px;
  border-top: 1px dashed rgb(196 154 90 / 75%);
}

.cnstops-map-index h3 {
  flex: 0 0 auto;
  margin: 2px 0 0;
  color: var(--cnstops-navy);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cnstops-map-index ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cnstops-map-index li {
  margin: 0;
}

.cnstops-map-index a {
  color: #087f8a;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgb(242 176 30 / 70%);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.cnstops-map-index a:hover,
.cnstops-map-index a:focus-visible {
  color: var(--cnstops-navy);
  outline: 2px solid var(--cnstops-teal);
  outline-offset: 3px;
}

.cnstops-map-index > p {
  margin: 0;
  color: #4b5569;
}

@media (max-width: 700px) {
  .cnstops-map-section {
    width: min(100% - 20px, 1180px);
    margin-block: 28px 44px;
  }

  .cnstops-map-heading {
    padding-inline: 4px;
  }

  .cnstops-map-shell,
  .cnstops-map-canvas {
    min-height: min(68vh, 540px);
  }

  .cnstops-map-shell {
    border-radius: 18px 18px 32px;
    box-shadow: 0 12px 32px rgb(15 29 58 / 14%), 4px 5px 0 rgb(242 176 30 / 22%);
  }

  .cnstops-map-card {
    top: auto !important;
    right: 10px;
    bottom: 10px;
    left: 10px !important;
    width: auto;
    max-height: calc(100% - 86px);
  }

  .cnstops-map-card > img {
    height: 118px;
  }

  .cnstops-map-card-body {
    padding: 14px 16px 16px;
  }

  .cnstops-map-reset-label {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .cnstops-map-reset span:first-child {
    margin: 0;
  }

  .cnstops-map-index {
    display: block;
  }

  .cnstops-map-index h3 {
    margin-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cnstops-map-section *,
  .cnstops-map-section *::before,
  .cnstops-map-section *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
