/* Generic, neutral styling */
#pm-popup-root.pm-hidden { display: none; }

/* Overlay fade */
#pm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9998;

  opacity: 0;
  animation: pmFadeOverlay 0.35s ease forwards;
}

/* Modal fade + scale */
#pm-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 9999;

  opacity: 0;
  transform: scale(0.95);
  animation: pmFadeModal 0.35s ease forwards;
}

/* Animation keyframes */

@keyframes pmFadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pmFadeModal {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.pm-image-wrap img {
  max-width: 90vw;
  max-height: 90vh;
  transition: transform 0.25s ease;
}

.pm-image-wrap img:hover {
  transform: scale(1.02);
}

.pm-modal-inner {
  background: #fff;
  max-width: min(90vw, 800px);
  max-height: 90vh;
  width: auto;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: auto;
  position: relative;
}

.pm-modal-content {
  padding: 24px;
  line-height: 1.5;
  color: #222;
}

.pm-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: #f2f2f2;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  border-radius: 999px;
  width: 34px;
  height: 34px;
}

.pm-close:hover {
  background: #e5e5e5;
}

/* Image mode: scale to fit */
.pm-image-wrap {
  display: block;
  max-width: min(90vw, 1000px);
  max-height: 90vh;
}

.pm-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 18px;
  border: 12px solid #fff; /* thick white border */
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3); /* subtle shadow for depth */
}

/* Prevent background scroll when open */
.pm-lock-scroll {
  overflow: hidden !important;
}