/* Lightbox overlay (unchanged) */
.meyne-lightbox-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,.5) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2147483647 !important;
  cursor: zoom-out !important;
}

.meyne-lightbox-overlay img {
  max-width: 90vw !important;
  max-height: 90vh !important;
  object-fit: contain !important;
}

/* ---- BADGE TARGETING (UPDATED) ----
   Show badge on:
   A) the .meyne-lightbox-wrap element itself if it directly contains an img
   B) any descendant inside .meyne-lightbox-wrap that directly contains an img
   C) any element anywhere that directly contains img.meyne-lightbox (checkbox case)
*/
.meyne-lightbox-wrap:has(> img),
.meyne-lightbox-wrap *:has(> img),
*:has(> img.meyne-lightbox) {
  position: relative;
  display: inline-block;
  cursor: zoom-in;
}

/* Bottom-corner icon */
.meyne-lightbox-wrap:has(> img)::after,
.meyne-lightbox-wrap *:has(> img)::after,
*:has(> img.meyne-lightbox)::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 28px;
  height: 28px;

  background-image: var(--meyne-lightbox-icon);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;

  opacity: 0.95;
  pointer-events: none;
  z-index: 2;
}

/* "Expand" label */
.meyne-lightbox-wrap:has(> img)::before,
.meyne-lightbox-wrap *:has(> img)::before,
*:has(> img.meyne-lightbox)::before {
  content: "Expand";
  position: absolute;
  right: 46px;
  bottom: 14px;

  font-size: 13px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 6px;

  background: rgba(0, 0, 0, 0.70);
  color: #fff;

  opacity: 0;
  transform: translateY(2px);
  transition: opacity 150ms ease, transform 150ms ease;

  pointer-events: none;
  z-index: 2;
}

/* Show label on hover */
.meyne-lightbox-wrap:has(> img):hover::before,
.meyne-lightbox-wrap *:has(> img):hover::before,
*:has(> img.meyne-lightbox):hover::before {
  opacity: 1;
  transform: translateY(0);
}

/* Optional dim on hover */
.meyne-lightbox-wrap:has(> img):hover > img,
.meyne-lightbox-wrap *:has(> img):hover > img,
*:has(> img.meyne-lightbox):hover > img {
  filter: brightness(0.95);
}
