/* ════════════════════════════════
   LIGHTBOX — 이미지 전체보기
   ════════════════════════════════ */

/* ── 모든 추억 사진 공통 효과 ── */
.memory-chapter img {
  cursor: zoom-in;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
  will-change: transform;
}

.memory-chapter img:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 32px rgba(60,20,40,0.22);
  filter: brightness(1.05);
  z-index: 2;
  position: relative;
}

.memory-chapter img:active {
  transform: scale(0.96);
  filter: brightness(0.95);
}

/* 탭 리플 */
@keyframes imgTap {
  0%   { outline: 0px solid rgba(244,160,176,0); }
  40%  { outline: 6px solid rgba(244,160,176,0.5); }
  100% { outline: 10px solid rgba(244,160,176,0); }
}

.img-tap {
  animation: imgTap 0.4s ease-out;
}

/* ── Lightbox Overlay ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* 배경 */
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 6, 16, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ── 이미지 컨테이너 ── */
.lightbox-img-wrap {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 480px);
  max-height: 88dvh;
  transform: scale(0.82) translateY(24px);
  transition: transform 0.38s cubic-bezier(.22,1,.36,1);
  border-radius: 18px;
  overflow: visible;
  box-shadow: 0 28px 80px rgba(0,0,0,0.55);
}

.lightbox-overlay.open .lightbox-img-wrap {
  transform: scale(1) translateY(0);
}

.lightbox-img {
  display: block;
  width: 100%;
  max-height: 82dvh;
  object-fit: contain;
  border-radius: 18px;
  transition: opacity 0.15s ease;
}

.lightbox-img.lb-fade-out { opacity: 0; transform: scale(0.96); transition: opacity 0.15s, transform 0.15s; }
.lightbox-img.lb-fade-in  { animation: lbFadeIn 0.25s ease; }

@keyframes lbFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── 닫기 버튼 ── */
.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-close:hover  { background: rgba(255,255,255,0.32); }
.lightbox-close:active { transform: scale(0.9); }

/* ── 이전/다음 버튼 ── */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-prev { left: -52px; }
.lightbox-next { right: -52px; }

.lightbox-prev:hover,
.lightbox-next:hover  { background: rgba(255,255,255,0.28); }
.lightbox-prev:active { transform: translateY(-50%) scale(0.9); }
.lightbox-next:active { transform: translateY(-50%) scale(0.9); }

/* 모바일: 버튼을 이미지 안으로 */
@media (max-width: 560px) {
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 8px; right: 8px; }
}

/* ── 카운터 ── */
.lightbox-counter {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  font-weight: 300;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
