/* ═══════════════════════════════════════════════════════
   Home to 洗礼 — 相册墙（拍立得瀑布流 + 灯箱）
   ═══════════════════════════════════════════════════════ */

.gallery-view { flex-direction: column; }

.gallery-layout {
  flex: 1;
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(20px, 4vh, 44px) clamp(16px, 4vw, 48px) 32px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.gallery-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.gallery-header h2 {
  margin: 0;
  font-family: 'Playfair Display', 'Noto Sans SC', serif;
  font-size: clamp(22px, 2.6vw, 30px);
  color: var(--text-primary, #33302b);
}
.gallery-header p {
  margin: 8px 0 0;
  font-size: 13.5px;
  font-weight: 300;
  letter-spacing: .05em;
  color: var(--text-secondary, #8a857c);
}
.btn-upload-photo {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #fff;
  background: linear-gradient(135deg, #6b9ac4, #7aab8c);
  cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(107, 154, 196, .6);
  transition: transform .2s, filter .2s;
  font-family: inherit;
}
.btn-upload-photo:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* ── 月份分组标题 ── */
.gallery-month {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 16px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  letter-spacing: .18em;
  color: var(--text-muted, #b0a898);
}
.gallery-month::after {
  content: '';
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line-color, #ddd5c4) 0 8px, transparent 8px 14px);
}

/* ── 拍立得网格 ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 26px 22px;
  padding-top: 8px;
}
.polaroid {
  --rot: 0deg;
  position: relative;
  margin: 0;
  background: linear-gradient(180deg, #fffef9 0%, #fbf5e8 100%);
  padding: 10px 10px 14px;
  border-radius: 4px;
  box-shadow: 0 8px 20px -8px rgba(60, 42, 30, .35), 0 2px 5px rgba(60, 42, 30, .12);
  cursor: zoom-in;
  transform: rotate(var(--rot));
  transition: transform .3s ease, box-shadow .3s ease, z-index 0s;
}
.polaroid:hover {
  transform: rotate(0deg) scale(1.05);
  box-shadow: 0 18px 36px -10px rgba(60, 42, 30, .45);
  z-index: 5;
}
.polaroid::before {  /* 顶部胶带 */
  content: '';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 58px;
  height: 18px;
  background: rgba(233, 200, 122, .45);
  border-left: 1px dashed rgba(255,255,255,.6);
  border-right: 1px dashed rgba(255,255,255,.6);
}
.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
  background: #efe9db;
}
.polaroid figcaption {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.5;
  color: #7a7264;
  text-align: center;
  font-family: 'Noto Sans SC', sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(40, 30, 24, .55);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.polaroid:hover .ph-del { display: inline-flex; }
.ph-del:hover { background: #c0504a; }

.gallery-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted, #b0a898);
  font-size: 14px;
  letter-spacing: .08em;
}

/* ── 灯箱 ── */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
}
.photo-lightbox.open { display: block; }
.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 22, .82);
  backdrop-filter: blur(6px);
}
.lb-card {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
  pointer-events: none;
}
.lb-card > * { pointer-events: auto; }
.lb-frame {
  background: #fffef9;
  padding: 14px 14px 10px;
  border-radius: 6px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
  transform: rotate(-.6deg);
  max-width: min(86vw, 900px);
}
.lb-img {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  border-radius: 2px;
}
.lb-meta {
  text-align: center;
  color: #f6ecd8;
}
.lb-caption { font-size: 14.5px; letter-spacing: .04em; }
.lb-date { font-size: 12px; margin-top: 5px; color: rgba(246, 236, 216, .6); font-family: 'Space Mono', monospace; }
.lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s;
}
.lb-close:hover { background: rgba(255, 255, 255, .28); }
.lb-edit {
  border: 1.5px solid rgba(246, 236, 216, .4);
  background: rgba(255, 255, 255, .08);
  color: #f6ecd8;
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s;
}
.lb-edit:hover { background: rgba(255, 255, 255, .2); }
