/* Globe showcase: mobile first, globe on top and settings below; side by side from 900 px.
   Follows the visitor's light or dark setting. */
.globe {
  margin: 0;
  /* Space is dark in both schemes: the star field of ADR 0050 sits on it. */
  --space: #00000e;
  --panel: var(--surface);
}

@media (prefers-color-scheme: dark) {
  .globe {
    --text: #f3f3f0;
    --surface: #0b0b2e;
    --muted: #b3b3c2;
    --line: #2c2c52;
    --petrol-dark: #00c1b6;
    --space: #00000e;
    color-scheme: dark;
  }

  .globe .button:focus-visible,
  .globe input:focus-visible,
  .globe select:focus-visible {
    outline-color: #00c1b6;
  }
}

.layout {
  display: grid;
  grid-template-areas: "map" "controls";
}

.controls {
  grid-area: controls;
  padding: 12px 16px 24px;
}

.intro {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.map-wrap {
  grid-area: map;
  position: relative;
  height: 68vh;
  min-height: 360px;
  background: var(--space);
}

.map {
  position: absolute;
  inset: 0;
}

/* The star field of ADR 0050 (NASA SVS Deep Star Maps 2020, public domain), fading with zoom. */
.map.map-space::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #00000e url("/embed/stars.webp") center / cover no-repeat;
  opacity: var(--map-space-opacity, 1);
  pointer-events: none;
}

.clock {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgb(0 0 40 / 78%);
  color: #fff;
  font: 600 14px/1.3 ui-monospace, 'SFMono-Regular', monospace;
  pointer-events: none;
}

.group {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.group legend,
.label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}

.places {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.places .button,
.time .button {
  min-height: 40px;
  padding: 4px 12px;
  font-size: 14px;
}

.button[aria-pressed='true'] {
  background: var(--petrol-dark);
  color: var(--surface);
}

.radio,
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-right: 16px;
  font-size: 14px;
  cursor: pointer;
}

.radio input,
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--petrol-dark);
}

.radio input:disabled + span {
  color: var(--muted);
}

.time {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.time input[type='range'] {
  flex: 1 1 100%;
  min-height: 40px;
  accent-color: var(--petrol-dark);
}

.select {
  position: relative;
  flex: 1;
  min-width: 140px;
}

.select select {
  appearance: none;
  width: 100%;
  min-height: 40px;
  font: inherit;
  font-size: 14px;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.select::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--petrol-dark);
  border-bottom: 2px solid var(--petrol-dark);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.readout {
  margin: 0 0 12px;
  font-size: 14px;
}

.status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.source {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.source a {
  color: var(--petrol-dark);
}

@media (min-width: 900px) {
  .globe {
    height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .layout {
    flex: 1;
    min-height: 0;
    grid-template-columns: 360px 1fr;
    grid-template-areas: "controls map";
  }

  .controls {
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }

  .map-wrap {
    height: auto;
    min-height: 0;
  }
}
