/* Project pages (gallery_*.html): intro, photo grid, lightbox, enquiry block, previous / next project.
   Loaded after pages.css (header, footer, buttons, colours). Logic in js/gallery.js. */

/* ── Intro ──────────────────────────────────────────────────────────────────── */
.project-intro { text-align: center; padding-top: clamp(36px, 6vw, 72px); padding-bottom: clamp(28px, 4vw, 44px); }
.project-intro .eyebrow { color: var(--gold); font-weight: 600; }
.project-intro h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: .6rem 0 1rem; overflow-wrap: anywhere; }
.project-intro .lead { max-width: 680px; margin: 0 auto; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.1rem); line-height: 1.75; }

/* ── Photos: justified rows — every photo whole (no cropping), all photos in a row the same height and every row
      edge to edge. Each <li> carries its photo's shape as --r (width / height); the last row is centred. ──────── */
.shots { --row-h: 380px; --gap: 14px; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }
.shots li { --r: 1; flex: var(--r) 1 calc(var(--r) * var(--row-h)); max-width: calc(var(--r) * var(--row-h) * 1.6); margin: 0; }
/* js/gallery.js knows the last row: every other row fills edge to edge; a short last row keeps the row height, centred */
.shots.is-justified li { max-width: none; }
.shots.is-justified.last-short li.last { flex-grow: 0; }
.shot { display: block; position: relative; overflow: hidden; background: #E9E4DC; cursor: zoom-in; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: var(--r); object-fit: cover; transition: transform .7s var(--ease); }
.shot:hover img { transform: scale(1.025); }
.shot:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ── Lightbox (<dialog>, built by gallery.js) ───────────────────────────────── */
html.lb-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #141312; color: #fff; overflow: hidden;
}
.lightbox[open] { animation: lb-in .25s var(--ease); }
@keyframes lb-in { from { opacity: 0; } }
.lightbox::backdrop { background: #141312; }
.lb-stage { position: absolute; inset: 64px 84px 64px; margin: 0; display: flex; align-items: center; justify-content: center; }
.lb-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-select: none; }
.lb-img:not([src]) { visibility: hidden; }
.lb-btn {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.lb-btn:hover, .lb-btn:active { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .5); }
.lb-btn, .shot { -webkit-tap-highlight-color: transparent; }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.lb-close { top: 10px; right: 12px; }
.lb-prev, .lb-next { top: 50%; margin-top: -24px; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-counter {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); margin: 0;
  font-size: .82rem; font-weight: 500; letter-spacing: .12em; color: rgba(255, 255, 255, .85); white-space: nowrap;
}

/* ── Enquiry ────────────────────────────────────────────────────────────────── */
.enquiry {
  margin-top: clamp(48px, 7vw, 88px); padding: clamp(44px, 7vw, 84px) 0; text-align: center;
  background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.enquiry h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); margin-bottom: .8rem; }
.enquiry p { max-width: 520px; margin: 0 auto 1.8rem; color: var(--muted); line-height: 1.7; }
.enquiry .alt-link {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: .9rem; padding: 0 4px; font-size: .92rem;
  text-decoration: underline; text-decoration-color: var(--gold-light); text-underline-offset: 4px;
}
.enquiry .alt-link:hover { color: var(--gold); }

/* ── Previous / next project ────────────────────────────────────────────────── */
.project-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: clamp(28px, 5vw, 48px); padding-bottom: clamp(40px, 6vw, 72px); }
.pn {
  display: flex; flex-direction: column; justify-content: center; gap: .3rem; min-height: 92px; padding: 16px 20px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .5); text-decoration: none;
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.pn:hover { border-color: var(--ink); background: var(--surface); }
.pn-next { align-items: flex-end; text-align: right; }
.pn-label { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pn-name { font-family: "Playfair Display", Georgia, serif; font-size: clamp(1.02rem, 2vw, 1.35rem); line-height: 1.25; }

/* ── Tablet ─────────────────────────────────────────────────────────────────── */
@media (max-width: 1199.98px) {
  .shots { --row-h: 320px; }
}
@media (max-width: 991.98px) {
  .shots { --row-h: 250px; --gap: 12px; }
}

/* ── Phone ──────────────────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  .project-intro { text-align: left; padding-top: 28px; }
  .project-intro .lead { line-height: 1.7; }
  .shots { display: block; }   /* phones: one photo per row, full width */
  .shots li { max-width: none; margin: 0 0 10px; }
  .project-nav { gap: 8px; }
  .pn { padding: 14px; min-height: 84px; }
  .pn-label { font-size: .66rem; letter-spacing: .1em; }
}
@media (max-width: 767.98px) {
  .lb-stage { inset: 60px 0 80px; }
  .lb-close { top: 6px; right: 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; margin-top: 0; }
  .lb-prev { left: 12px; }
  .lb-next { right: 12px; }
  .lb-counter { bottom: 28px; }
}
@media (hover: none) {
  .shot:hover img { transform: none; }
}
