/* Map controls styled like the GTMOF app's map (see map-controls.js). */

/* The map-type card opens over the other corners' buttons. */
.leaflet-control-container .leaflet-top.leaflet-left {
  z-index: 1001;
}

.leaflet-container .map-type {
  position: relative;
}

.map-type-toggle {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #d8e4e2;
  border-radius: 12px;
  background: #ffffff;
  color: var(--primary, #0f766e);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.map-type-pop {
  position: absolute;
  top: 52px;
  left: 0;
  box-sizing: border-box;
  display: flex;
  gap: 10px;
  max-width: calc(100vw - 48px);
  padding: 10px;
  border: 1px solid #d8e4e2;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.map-type-pop[hidden] {
  display: none;
}

.map-type-card {
  display: flex;
  /* Shrink evenly when the screen is narrower than the card's full width. */
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #185c54;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.map-type-card .thumb {
  display: block;
  width: 100%;
  height: 58px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
}

.map-type-card .thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-type-card.selected {
  color: var(--primary, #0f766e);
}

.map-type-card.selected .thumb {
  border-color: var(--primary, #0f766e);
}

/* Zoom and locate: rounded 44px buttons (Leaflet's bars, restyled). */
.leaflet-container .leaflet-bar {
  overflow: hidden;
  border: 1px solid #d8e4e2;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.leaflet-container .leaflet-bar a {
  width: 44px;
  height: 44px;
  border-bottom: 1px solid #d8e4e2;
  background: #ffffff;
  color: var(--primary, #0f766e);
  font-size: 22px;
  line-height: 44px;
}

.leaflet-container .leaflet-bar a:first-child,
.leaflet-container .leaflet-bar a:last-child {
  border-radius: 0;
}

.leaflet-container .leaflet-bar a:last-child {
  border-bottom: 0;
}

.leaflet-container .leaflet-bar a:hover {
  background: #f0fdfa;
}

.locate-control a {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.locate-control svg {
  display: block;
  width: 26px;
  height: 26px;
}

.locate-control.is-busy svg {
  opacity: 0.45;
}

.locate-control.is-error a {
  color: #94a3b8;
}

/* Credits: a quiet one-line strip under the map, inside the same rounded card
   (the tile providers require them; they no longer sit over the map). */
.map-credits {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-top: 1px solid #d8e4e2;
  background: #ffffff;
  color: #64748b;
  font-size: 10px;
  line-height: 14px;
  /* Wraps to a second line on narrow screens rather than cutting text off. */
  overflow-wrap: anywhere;
}

.map-credits a {
  color: inherit;
}

/* The map and its overlay buttons sit in .map-stage, above the credits. */
.map-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
