/* Photography gallery pages. Loaded after /home.css and reuses its tokens. */

.gallery-page > section { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.gallery-head { padding-top: clamp(32px, 5vw, 64px); padding-bottom: clamp(32px, 4vw, 48px); }
.gallery-back {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 0;
  font-weight: 600; font-size: 15px; text-decoration: none; color: var(--ink-soft);
}
.gallery-back .icon { transform: scaleX(-1); transition: transform .25s var(--ease-out); }
.gallery-back:hover { color: var(--ink); }
.gallery-back:hover .icon { transform: scaleX(-1) translateX(3px); }
.gallery-head h1 {
  margin-top: 28px; font-size: clamp(52px, 9vw, 120px); line-height: .92; letter-spacing: -.045em;
}
.gallery-head h1::after {
  content: ""; display: block; width: 84px; height: 30px; margin-top: 18px;
  background: var(--pulse-svg) no-repeat left center / contain;
}
.gallery-kind { margin-top: 18px; font-weight: 600; color: var(--teal-text); }
.gallery-intro { margin-top: 14px; max-width: 58ch; font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-soft); }
.gallery-note {
  margin-top: 20px; max-width: 62ch; padding: 12px 16px;
  border: 1.5px solid var(--stone); border-radius: 3px; background: var(--paper);
  font-size: 15px; color: var(--ink-soft);
}

/* Justified rows: each photo grows by its own aspect ratio, so portraits and
   landscapes keep their shape and the reading order matches the visual order. */
.gallery { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: clamp(10px, 1.4vw, 18px); }
.gallery::after { content: ""; flex-grow: 1000; }
.shot { flex: var(--ar) 1 calc(var(--ar) * 340px); min-width: 0; }
.shot figure { margin: 0; }
.gallery--single::after { display: none; }
.gallery--single .shot { flex: 0 1 min(680px, 100%); }
.shot-link { display: block; position: relative; overflow: hidden; border-radius: 3px; background: var(--stone); cursor: zoom-in; }
.shot-link img { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; transition: transform .7s var(--ease-out), filter .4s; }
.shot-link:hover img { transform: scale(1.025); }
.shot-link:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.shot figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }

.gallery-cta {
  margin-top: clamp(64px, 9vw, 120px) !important; padding-bottom: clamp(72px, 9vw, 120px) !important;
}
.gallery-cta h2::before {
  content: ""; display: block; width: 56px; height: 20px; margin-bottom: 18px;
  background: var(--pulse-svg) no-repeat left center / contain;
}
.gallery-cta h2 { font-size: clamp(32px, 4.2vw, 54px); line-height: 1.02; letter-spacing: -.035em; max-width: 18ch; }
.gallery-cta > p { margin: 16px 0 28px; color: var(--ink-soft); font-size: 18px; max-width: 46ch; }
.gallery-more { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 48px; }
.gallery-more a {
  display: grid; gap: 2px; text-decoration: none; padding: 6px 0;
  font: 700 clamp(24px, 2.4vw, 32px)/1.1 var(--display); letter-spacing: -.02em;
  border-bottom: 2px solid var(--coral);
}
.gallery-more a span { font: 500 14px/1.4 var(--body); color: var(--ink-soft); letter-spacing: 0; }

/* Lightbox */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(20, 22, 21, .96); color: var(--cream);
}
.lightbox::backdrop { background: rgba(20, 22, 21, .96); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox-frame { display: grid; justify-items: center; gap: 12px; padding: 64px 72px 24px; max-width: 100%; max-height: 100%; }
.lightbox-img { max-width: calc(100vw - 144px); max-height: calc(100vh - 140px); width: auto; height: auto; object-fit: contain; border-radius: 2px; }
.lightbox-caption { font-size: 15px; color: var(--cream-soft); text-align: center; }
.lightbox-count { color: var(--coral); font-weight: 700; margin-right: 8px; font-variant-numeric: tabular-nums; }
.lightbox-btn {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px;
  border: 1.5px solid rgba(245, 241, 233, .4); border-radius: 50%; background: rgba(32, 35, 33, .7); color: var(--cream);
  cursor: pointer; transition: background-color .2s, border-color .2s;
}
.lightbox-btn:hover { background: var(--coral); border-color: var(--coral); color: var(--ink); }
.lightbox-btn:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.lightbox-btn .icon { width: 22px; height: 22px; }
.lightbox-close { top: 14px; right: 14px; }
.lightbox-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 14px; top: 50%; transform: translateY(-50%); }
body.lightbox-open { overflow: hidden; }

@media (max-width: 640px) {
  .shot { flex-basis: 100%; }
  .lightbox-frame { padding: 64px 12px 84px; }
  .lightbox-img { max-width: calc(100vw - 24px); max-height: calc(100vh - 170px); }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 18px; transform: none; }
  .lightbox-prev { left: calc(50% - 60px); }
  .lightbox-next { right: calc(50% - 60px); }
}
