/*
 * map.css: small adjustments to the CesiumJS widget so it matches the rest of the design.
 * The map's own colours (plot outline, labels) are set in tokens.css, not here.
 */

.map .cesium-viewer,
.map .cesium-viewer-cesiumWidgetContainer,
.map .cesium-widget,
.map .cesium-widget canvas {
  width: 100%;
  height: 100%;
}
.map .cesium-widget canvas:focus { outline: none; }

/* Selecting plots with a box: Shift + drag on the map in the group editor (src/map.js). Placed by the script, in
   screen pixels, so it stays fixed while the drag lasts. */
.map-box {
  position: fixed;
  z-index: 5;
  border: 1.5px dashed var(--map-box-line);
  background: var(--map-box-fill);
  pointer-events: none;
}
.map .cesium-widget canvas.is-box-selecting { cursor: crosshair; }

/*
 * Attribution. Keep it visible: map data licences (OpenStreetMap and others) require it,
 * and CesiumJS asks that its own credit stays. We only place it and quieten it.
 * It sits bottom-right so the info panel never covers it.
 */
.credits {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  max-width: 100%;
  padding: 2px var(--space-2);
  background: color-mix(in srgb, var(--sheet) 88%, transparent);
  border-top-left-radius: var(--radius-control);
  font-size: var(--text-2xs);
  line-height: 1.4;
  color: var(--ink-muted);
}
.credits a, .credits a:visited { color: var(--ink); }
/* On a wide screen the panel floats over the map's left side: the credits stay right of it (they wrap instead),
   so they never cover the panel's buttons. */
@media (min-width: 47.5rem) {
  .credits { max-width: calc(100% - var(--sheet-width) - 2 * var(--edge)); }
}

/* CesiumJS puts its own absolutely-positioned box inside; make it flow normally so the
   container above can size itself around the text. */
.credits .cesium-widget-credits {
  position: static;
  display: block;
  padding: 0;
  color: inherit;
  font-size: inherit;
  text-shadow: none;
}

/* The map's credits (Esri, OpenStreetMap, Cesium: they must stay visible): one quiet frosted line at the bottom left of
   the free map, Cesium's logo small; a tap opens them out in full (src/finder.js, src/present.js), another closes them.
   The finder and the presentation (2026-11-04, the owner: "make the map credits minimal on presentations too"). */
.credits.credits--line {
  left: var(--credits-left, var(--edge));
  right: auto;
  top: auto;
  bottom: var(--credits-bottom, var(--edge));
  z-index: 2;
  display: flex;
  align-items: center;
  max-width: min(26rem, calc(100% - var(--credits-left, var(--edge)) - 5rem));
  padding: 3px var(--space-3) 3px var(--space-2);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--sheet) var(--glass-opacity), transparent);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--glass-rim);
  font-size: 0.625rem;
  line-height: 1.5;
  color: var(--ink-muted);
  white-space: nowrap;
  cursor: pointer;
}
.credits.credits--line .cesium-widget-credits { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.credits.credits--line .cesium-credit-logoContainer { flex: none; }
.credits.credits--line .cesium-credit-logoContainer img { display: block; height: 12px; width: auto; opacity: 0.75; }
.credits.credits--line .cesium-credit-textContainer { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.credits.credits--line.is-open { max-width: min(30rem, calc(100% - 2 * var(--edge))); border-radius: var(--radius-control); white-space: normal; cursor: default; }
.credits.credits--line.is-open .cesium-widget-credits { align-items: flex-start; }
.credits.credits--line.is-open .cesium-credit-textContainer { overflow: visible; }
@media (prefers-reduced-transparency: reduce) { .credits.credits--line { background: var(--sheet); -webkit-backdrop-filter: none; backdrop-filter: none; } }

