.tour-photos,
.tour-photos * {
  box-sizing: border-box;
}

.tour-photos {
  display: flex;
  flex-direction: column;
  inline-size: 100%;
  block-size: 100%;
  min-inline-size: 0;
  min-block-size: 0;
  overflow: hidden;
  color: #f5f2e9;
  background: #111916;
  border-radius: 0.75rem;
  font-family: inherit;
  color-scheme: dark;
}

.tour-photos__stage {
  position: relative;
  flex: 1 1 auto;
  min-block-size: 0;
  min-inline-size: 0;
  overflow: hidden;
  touch-action: auto;
}

.tour-photos__image-host {
  position: absolute;
  inset: 0;
}

.tour-photos__image {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  max-inline-size: 100%;
  max-block-size: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
}

.tour-photos__poster {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tour-photos__status,
.tour-photos__rotate-hint {
  position: absolute;
  z-index: 1;
  inset-inline: 1rem;
  inline-size: fit-content;
  max-inline-size: calc(100% - 2rem);
  margin: 0 auto;
  padding: 0.65rem 0.85rem;
  color: #fff;
  background: rgb(13 23 18 / 92%);
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

.tour-photos__status {
  inset-block-start: 1rem;
}

.tour-photos__rotate-hint {
  inset-block-end: 1rem;
  animation: tour-photos-hint 2s ease-out both;
}

.tour-photos [hidden] {
  display: none !important;
}

.tour-photos__caption {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.5rem 0.8rem 0;
  font-size: 0.875rem;
  line-height: 1.35;
  text-align: center;
}

.tour-photos__controls {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem max(0.65rem, env(safe-area-inset-right))
    max(0.65rem, env(safe-area-inset-bottom)) max(0.65rem, env(safe-area-inset-left));
}

.tour-photos__button {
  flex: 0 0 auto;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 0.55rem 0.8rem;
  border: 1px solid #687970;
  border-radius: 0.45rem;
  color: #fff;
  background: #25382d;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25;
  cursor: pointer;
}

.tour-photos__button:disabled {
  color: #b5beb8;
  background: #1b2821;
  cursor: default;
}

.tour-photos:focus-visible,
.tour-photos__button:focus-visible {
  outline: 3px solid #f2d599;
  outline-offset: -3px;
}

.tour-photos__counter {
  min-inline-size: 3.25rem;
  color: #e1e9e2;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.tour-photos:fullscreen {
  inline-size: 100vw;
  block-size: 100vh;
  block-size: 100dvh;
  border-radius: 0;
}

@media (orientation: landscape) and (max-height: 600px) {
  .tour-photos__controls {
    gap: 0.4rem;
    padding-block-start: 0.35rem;
  }

  .tour-photos__caption {
    padding-block-start: 0.25rem;
    font-size: 0.8rem;
  }
}

@keyframes tour-photos-hint {
  0% { opacity: 0; }
  10%, 82% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-photos__rotate-hint {
    animation: none;
  }
}
