/* ============================================================
   공용 이미지 확대보기 (라이트박스)
   - 마크업: templates/_lightbox.html
   - 스크립트: static/js/lightbox.js
   - 대상: [data-ssd-lb-scope] 컨테이너 내부 이미지 (JS가 자동 판별)
   ※ :hover 미사용
   ============================================================ */

/* 확대 가능한 이미지 표시 */
img[data-ssd-lb="1"] { cursor: zoom-in; }

.ssd-lb {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .9);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ssd-lb.is-open { display: flex; }

.ssd-lb-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  user-select: none;
  /* 핀치 줌/팬: 브라우저 기본 터치 제스처를 끄고 JS(transform)로 직접 처리 */
  touch-action: none;
  transform-origin: center center;
  will-change: transform;
}

.ssd-lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.ssd-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.ssd-lb-nav svg { width: 22px; height: 22px; }
.ssd-lb-nav--prev { left: 12px; }
.ssd-lb-nav--next { right: 12px; }

/* 현재 위치 (2장 이상일 때만 JS가 노출) */
.ssd-lb-count {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  z-index: 2;
}
.ssd-lb.is-open .ssd-lb-count.is-on { display: block; }

/* 확대/축소 컨트롤 — 데스크탑 전용(모바일은 핀치·더블탭) */
.ssd-lb-zoom {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 100px;
  background: rgba(0, 0, 0, .55);
  z-index: 3;
}
.ssd-lb-zbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex: none;
}
.ssd-lb-zbtn svg { width: 19px; height: 19px; }
.ssd-lb-zbtn:disabled { opacity: .35; cursor: default; }
.ssd-lb-zlevel {
  min-width: 46px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  user-select: none;
}

@media (min-width: 1024px) {
  .ssd-lb.is-open .ssd-lb-zoom { display: flex; }
  /* 데스크탑은 줌바가 하단 중앙을 쓰므로 카운터를 위로 올림 */
  .ssd-lb-count { bottom: 68px; }
}
