/* Interactive contact map — overrides Leaflet defaults to match the NorenSpring
   minimal light look. Loaded only on the contact page. */

/* The map fills the aspect-ratio box the old static image used. Popups need to
   escape that box, while Leaflet clips its own tiles internally. */
.sa-contact-network__map:has(.sa-contact-map) {
  overflow: visible;
  background: var(--sa-bg-soft);
}

.sa-contact-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--sa-bg-soft);
}

.sa-contact-map.leaflet-container {
  font: inherit;
  background: var(--sa-bg-soft);
}

/* Pins ----------------------------------------------------------------- */
.sa-map-pin {
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--sa-accent) 65%, #fff);
  border-radius: 50%;
  background: var(--sa-accent-soft);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .82);
}

.sa-map-pin__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sa-accent);
}

.sa-map-pin.is-hq {
  border-color: var(--sa-primary);
  background: var(--sa-surface);
}

.sa-map-pin.is-hq .sa-map-pin__dot {
  width: 14px;
  height: 14px;
  background: var(--sa-primary);
}

/* Labels (permanent tooltips) ------------------------------------------ */
.leaflet-tooltip.sa-map-label {
  padding: 5px 8px;
  border: 0;
  border-radius: 5px;
  color: var(--sa-primary);
  background: rgba(255, 255, 255, .9);
  box-shadow: none;
  font-size: clamp(14px, 1vw, 17px);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-shadow: 0 1px 0 var(--sa-surface), 1px 0 0 var(--sa-surface),
    -1px 0 0 var(--sa-surface), 0 -1px 0 var(--sa-surface);
}

.leaflet-tooltip.sa-map-label.is-hq {
  font-size: clamp(15px, 1.08vw, 18px);
  font-weight: 750;
}

/* Kill the default tooltip arrow — the labels sit as plain chips. */
.leaflet-tooltip.sa-map-label::before {
  display: none;
}

/* Popup ---------------------------------------------------------------- */
.leaflet-popup.sa-map-popup-wrap .leaflet-popup-content-wrapper {
  border-radius: 8px;
  background: var(--sa-surface);
  box-shadow: 0 14px 42px rgba(20, 35, 58, .16);
}

.leaflet-popup.sa-map-popup-wrap .leaflet-popup-content {
  margin: 15px 17px;
  font: inherit;
}

.leaflet-popup.sa-map-popup-wrap .leaflet-popup-tip {
  background: var(--sa-surface);
}

.sa-map-popup {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.sa-map-popup__title {
  color: var(--sa-primary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.sa-map-popup__addr {
  color: var(--sa-text-2);
  font-size: 12.5px;
  line-height: 1.5;
}

.sa-map-popup__nav {
  display: inline-flex;
  margin-top: 6px;
  padding: 9px 14px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--sa-accent);
  border-radius: 5px;
  color: var(--sa-primary);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.sa-map-popup__nav:hover,
.sa-map-popup__nav:focus-visible {
  color: var(--sa-surface);
  background: var(--sa-primary);
  border-color: var(--sa-primary);
}

/* Zoom control — squared to match the site's flat surfaces. */
.sa-contact-map .leaflet-bar {
  border: 1px solid var(--sa-border);
  border-radius: 5px;
  box-shadow: 0 6px 18px rgba(20, 35, 58, .1);
}

.sa-contact-map .leaflet-bar a {
  color: var(--sa-primary);
  background: var(--sa-surface);
}

.sa-contact-map .leaflet-bar a:hover {
  background: var(--sa-bg-soft);
}

.sa-contact-map .leaflet-control-attribution {
  background: rgba(255, 255, 255, .8);
  font-size: 10px;
}

@media (max-width: 680px) {
  /* The 90/41 aspect box gets too short on phones for a world map — give it a
     fixed, comfortable height instead. */
  .sa-contact-network__map:has(.sa-contact-map) {
    aspect-ratio: auto;
    height: 320px;
  }

  .sa-map-popup {
    min-width: 150px;
  }

  .leaflet-tooltip.sa-map-label {
    font-size: 12px;
    padding: 3px 6px;
  }
}
