/* ============================================================
   JINER Blog — /gallery 摄影集 + 灯箱
   ============================================================ */
.gallery-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--nav-height, 60px) + 2.5rem) 1.5rem 4rem;
}
.gallery-hero {
  text-align: center;
  padding: 2rem 0 3rem;
}
.gallery-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.gallery-hero p { color: var(--color-text-muted); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  transition: transform .3s ease, box-shadow .3s ease;
}
.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.gallery-card:hover img { transform: scale(1.05); }

.gallery-empty, .empty-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--color-text-muted);
}

/* ---------- 灯箱 ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
  border: none;
  line-height: 1;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .2); }
.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .6);
  font-size: .85rem;
  font-family: var(--font-mono);
}

@media (max-width: 640px) {
  .gallery-wrap { padding-left: .75rem; padding-right: .75rem; }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .5rem;
  }
  .gallery-card { border-radius: 8px; }
}
