/* CKAN's data-viewer module sizes the view's iframe to the body's height plus
   30px of padding. The body is a fixed-height spacer that sets that height,
   and the map is fixed to the whole window, so it fills the iframe (padding
   included) and also fills the page when the view is opened full screen. */
body.spatialdata-view {
  height: 550px;
  margin: 0;
  overflow: hidden;
}

.spatialdata-map {
  position: fixed;
  inset: 0;
}

.spatialdata-map-canvas {
  height: 100%;
  width: 100%;
}

.spatialdata-map-zoom-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  pointer-events: none;
}

/* Which rows the view's filters keep; under the zoom hint, clear of the
   controls on the right. */
.spatialdata-map-filter-note {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 70px);
  z-index: 1;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spatialdata-map-filter-note ~ .spatialdata-map-zoom-hint {
  top: 40px;
}

.spatialdata-map-popup {
  max-height: 260px;
  overflow-y: auto;
  font-size: 0.8125rem;
}

.spatialdata-map-popup-title {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.spatialdata-map-popup-body p:last-child {
  margin-bottom: 0;
}

/* Hover popups follow the pointer and must not catch it. */
.spatialdata-map-hover {
  pointer-events: none;
}

.spatialdata-map-hover .spatialdata-map-popup {
  max-height: none;
  overflow: hidden;
}

.spatialdata-map-popup th {
  padding-right: 8px;
  white-space: nowrap;
  font-weight: 600;
}

.spatialdata-map-popup td {
  word-break: break-word;
}

/* Startup failures and style errors, over the top of the map. */
.spatialdata-map-message {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 60px;
  z-index: 2;
  white-space: pre-line;
  font-size: 0.875rem;
}
