/**
 * Clinic Skin — 사례 상세 이미지 라이트박스 (assets/js/case-lightbox.js 짝)
 * 스킨과 무관하게 사례 상세에서만 로드된다. 접두어 pclb- 로 기존 스타일과 충돌 없음.
 */

/* 트리거 — 원본 이미지에 확대 커서 */
.pclb-trigger { cursor: zoom-in; }
.pclb-trigger:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.pclb {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(12, 12, 12, .94);
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
  animation: pclb-in .18s ease-out;
}
.pclb[hidden] { display: none; }
@keyframes pclb-in { from { opacity: 0; } to { opacity: 1; } }

.pclb__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px 64px;
  overflow: hidden;
  touch-action: none;
}
.pclb__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform .22s ease, opacity .2s ease;
  transform-origin: center center;
  will-change: transform;
}
.pclb.is-zoomed .pclb__img { cursor: grab; }
.pclb.is-dragging .pclb__img { cursor: grabbing; transition: none; }
.pclb.is-loading .pclb__img { opacity: .35; }

/* 확대 중에는 이미지가 화면 전체를 쓰도록 버튼·캡션을 걷는다 */
.pclb.is-zoomed .pclb__nav,
.pclb.is-zoomed .pclb__bar { opacity: 0; pointer-events: none; }

.pclb__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font: 300 32px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
.pclb__btn:hover { background: rgba(255, 255, 255, .22); }
.pclb__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pclb__btn[hidden] { display: none; }
.pclb__close { top: 12px; right: 12px; z-index: 2; }
.pclb__nav { top: 50%; margin-top: -24px; font-size: 40px; }
.pclb__prev { left: 12px; }
.pclb__next { right: 12px; }

.pclb__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  font-size: 13px;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .78);
  transition: opacity .15s ease;
}
.pclb__cap {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pclb__count { flex: none; font-variant-numeric: tabular-nums; }

@media (max-width: 767px) {
  .pclb__stage { padding: 56px 0 52px; }
  .pclb__nav {
    top: auto;
    bottom: 56px;
    margin-top: 0;
    width: 40px;
    height: 40px;
    font-size: 32px;
    background: rgba(0, 0, 0, .35);
  }
  .pclb__bar { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .pclb { animation: none; }
  .pclb__img { transition: none; }
}
