/**
 * Image Gallery — LineageCare Pack PRO
 */

/* ── Grid Layout ─────────────────────────────────────────────── */
.lceap-gallery-wrap {
  width: 100%;
}

.lceap-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.lceap-gallery-masonry {
  column-count: 3;
  column-gap: 12px;
}

.lceap-gallery-masonry .lceap-gallery-item {
  break-inside: avoid;
  margin-bottom: 12px;
}

/* ── Gallery Item ────────────────────────────────────────────── */
.lceap-gallery-item {
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.lceap-gallery-img-wrap {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  background: #f9f9fb;
}

.lceap-gallery-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

/* ── Hover Effects ───────────────────────────────────────────── */
.lceap-gallery-hover-zoom .lceap-gallery-img-wrap:hover img,
.lceap-gallery-hover-zoom-overlay .lceap-gallery-img-wrap:hover img,
.lceap-gallery-hover-slide-up .lceap-gallery-img-wrap:hover img {
  transform: scale(1.07);
}

/* Overlay */
.lceap-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(233, 69, 96, 0.75);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
}

.lceap-gallery-hover-zoom-overlay .lceap-gallery-img-wrap:hover .lceap-gallery-overlay {
  opacity: 1;
}

/* Slide up caption */
.lceap-gallery-hover-slide-up .lceap-gallery-overlay {
  align-items: flex-start;
  justify-content: flex-end;
  padding: 20px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.lceap-gallery-hover-slide-up .lceap-gallery-img-wrap:hover .lceap-gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}

.lceap-gallery-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.lceap-gallery-zoom-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  backdrop-filter: blur(4px);
}

.lceap-gallery-caption {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  max-width: 180px;
  line-height: 1.4;
}

/* Lightbox trigger — invisible clickable layer */
.lceap-gallery-lightbox-trigger {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
}

/* ── LIGHTBOX MODAL ──────────────────────────────────────────── */
/* FIX: display:none by default — no display:block/flex that would cause full-page overlay */
.lceap-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none; /* JS controls via .show() / .hide() */
  align-items: center;
  justify-content: center;
}
.lceap-lightbox.lceap-lb-active {
  display: flex;
}

.lceap-lb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
  z-index: 0;
}

.lceap-lb-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
}

.lceap-lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
}

.lceap-lb-img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.lceap-lb-close {
  position: fixed;
  top: 20px; right: 24px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: background 0.2s;
  backdrop-filter: blur(6px);
}
.lceap-lb-close:hover { background: #e94560; }

.lceap-lb-prev,
.lceap-lb-next {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(6px);
}
.lceap-lb-prev { left: 20px; }
.lceap-lb-next { right: 20px; }
.lceap-lb-prev:hover { background: rgba(233,69,96,0.65); transform: translateY(-50%) scale(1.08); }
.lceap-lb-next:hover { background: rgba(233,69,96,0.65); transform: translateY(-50%) scale(1.08); }

.lceap-lb-counter {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  z-index: 10;
}

/* ── Body lock ───────────────────────────────────────────────── */
body.lceap-modal-body-lock {
  overflow: hidden !important;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .lceap-gallery-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .lceap-gallery-masonry { column-count: 2 !important; }
  .lceap-lb-prev { left: 8px; }
  .lceap-lb-next { right: 8px; }
}
@media (max-width: 480px) {
  .lceap-gallery-grid { grid-template-columns: 1fr !important; }
  .lceap-gallery-masonry { column-count: 1 !important; }
}
