/* 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;
  isolation: isolate !important;
}

.meyne-lightbox-overlay img {
  max-width: 90vw !important;
  max-height: 90vh !important;
  object-fit: contain !important;
  position: relative;
  z-index: 2147483648 !important;
}

/* ---- BADGE TARGETING ----
   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;
}

.test-kitchen-notes .meyne-lightbox-wrap:has(> img),
.test-kitchen-notes .meyne-lightbox-wrap *:has(> img) {
  display: block;
}

/* White pill + EXPAND text (hidden until hover) */
.meyne-lightbox-wrap:has(> img)::before,
.meyne-lightbox-wrap *:has(> img)::before,
*:has(> img.meyne-lightbox)::before {
  content: "EXPAND";
  position: absolute;
  right: 7px;
  top: 7px;

  display: flex;
  align-items: center;

  height: 30px;
  padding: 0 10px 0 34px;

  font-size: 12px;
  font-family: var(--sans-serif);
  line-height: 1;
  letter-spacing: 0.08em;
  font-weight: 600;
  border: 1px solid;
  border-radius: 999px;
  background: #fff;
  color: var(--global-palette3);

  opacity: 0;
  transform: translateX(10px);
  transition: opacity 200ms ease, transform 200ms ease;

  pointer-events: none;
  z-index: 2;
}

/* Icon (always visible; slides left on hover to reveal text) */
.meyne-lightbox-wrap:has(> img)::after,
.meyne-lightbox-wrap *:has(> img)::after,
*:has(> img.meyne-lightbox)::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 7px;

  width: 30px;
  height: 30px;

  background-image: var(--meyne-lightbox-icon);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;

  pointer-events: none;
  z-index: 3;

  transition: transform 200ms ease;
}

/* Hover: show pill + slide icon left */
.meyne-lightbox-wrap:has(> img):hover::before,
.meyne-lightbox-wrap *:has(> img):hover::before,
*:has(> img.meyne-lightbox):hover::before {
  opacity: 1;
  transform: translateX(0);
}

.meyne-lightbox-wrap:has(> img):hover::after,
.meyne-lightbox-wrap *:has(> img):hover::after,
*:has(> img.meyne-lightbox):hover::after {
  transform: translateX(-70px);
}

/* 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);
}
