/* 🖼️ 갤러리 (썸네일 슬라이더 + 전체화면 뷰어)
   index.html 에서 css/style.css 바로 아래에 추가:
   <link rel="stylesheet" href="css/gallery.css" />
*/

/* ───────── 썸네일 슬라이더 ───────── */
.g-slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}
.g-slider::-webkit-scrollbar { display: none; }
.g-slider.dragging { scroll-snap-type: none; cursor: grabbing; }

.g-item {
  flex: 0 0 64%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  scroll-snap-align: center;
  cursor: pointer;
  background: #eee;
}
/* 첫/끝 사진도 가운데에 오도록 양끝 여백 */
.g-item:first-child { margin-left: 18%; }
.g-item:last-child { margin-right: 18%; }

.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 진행 막대 */
.g-progress {
  position: relative;
  width: 120px;
  height: 2px;
  margin: 20px auto 0;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.14);
}
.g-progress-thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 2px;
  border-radius: 99px;
  background: #9a8370;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ───────── 전체화면 뷰어 ───────── */
html.lb-lock,
html.lb-lock body { overflow: hidden; }

.lb {
  position: fixed;
  inset: 0;
  z-index: 10000; /* 지퍼 스크롤바/인트로보다 위 */
  background: #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}
.lb.open { opacity: 1; visibility: visible; }

.lb-track {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.lb-track::-webkit-scrollbar { display: none; }

.lb-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0; /* 큰 원본 이미지가 슬라이드 폭을 밀어내지 않게 */
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  scroll-snap-stop: always; /* 한 번에 한 장씩만 넘어가게 */
}
.lb-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.lb-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.05em;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
  pointer-events: none;
}
.lb-close {
  pointer-events: auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.lb-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.lb-arrow[hidden] { display: none; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

/* 터치 기기에서는 스와이프로 충분하니 화살표 숨김 */
@media (hover: none) {
  .lb-arrow { display: none; }
}