/* ========================================
 * 图片画廊页样式
 * 文件路径：css/pages/gallery.css
 * ======================================== */

.gallery-page__header {
  text-align: center;
  margin-bottom: 32px;
}

.gallery-page__title {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.gallery-page__subtitle {
  font-size: 15px;
  color: var(--color-text-secondary);
}

.gallery-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

/* 画廊网格 */
.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.gallery-masonry__item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s ease;
}

.gallery-masonry__item:hover {
  transform: translateY(-4px);
}

.gallery-masonry__item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-masonry__item:hover img {
  transform: scale(1.05);
}

.gallery-masonry__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  padding: 24px 16px 16px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-masonry__item:hover .gallery-masonry__overlay {
  transform: translateY(0);
}

.gallery-masonry__name {
  font-size: 14px;
  font-weight: 500;
}

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox__image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox__close:hover {
  background: rgba(255,255,255,0.3);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox__nav:hover {
  background: rgba(255,255,255,0.3);
}

.lightbox__nav--prev {
  left: 20px;
}

.lightbox__nav--next {
  right: 20px;
}

.lightbox__info {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  text-align: center;
}

/* 响应式 */
@media (max-width: 1024px) {
  .gallery-masonry {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-masonry {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .gallery-masonry {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .gallery-masonry__item img {
    height: 160px;
  }
}
