/* ===== 갤러리 페이지 ===== */
.gallery-intro {
  text-align: center;
  margin-bottom: 40px;
}
.gallery-intro h2 {
  font-size: 26px;
  font-weight: 800;
  color: #1A1A2E;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.gallery-intro p {
  font-size: 15px;
  color: #666;
  line-height: 1.7;
  word-break: keep-all;
}

/* 4열 그리드 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 60px;
}

.gallery-item {
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  position: relative;
}

.gallery-img-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.gallery-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.gallery-item:hover .gallery-img-wrap img {
  transform: scale(1.06);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  opacity: 0;
}

.gallery-item:hover .gallery-overlay {
  background: rgba(0,0,0,0.35);
  opacity: 1;
}

/* ===== 라이트박스 ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
}
.lightbox.active {
  display: flex;
}

.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 9001;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9001;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.25); }

.lightbox-counter {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

/* ===== 반응형 ===== */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .gallery-intro h2 { font-size: 22px; }
  .gallery-intro p { font-size: 14px; }
  .gallery-overlay { display: none; }

  .lightbox-prev { left: 8px; width: 36px; height: 36px; font-size: 16px; }
  .lightbox-next { right: 8px; width: 36px; height: 36px; font-size: 16px; }
  .lightbox-img-wrap img { max-width: 96vw; }
}
