#places-figure,
.places-hint,
#place-current,
.content .is-place {
  --pl-ink: #333;
  --pl-body: #777;
  --pl-faint: #999;
  --pl-rule: #e6e6e6;
  --pl-azure: #6f92ba;
}

#places-figure *,
#places-figure *::before,
#places-figure *::after {
  box-sizing: border-box;
}

/* ---- the figure ---- */
#places-figure {
  position: relative;
  margin: 0;
  /* Light, so the box is unobtrusive before the bundle has parsed. */
  background: #fcfcfd;
  border: 1px solid var(--pl-rule);
  border-radius: 2px;
  overflow: hidden;
}

#places-figure.is-active {
  border-color: #d3dce6;
}

#places-globe {
  width: 100%;
  /* Desktop: a landscape band filling the height of the column. */
  height: min(60vh, 30rem);
  cursor: grab;
  opacity: 0;
  transition: opacity 0.35s ease-out;
}

#places-figure.is-ready #places-globe {
  opacity: 1;
}

#places-globe:active {
  cursor: grabbing;
}

#places-globe canvas {
  display: block;
}

.globe-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--pl-faint);
  pointer-events: none;
}

/* Covers the empty canvas until the globe reports itself ready. */
#places-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #fcfcfd;
  opacity: 1;
  transition: opacity 0.35s ease-out;
}

#places-figure.is-ready::after {
  opacity: 0;
}

/* ---- controls ---- */
.globe-controls {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.72rem;
  opacity: 0;
  transition: opacity 0.35s ease-out;
}

#places-figure.is-ready .globe-controls {
  opacity: 1;
}

.globe-controls .layer-toggle {
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  font: inherit;
  color: var(--pl-faint);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.globe-controls .layer-toggle[aria-pressed="true"] {
  color: var(--pl-ink);
  border-bottom-color: var(--pl-azure);
}

.globe-controls .layer-toggle:hover {
  color: var(--pl-ink);
}

.globe-zoom {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
}

.globe-zoom button {
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: 1px solid var(--pl-rule);
  border-radius: 2px;
  background: #fff;
  color: var(--pl-body);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.globe-zoom button:hover {
  color: var(--pl-ink);
  border-color: #ccc;
}

.places-hint {
  color: var(--pl-faint);
  margin-bottom: 0.5rem;
}

/* The heading of the place on show: name left, dates right. Font and colour
   still come from the site's own h3 rule. */
.content .is-place {
  display: block;
}

/* Tablet: track the column width, or the globe floats in a letterbox. */
@media (max-width: 64rem) {
  #places-globe {
    height: min(58vw, 26rem);
  }
}

/* Phone: near-square, so the globe gets the full column width as diameter. */
@media (max-width: 40rem) {
  #places-globe {
    height: min(92vw, 52vh);
  }

  .globe-controls {
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.68rem;
  }

  .globe-zoom button {
    width: 1.7rem;
    height: 1.7rem;
  }
}