.poptrox-popup {
  background: none !important;
  position: relative !important;
}

.poptrox-popup .caption {
  bottom: 60px !important;
  color: white !important;
  font-size: 1em;
  overflow: hidden;
  line-height: 24px !important;
  padding: 10px;
  text-shadow: 1px 1px 2px rgb(0, 0, 0), 0 0 1.5em rgb(0, 0, 0), 0 0 0.2em rgb(0, 0, 0);
}

.poptrox-overlay {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.grid-gallery-poptrox-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-gallery-copy-notice {
  position: fixed;
  z-index: 10000001;
  bottom: 1rem;
  left: 50%;
  max-width: calc(100vw - 2rem);
  padding: 0.65rem 1rem;
  transform: translateX(-50%);
  border-radius: 0.25rem;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease, visibility 0s linear 150ms;
}

.grid-gallery-copy-notice.is-visible {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

@media (max-width: 767px) {
  .grid-gallery-poptrox-overlay {
    box-sizing: border-box;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
      env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }

  .grid-gallery-poptrox-overlay .poptrox-popup {
    padding-right: 0 !important;
    padding-left: 0 !important;
  }

  .grid-gallery-poptrox-overlay .pic img {
    max-width: calc(
      100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)
    ) !important;
    /* Keep Poptrox's 20px window margin and 70px caption/padding area within safe bounds. */
    max-height: calc(
      100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 110px
    ) !important;
    max-height: calc(
      100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 110px
    ) !important;
  }
}
