/* ==========================================================================
   Fresh Makelaars – video overlay + the gallery tile that opens it
   Theme agnostic: keyed off [data-fm-video].

   Geometry follows lightbox.css so the two viewers match. Every rule is scoped
   under its own block class to reach the same specificity as `.lightbox .x`,
   otherwise a theme rule sitting between one and two classes wins.
   ========================================================================== */

.fm-video-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-video-overlay[hidden] {
  display: none;
}

body.fm-video-open {
  overflow: hidden;
}

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

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

.fm-video-overlay .fm-video-player {
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  background: #000;
}

.fm-video-overlay .fm-video-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-video-overlay .fm-video-close:hover,
.fm-video-overlay .fm-video-close:focus {
  color: #bbb;
  text-decoration: none;
}

@media (max-width: 768px) {
  .fm-video-overlay .fm-video-close {
    font-size: 30px;
  }

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

  .fm-video-overlay .fm-video-player {
    max-height: 300px;
  }
}

/* ── The play tile ──────────────────────────────────────────
   One surface definition, two homes: the hero gallery's thumbnail column and the
   media tab's video grid. Sizing comes from whichever grid it sits in, so this
   only owns the look — grey fill, play glyph, label. */
#fresh-makelaars .fm-video-tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  cursor: pointer;
  /* Grey, deliberately flat: no poster frame is available, and a neutral tile
     reads as "video" rather than as one more photo. */
  background: linear-gradient(145deg, #4b5563, #2f3742);
}

#fresh-makelaars .fm-video-tile-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#fresh-makelaars .fm-video-tile-icon svg {
  width: 54px;
  height: 54px;
  opacity: 0.92;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

#fresh-makelaars .fm-video-tile:hover .fm-video-tile-icon svg,
#fresh-makelaars .fm-video-tile:focus-visible .fm-video-tile-icon svg {
  transform: scale(1.1);
  opacity: 1;
}

#fresh-makelaars .fm-video-tile-label {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

#fresh-makelaars .fm-video-tile:focus-visible {
  outline: 2px solid var(--fm2-blue, #0073aa);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  #fresh-makelaars .fm-video-tile-icon svg {
    transition: none;
  }

  #fresh-makelaars .fm-video-tile:hover .fm-video-tile-icon svg {
    transform: none;
  }
}
