

/* Standalone vector basemap view (ADR 0004). Fixed-height, non-scrolling:
   the header sits on top and the MapLibre canvas fills the rest. */
#map-view {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--safe-area-inset-bottom));
}

@media (max-width: 799px) {
  #map-view {
    height: calc(100dvh - var(--footer-height) - var(--safe-area-inset-bottom));
  }
}

#map-view .map-canvas {
  position: relative;
  flex: 1;
  min-height: 0;
  background-color: var(--background-color);
}

/* MapLibre ships its own control CSS (vendored /css/maplibre-gl.css, linked
   lazily by the view). Only small fit-and-finish tweaks here. */
#map-view .maplibregl-ctrl-attrib {
  font-size: 10px;
}

#map-view .maplibregl-ctrl-attrib.maplibregl-compact {
  background-color: var(--background-color);
}

#map-view .maplibregl-ctrl-attrib a {
  color: var(--text-color-secondary);
}

/* Theme MapLibre's own controls + popups (vendored maplibre-gl.css hard-codes
   #fff). #map-view prefix so these beat its single-class selectors. */
#map-view .maplibregl-ctrl-group {
  background: var(--background-color);
  color: var(--text-color);
}

#map-view .maplibregl-ctrl-group button + button {
  border-top-color: var(--generic-border-color);
}

#map-view .maplibregl-ctrl-icon {
  /* the vendored control icons are dark SVGs; lift them on a dark ground */
  filter: var(--map-ctrl-icon-filter, none);
}

#map-view .maplibregl-popup-content {
  background: var(--background-color);
  color: var(--text-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

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

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

#map-view .maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: var(--background-color);
}

#map-view .maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: var(--background-color);
}

#map-view .maplibregl-popup-close-button {
  color: var(--text-color-secondary);
}

@media (prefers-color-scheme: dark) {
  #map-view {
    --map-ctrl-icon-filter: invert(1) hue-rotate(180deg);
  }
}

:root[data-theme="dark"] #map-view {
  --map-ctrl-icon-filter: invert(1) hue-rotate(180deg);
}

:root[data-theme="light"] #map-view {
  --map-ctrl-icon-filter: none;
}

/* Beacon Bits layer control + popup (beaconMap.js, ADR 0005). */
#map-view .beacon-map-ctrl {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  max-width: 190px;
}

#map-view .beacon-map-toggle {
  font: inherit;
  font-weight: 600;
  width: 100%;
  height: auto;
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  border: var(--hair) solid var(--generic-border-color);
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
}

#map-view .beacon-map-toggle[aria-pressed="true"] {
  background: #ff4d6d;
  border-color: #ff4d6d;
  color: #fff;
}

#map-view .beacon-map-windows {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

#map-view .beacon-map-windows button {
  font: inherit;
  width: auto;
  height: auto;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: var(--hair) solid var(--generic-border-color);
  background: transparent;
  color: var(--text-color-secondary);
  cursor: pointer;
}

#map-view .beacon-map-windows button + button {
  border-top: var(--hair) solid var(--generic-border-color);
}

#map-view .beacon-map-windows button.is-active {
  background: var(--text-color);
  border-color: var(--text-color);
  color: var(--background-color);
}

.beacon-pop {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-color);
}

.beacon-pop-venue {
  font-weight: 700;
  font-size: 13px;
}

.beacon-pop-cat {
  font-weight: 400;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-color-muted);
}

.beacon-pop-rating {
  color: #ff4d6d;
  letter-spacing: 1px;
}

.beacon-pop-shout {
  font-style: italic;
}

.beacon-pop-meta {
  color: var(--text-color-muted);
}

.beacon-pop-links {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.beacon-pop-links a {
  color: var(--text-link-color);
}

