/* ==========================
   IMAGE LIGHTBOX / MODAL
========================== */

/* Hard safety: if aria-hidden=true, never show (even if other rules conflict) */
.lightbox[aria-hidden="true"]{
  display: none !important;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.lightbox.is-open { display: flex; }

.lightbox-content {
  position: relative;
  width: min(1100px, 100%);
  height: min(80vh, 760px);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.35);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.lightbox-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* key for device adaptation */
  display: block;
  background: #000;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 42px;
  text-align: center;
  transition: transform 0.08s ease, background 0.12s ease;
}

.lightbox-close:hover { background: rgba(0,0,0,0.7); }
.lightbox-close:active { transform: scale(0.98); }

@media (max-width: 560px) {
  .lightbox-content {
    height: 78vh;
    border-radius: 12px;
  }
  .lightbox-close {
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-size: 20px;
  }
}

/* Make carousel images feel clickable */
.carousel-img {
  cursor: zoom-in;
}
