/* ==========================================================================
   Fresh Makelaars – 360° panorama overlay
   Theme agnostic: shared by both themes, keyed off [data-panorama].

   Geometry and weights are taken from lightbox.css on purpose, so opening a
   panorama looks like opening a photo. Selectors stay separate because
   lightbox.js binds to bare .close / .prev / .next globally.
   ========================================================================== */

.fm-panorama-overlay {
  position: fixed;
  z-index: 9999999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}

.fm-panorama-overlay[hidden] {
  display: none;
}

/* Stop the page scrolling behind the overlay while dragging the panorama. */
body.fm-panorama-open {
  overflow: hidden;
}

.fm-panorama-overlay .fm-panorama-content {
  position: relative;
  margin: auto;
  padding: 20px;
  width: 100%;
  max-width: 100%;
}

.fm-panorama-overlay .fm-panorama-main {
  position: relative;
  text-align: center;
  height: calc(100vh - 160px);
  display: flex;
  align-items: center;
}

/* Takes the place of .lightbox-image: same box, but it hosts a WebGL canvas, so
   it needs a real background and its own clipping. */
.fm-panorama-overlay .fm-panorama-stage {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 160px);
  background: #111;
  overflow: hidden;
}

.fm-panorama-overlay .fm-panorama-navigation {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 36px;
  /* font-family is deliberately NOT set: .lightbox .navigation does not set it
     either, so the ❮ ❯ ornaments resolve through the same route in both viewers.
     Pinning it here would reintroduce the difference on any theme that leaves
     buttons at the UA font. Sharing a parent (see panorama.js) is what makes the
     inheritance identical. */
  font-size: 36px;
  line-height: 36px;
  margin-top: -22px;
  color: white;
  font-weight: bold;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  border: none;
  user-select: none;
  /* Above the panorama canvas, or the drag handler swallows the click. The
     lightbox needs no equivalent — it has no canvas — and it is the only
     declaration here that the lightbox rule does not also have. */
  z-index: 10;
}

.fm-panorama-overlay .fm-panorama-next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.fm-panorama-overlay .fm-panorama-prev {
  left: 0;
}

.fm-panorama-overlay .fm-panorama-navigation:hover,
.fm-panorama-overlay .fm-panorama-navigation:focus {
  background: none !important;
  outline: none !important;
}

.fm-panorama-overlay .fm-panorama-navigation[hidden] {
  display: none;
}

.fm-panorama-overlay .fm-panorama-close {
  position: absolute;
  z-index: 10;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  line-height: 1;
}

.fm-panorama-overlay .fm-panorama-close:hover,
.fm-panorama-overlay .fm-panorama-close:focus {
  color: #bbb;
  text-decoration: none;
}

.fm-panorama-overlay .fm-panorama-thumbnails {
  display: flex;
  height: 100px;
  margin-top: 20px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 5px;
  scrollbar-width: none; /* Firefox */
}

.fm-panorama-overlay .fm-panorama-thumbnails::-webkit-scrollbar {
  display: none; /* Chrome / Safari */
}

.fm-panorama-overlay .fm-panorama-thumbnails[hidden] {
  display: none;
}

.fm-panorama-overlay .fm-panorama-thumbnail {
  margin: 5px;
  flex-shrink: 0;
  flex-basis: 10%;
}

.fm-panorama-overlay .fm-panorama-thumbnail img {
  width: 100%;
  height: 100%;
  cursor: pointer;
  object-fit: cover;
}

.fm-panorama-overlay .fm-panorama-thumbnail.is-active {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* The tiles that open the viewer. */
[data-panorama] {
  cursor: pointer;
}

[data-panorama]:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .fm-panorama-overlay .fm-panorama-navigation {
    padding: 10px;
    font-size: 36px;
  }

  .fm-panorama-overlay .fm-panorama-close {
    font-size: 30px;
  }

  .fm-panorama-overlay .fm-panorama-main {
    height: 300px;
  }

  .fm-panorama-overlay .fm-panorama-stage {
    max-height: 300px;
  }

  .fm-panorama-overlay .fm-panorama-thumbnail {
    flex-basis: 30%;
  }

  .fm-panorama-overlay .fm-panorama-thumbnail img {
    height: 60px;
    object-fit: cover;
  }
}
