/**
 * Gallery Protection CSS - Site2 Edition
 * Applied only on /performances/, /events/, and /photography pages
 * Prevents user interactions with gallery images while preserving button functionality
 * Includes print-to-PDF prevention
 */

/* Protect gallery grid images from selection and dragging */
.mpm-gallery img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
  /* Allow pointer events to pass through to parent for lightbox click */
}

/* Protect gallery tiles */
.mpm-tile {
  user-select: none;
  -webkit-user-select: none;
}

/* Protect lightbox images when displayed */
.gslide-image img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* Protect glightbox container images */
.glightbox img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* Ensure gallery links are not selectable */
.mpm-link {
  user-select: none;
  -webkit-user-select: none;
}

/* Preserve functionality for Add to Cart buttons */
.mpm-add {
  user-select: auto;
  -webkit-user-select: auto;
  pointer-events: auto;
  cursor: pointer;
}

/* Lightbox container text should not be selectable (descriptions) */
.glightbox-container .gslide-description {
  user-select: none;
  -webkit-user-select: none;
}

/* However, allow button text in lightbox description to be interactive */
.glightbox-container button {
  user-select: auto;
  -webkit-user-select: auto;
  pointer-events: auto;
}

/* Prevent text selection on entire gallery container */
.mpm-gallery-container {
  user-select: none;
  -webkit-user-select: none;
}

/* Disable image context menu on iOS/Safari */
@supports (-webkit-touch-callout: none) {
  .mpm-gallery img,
  .gslide-image img,
  .glightbox img {
    -webkit-touch-callout: none;
  }
}

/* Additional protection for mobile devices */
@media (max-width: 768px) {
  .mpm-gallery img {
    -webkit-user-callout: none;
    -webkit-touch-callout: none;
  }
  
  /* Ensure iOS long-press doesn't show image save menu */
  .mpm-tile,
  .mpm-gallery {
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
}

/* PRINT-TO-PDF PREVENTION: Hide gallery on print */
@media print {
  .mpm-gallery,
  .mpm-gallery-container,
  .gcontainer {
    display: none !important;
  }
  
  /* Also hide glightbox on print */
  .glightbox-container {
    display: none !important;
  }
}
