/* ==========================================================================
   Direct Homes – Modals & popups
   - Keeps Bootstrap modals and Magnific popups ABOVE the sticky header

   - Video modal (#dhVideoModal, js/directhomes-video.js)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Stacking order: overlays cover the whole page incl. the header
   -------------------------------------------------------------------------- */
.modal {
  z-index: 100050 !important;
}

.modal-backdrop {
  z-index: 100040 !important;
}

/* Photo gallery (Magnific Popup) */
.mfp-bg {
  z-index: 100040 !important;
  background: #0c1f1a;
  opacity: 0.88 !important;
}

.mfp-wrap {
  z-index: 100050 !important;
}

/* --------------------------------------------------------------------------
   2. Video modal
   -------------------------------------------------------------------------- */
.dh-video-modal .modal-dialog {
  max-width: min(1100px, calc(100vw - 32px));
}

.dh-video-modal .modal-content {
  position: relative;
  overflow: visible;
  border: 0;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.dh-video-modal .embed-responsive {
  overflow: hidden;
  border-radius: 16px;
}

.dh-video-modal .dh-video-modal__close {
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--dh-primary);
  opacity: 1;
  text-shadow: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dh-video-modal .dh-video-modal__close:hover,
.dh-video-modal .dh-video-modal__close:focus {
  background: var(--dh-primary);
  color: #fff;
  opacity: 1;
  outline: none;
}

/* Darker backdrop for the video */
.modal-backdrop.show.dh-backdrop-video {
  background-color: #0c1f1a;
  opacity: 0.85;
}

@media (max-width: 575px) {
  .dh-video-modal .dh-video-modal__close {
    top: -50px;
    right: 0;
  }
}
