/* Native modal for the four comparison and virtual-tour viewers on the agency page. */
.tour-dialog {
  position: fixed;
  inset: 0;
  padding: 0;
  margin: 0;
  border: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  overflow: hidden;
  background: transparent;
  color: #fff;
}
.tour-dialog[open] { display: grid; place-items: center; }
.tour-dialog::backdrop { background: rgb(0 0 0 / 60%); }
html:has(.tour-dialog[open]) { overflow: hidden; }
.tour-dialog__panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 649px;
  scale: 1.5;
}
.tour-dialog__controls {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: none;
}
.tour-dialog__close {
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  line-height: 1;
  font-size: 30px;
  cursor: pointer;
}
.tour-dialog__close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.tour-dialog iframe {
  display: block;
  flex: none;
  width: 100%;
  height: 487px;
  border: 0;
  border-radius: 24px;
}
@media (min-width: 441px) and (max-width: 1100px) {
  .tour-dialog[data-layout="staging"] iframe { scale: .7; }
}
@media (min-width: 441px) {
  /* Keep the dismissal control on screen when the scaled viewer exceeds the viewport. */
  .tour-dialog__controls {
    position: relative;
    right: max(0px, calc((649px - 100vw / 1.5) / 2));
    top: max(0px, calc((537px - 100dvh / 1.5) / 2));
    z-index: 1;
  }
}
@media (max-width: 440px) {
  .tour-dialog__panel { width: 290px; }
  .tour-dialog iframe { height: 380px; border-radius: 10px; }
  .tour-dialog[data-layout="comparison"] .tour-dialog__panel { width: 295px; }
  .tour-dialog[data-layout="comparison"] iframe { height: 220px; border-radius: 0; }
  .tour-dialog[data-layout="comparison"] .tour-dialog__controls { translate: -20px 10px; scale: .7; }
  .tour-dialog[data-layout="staging"] .tour-dialog__panel { scale: 1.3; }
  .tour-dialog[data-layout="staging"] .tour-dialog__close,
  .tour-dialog[data-layout="renovation"] .tour-dialog__controls { scale: .7; }
}
@media (max-width: 320px) {
  .tour-dialog[data-layout="comparison"] .tour-dialog__panel { width: 237px; height: 217px; }
  .tour-dialog[data-layout="comparison"] iframe { height: 178px; }
  .tour-dialog[data-layout="staging"] .tour-dialog__panel,
  .tour-dialog[data-layout="renovation"] .tour-dialog__panel { width: 280px; height: 380px; scale: 1; }
  .tour-dialog[data-layout="staging"] iframe,
  .tour-dialog[data-layout="renovation"] iframe { flex: 1; min-height: 0; }
  .tour-dialog[data-layout="renovation"] .tour-dialog__controls { flex: 1; width: auto; min-height: 0; }
}
