/**
 * 갤러리 페이지 스타일
 *
 * Masonry 레이아웃 + 카드 스타일로 모던하고 심플한 갤러리
 * - .gallery: Masonry 컨테이너 (CSS columns 사용)
 * - .img-box: 카드 스타일의 개별 이미지 박스
 * - .fullscreen-overlay: 클릭 시 전체화면 미리보기 오버레이
 */

/* ==================== 갤러리 Masonry 레이아웃 (순서 유지 + 빈틈없는 배치) ==================== */
.gallery {
  width: var(--content-width);
  max-width: var(--content-max-width);
  margin: auto;
  margin-top: 50px;
  margin-bottom: 50px;

  & .img-box {
    width: calc(33.333% - 14px);
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;

    & img {
      width: var(--full-width);
      height: auto;
      display: block;
      transition: transform 0.4s ease;
    }

    &:hover {
      transform: translateY(-6px);
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);

      & img {
        transform: scale(1.05);
      }
    }
  }
}

/* ==================== 전체화면 이미지 오버레이 ==================== */
.fullscreen-overlay {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.92) !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 9999 !important;
  backdrop-filter: blur(10px);
  cursor: pointer;
  margin: 0 !important;
  padding: 0 !important;

  & img {
    max-width: 90vw !important;
    max-height: 90vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: popup 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative !important;
  }
}

/* ==================== 애니메이션 ==================== */
@keyframes popup {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ==================== 반응형: 태블릿 (1024px 이하) ==================== */
@media screen and (max-width: 1024px) {
  .gallery .img-box {
    width: calc(50% - 10px);
  }
}

/* ==================== 반응형: 모바일 (760px 이하) ==================== */
@media screen and (max-width: 760px) {
  .gallery {
    width: 90%;
  }

  .gallery .img-box {
    width: var(--full-width);
    margin-bottom: 15px;
  }

  .fullscreen-overlay {
    & img {
      max-width: 95vw;
      max-height: 95vh;
    }
  }
}

/* ==================== 페이지네이션 ==================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 50px auto;
  padding-bottom: 50px;

  & .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    border-radius: 8px;
    background: white;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      background: #f8f9fa;
    }

    &.current {
      background: var(--color-dark-blue);
      color: white;
      box-shadow: 0 4px 12px rgba(0, 21, 36, 0.3);
      cursor: default;

      &:hover {
        transform: none;
      }
    }

    &.prev,
    &.next {
      font-weight: 600;
    }
  }
}
