/* static/css/modal_fix.css
   Fix: Bootstrap modals appearing "under" the page due to stacking contexts created by
   transforms/filters/overflow on parent containers.
*/
.modal {
  z-index: 200000 !important;
}

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

.modal {
  position: fixed !important;
}

/* Ensure navbar stays below modal */
.navbar.fixed-top {
  z-index: 1040;
}

/* Common culprits: transformed containers create new stacking context */
.hc-main, .hc-page-surface, .container, .container-fluid {
  transform: none;
  filter: none;
}

/* If your theme sets overflow that clips the modal, neutralize while modal open */
body.modal-open,
body.modal-open .hc-main,
body.modal-open .hc-page-surface {
  overflow: visible !important;
}

/* Fullscreen image inside modal (for lightbox) */
.gc-lightbox .modal-dialog {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
}
.gc-lightbox .modal-content {
  height: 100vh !important;
  background: rgba(0,0,0,0.92);
}
.gc-lightbox .modal-body {
  padding: 0 !important;
}
.gc-lightbox .gc-lb-stage {
  width: 100%;
  height: calc(100vh - 58px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto; /* allows natural-size scroll when zoomed */
}
.gc-lightbox .gc-lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
.gc-lightbox .gc-lb-img.gc-zoomed {
  max-width: none !important;
  max-height: none !important;
  object-fit: unset !important;
  cursor: zoom-out;
}
