/* ============================================================
   Photo gallery — masonry grid, full-bleed cream background
   ============================================================ */

body.gallery-page {
  background: var(--card);
  background-attachment: initial;
}

.gallery-wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

.gallery-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.gallery-header h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.gallery-back {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--body);
  white-space: nowrap;
}
.gallery-back:hover { color: var(--accent); }

/* ---------- Masonry grid ---------- */
.gallery {
  column-count: 1;
  column-gap: 18px;
}
@media (min-width: 480px) {
  .gallery { column-count: 2; }
}
@media (min-width: 900px) {
  .gallery { column-count: 3; }
}
@media (min-width: 1300px) {
  .gallery { column-count: 4; }
}

.photo {
  position: relative;
  break-inside: avoid;
  margin: 0 0 18px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(22, 30, 60, 0.1);
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
}

.photo:focus { outline: none; }

.photo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(253, 248, 236, 0.92);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.photo:hover .photo-overlay,
.photo:focus .photo-overlay,
.photo:focus-within .photo-overlay {
  opacity: 1;
}

.photo-date {
  position: absolute;
  top: 14px;
  left: 16px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.photo-label {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  color: var(--ink);
}

/* ---------- Footer ---------- */
.gallery-wrap footer {
  padding-top: 44px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.gallery-wrap footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .gallery-wrap { padding: 24px 16px 48px; }
  .gallery-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}
