/* ============================================================
   摄影集（瀑布流 + 灯箱）
   复用主题 CSS 变量（--paper/--surface/--ink/--accent 等）
   ============================================================ */

/* ---------- 页头 ---------- */
.gallery-head {
  margin-bottom: 38px;
}
.gallery-head h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.gallery-intro {
  color: var(--muted);
  max-width: 620px;
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0;
}

/* ---------- 瀑布流网格 ---------- */
.gallery-grid {
  column-count: 3;
  column-gap: 18px;
}
.shot {
  display: block;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  border: none;
  background: var(--surface-2);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.shot:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s ease, filter 0.5s ease;
}
.shot:hover img {
  transform: scale(1.05);
  filter: saturate(1.08);
}
.shot-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 16px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  text-align: left;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.shot:hover .shot-cap,
.shot:focus-visible .shot-cap {
  opacity: 1;
  transform: translateY(0);
}
.shot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}
.lightbox.open {
  display: block;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 7, 6, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lb-fade 0.25s ease;
}
.lightbox-panel {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(1120px, 94vw);
  height: min(88vh, 840px);
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: lb-pop 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.lb-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.lb-close:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: rotate(90deg);
}
.lb-media {
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}
.lb-media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.lb-info {
  padding: 40px 36px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.lb-info h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -0.01em;
  margin: 8px 0 16px;
}
.lb-desc {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1rem;
  margin: 0 0 18px;
}
.lb-meta {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.lb-nav {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.lb-nav button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}
.lb-nav button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lb-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
}

@keyframes lb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes lb-pop {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .gallery-grid { column-count: 2; }
}
@media (max-width: 560px) {
  .gallery-grid { column-count: 1; }
  .shot-cap { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .lightbox-panel {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    height: 92vh;
    width: 96vw;
  }
  .lb-info { padding: 24px 22px; }
}
