/* Lightbox + hover zoom nhẹ cho ảnh */

/* Ảnh có thể bấm - khóa overflow để hover zoom hoặc scale bên trong không bao giờ tràn đè sang ảnh bên cạnh */
.lb-item {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
}

.lb-item:focus-visible {
  outline: 2px solid #ec8100;
  outline-offset: 3px;
}

/* Màn kéo 2 lớp (Dual-layer Curtain) cho hiệu ứng curtain */
.rv-curtain {
  position: absolute;
  inset: -1px;
  pointer-events: none;
  z-index: 3;
}
.rv-curtain__a,
.rv-curtain__b {
  position: absolute;
  inset: 0;
  transform-origin: 100% 50%;
}
.rv-curtain__a {
  background: #002565;
  z-index: 2;
}
.rv-curtain__b {
  background: #0381c8;
  z-index: 1;
}
.rv-curtain--left .rv-curtain__a,
.rv-curtain--left .rv-curtain__b {
  transform-origin: 0% 50%;
}

/* Hover zoom nhẹ: chỉ bật sau khi hiệu ứng mở ảnh kết thúc (.is-in) để không tranh transform với GSAP */
.lb-item.is-in img {
  transition: transform 0.85s cubic-bezier(0.19, 1, 0.22, 1);
  will-change: transform;
}

@media (hover: hover) {
  .lb-item.is-in:hover img {
    transform: scale(1.045);
  }
}

/* Trường hợp reduced-motion (không có .is-in) vẫn có hover zoom rất nhẹ */
@media (hover: hover) and (prefers-reduced-motion: reduce) {
  .lb-item img {
    transition: transform 0.4s ease;
  }
  .lb-item:hover img {
    transform: scale(1.03);
  }
}

/* ===== Lightbox ===== */
html.lb-open {
  overflow: hidden;
}

.lb {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
}

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

.lb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 28, 0.92);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.lb.is-visible .lb__backdrop {
  opacity: 1;
}

.lb.is-closing .lb__backdrop {
  opacity: 0;
}

.lb__stage {
  position: absolute;
  inset: 64px 72px 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.lb__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  opacity: 0;
}

.lb.is-visible .lb__img {
  opacity: 1;
}

.lb__btn {
  position: absolute;
  z-index: 2;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: background-color 0.25s ease, opacity 0.35s ease;
}

.lb.is-visible .lb__btn {
  opacity: 1;
}

.lb.is-closing .lb__btn {
  opacity: 0;
}

.lb__btn:hover,
.lb__btn:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: none;
}

.lb__close {
  top: 14px;
  right: 14px;
}

.lb__prev,
.lb__next {
  top: 50%;
  margin-top: -23px;
}

.lb__prev {
  left: 14px;
}

.lb__next {
  right: 14px;
}

.lb__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.85);
  font-family: Montserrat, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.lb.is-visible .lb__bar {
  opacity: 1;
}

.lb.is-closing .lb__bar {
  opacity: 0;
}

.lb__counter {
  flex: 0 0 auto;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .lb__stage {
    inset: 60px 10px 70px;
  }

  .lb__btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.16);
  }

  .lb__prev {
    left: 8px;
    top: auto;
    bottom: 14px;
    margin-top: 0;
  }

  .lb__next {
    right: 8px;
    top: auto;
    bottom: 14px;
    margin-top: 0;
  }

  .lb__close {
    top: 10px;
    right: 10px;
  }

  .lb__bar {
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    padding: 14px 60px;
    text-align: center;
    font-size: 12px;
  }
}
