/* MapLibre chrome shared by all map sites. */

/* Built-in controls */
.maplibregl-ctrl-group {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border), 0 2px 8px var(--shadow);
}

.maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--border);
}

.maplibregl-ctrl button:not(:disabled):hover {
  background-color: var(--hover);
}

.maplibregl-ctrl-attrib {
  background-color: var(--surface);
  color: var(--muted);
}

.maplibregl-ctrl-attrib a {
  color: var(--muted);
}

.maplibregl-ctrl-attrib.maplibregl-compact {
  background-color: var(--surface);
}

@media (prefers-color-scheme: dark) {
  .maplibregl-ctrl-icon,
  .maplibregl-ctrl-attrib-button {
    filter: invert(1);
  }

  .maplibregl-ctrl-logo {
    filter: brightness(0) invert(1);
  }
}

/* MapLibre popup shell */
.maplibregl-popup-content {
  width: min(340px, calc(100vw - 2rem));
  max-width: 340px;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  color: var(--text-primary);
  border-radius: 8px;
  box-shadow: 0 2px 10px var(--shadow);
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-bottom-color: var(--surface);
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  border-top-color: var(--surface);
}

.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: var(--surface);
}

.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: var(--surface);
}

.maplibregl-popup-close-button {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 0 8px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.maplibregl-popup-close-button:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.maplibregl-popup-close-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
