.location-tour {
  padding-top: 64px;
  scroll-margin-top: 110px;
}

.location-tour-heading {
  margin-bottom: 24px;
}

.location-tour-heading h2 {
  font-size: clamp(30px, 3.5vw, 46px);
}

.location-tour-heading p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.location-tour-poster {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  aspect-ratio: 2.6;
  isolation: isolate;
}

.location-tour-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.location-tour-poster::after {
  position: absolute;
  inset: 35% 0 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, .8));
}

.location-tour-launch {
  position: absolute;
  left: 28px;
  bottom: 28px;
  z-index: 1;
}

.location-tour-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.space-tour-actions {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.tour-viewer {
  width: min(1440px, calc(100vw - 48px));
  height: min(900px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
}

.tour-viewer[open] {
  display: flex;
  flex-direction: column;
}

.tour-viewer::backdrop {
  background: rgba(0, 0, 0, .88);
}

.tour-viewer-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}

.tour-viewer-toolbar h2 {
  font: 500 18px/1.4 Arial, Helvetica, sans-serif;
  letter-spacing: normal;
}

.tour-viewer-close {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  font-size: 28px;
  line-height: 1;
}

.tour-viewer-close:hover {
  background: var(--cream);
}

.tour-viewer-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: var(--paper);
}

.tour-viewer-status {
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
}

.tour-viewer-status[hidden] {
  display: none;
}

@media (max-width: 700px) {
  .location-tour {
    padding-top: 42px;
    scroll-margin-top: 95px;
  }

  .location-tour-heading {
    margin-bottom: 18px;
  }

  .location-tour-heading p {
    font-size: 13px;
  }

  .location-tour-poster {
    aspect-ratio: 1.35;
  }

  .location-tour-launch {
    left: 18px;
    right: 18px;
    bottom: 18px;
  }

  .location-tour-actions > .button {
    justify-content: center;
  }

  .tour-viewer {
    width: 100vw;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .tour-viewer-toolbar {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  }

  .tour-viewer-toolbar h2 {
    font-size: 15px;
  }

  .tour-viewer-toolbar > .button {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
  }

  .tour-viewer-close {
    grid-column: 2;
    grid-row: 1;
  }

  .tour-viewer-frame {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Make the four tour launch actions easy to find on the location cards. */
.space-tour-actions .button {
  background: #49d6be;
  border-color: #49d6be;
  color: #101713;
}

.space-tour-actions .button:hover {
  background: #6ce1cc;
  border-color: #6ce1cc;
  color: #101713;
}

.space-tour-actions .button:active {
  background: #37bfa9;
  border-color: #37bfa9;
  color: #101713;
}

.space-tour-actions .button:focus-visible {
  outline-color: #49d6be;
}
