/* ============================================================
   PROJECT PAGES (projects/<slug>/) — one delivered job, told in
   the order it was built. Only what the shared sheets lack: the
   finished-work grid, chapters, before / after and the process row.
   Every photo sits in a box with a fixed aspect ratio, so nothing
   shifts while images load (the site sizes images in CSS, not with
   width / height attributes — see Img.astro).
   ============================================================ */

.pj-shot {
  position: relative;
  overflow: hidden;
  background: var(--stone-deep);
}
.on-navy .pj-shot { background: var(--navy-soft); }
.pj-shot img { width: 100%; height: 100%; object-fit: cover; }

/* The finished work: a 12-column grid. Rows are wide + tall,
   three std or two half — pairs that share one height. */
.pj-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: calc(var(--u) * 18);
}
.pj-shot--wide { grid-column: span 8; aspect-ratio: 3 / 2; }
.pj-shot--tall { grid-column: span 4; }   /* takes the height of its row's wide shot */
.pj-shot--tall img { position: absolute; inset: 0; }
.pj-shot--std  { grid-column: span 4; aspect-ratio: 4 / 3; }
.pj-shot--half { grid-column: span 6; aspect-ratio: 4 / 3; }

/* A second full-bleed plate between the finished work and the story; it
   does not sit under the nav, so it drops the plate's top shade. */
.pj-pause::after { display: none; }

.pj-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Chapters */
.pj-story-head { display: grid; gap: calc(var(--u) * 18); }
.pj-story-head .lead { max-width: 52ch; }

.pj-chapter__head {
  display: grid;
  grid-template-columns: calc(var(--u) * 150) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 70px);
  align-items: start;
  padding-top: calc(var(--u) * 42);
  border-top: 1px solid var(--hairline);
}
.pj-chapter__n {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: calc(var(--u) * 120);
  line-height: .8;
  letter-spacing: -0.03em;
  color: var(--lake);
}
.on-navy .pj-chapter__n { color: var(--lake-light); }
.pj-chapter h2 { text-wrap: balance; }
.pj-chapter .prose p { color: var(--body); }
.on-navy.pj-chapter .prose p { color: var(--sand); }

.pj-shot--chapter { aspect-ratio: 21 / 9; }

.pj-ba {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--u) * 18);
}
.pj-shot--ba { aspect-ratio: 4 / 3; }
.pj-tag {
  position: absolute;
  top: calc(var(--u) * 18); left: calc(var(--u) * 18);
  padding: calc(var(--u) * 7) calc(var(--u) * 14);
  font-size: max(11px, calc(var(--u) * 10));
  font-weight: 600; letter-spacing: .19em; text-transform: uppercase;
  line-height: 1.4;
  color: var(--sand);
  background: rgba(7, 20, 39, .78);
}
.pj-tag--after { color: var(--navy); background: var(--sand); }

/* The work in progress, in order, each with a line on what it shows. */
.pj-process {
  list-style: none; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(var(--u) * 18);
}
.pj-process--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pj-process figure { display: grid; gap: calc(var(--u) * 14); }
.pj-shot--proc { aspect-ratio: 4 / 3; }
.pj-process figcaption { max-width: 40ch; color: var(--body); }
.on-navy .pj-process figcaption { color: var(--sand); }

/* Scope: the service pages' + list, in one column. */
.scope.pj-scope { grid-template-columns: 1fr; }
.on-navy .pj-scope li { color: var(--sand); }

.pj-more { grid-template-columns: repeat(2, 1fr); }
/* "All projects" ends flush with the cards' right edge; left-aligned once .spread stacks. */
.pj-more__all { justify-self: end; }

.pj-meta-link { border-bottom: 1px solid currentColor; }
.pj-meta-link:hover { color: var(--lake); }
.on-navy .pj-meta-link:hover { color: var(--lake-light); }
.pj-meta-link:focus-visible { outline: 2px solid var(--lake); outline-offset: 3px; }
.on-navy .pj-meta-link:focus-visible { outline-color: var(--lake-light); }

@media (max-width: 860px) {
  .pj-more__all { justify-self: start; }
  .pj-chapter__head { grid-template-columns: 1fr; gap: calc(var(--u) * 18); }
  .pj-chapter__n { font-size: calc(var(--u) * 84); }
  .pj-shot--chapter { aspect-ratio: 4 / 3; }
  .pj-process, .pj-process--2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .pj-gallery { grid-template-columns: 1fr; }
  .pj-shot--wide, .pj-shot--tall, .pj-shot--std, .pj-shot--half { grid-column: auto; }
  .pj-shot--tall { aspect-ratio: 4 / 5; }
  .pj-ba, .pj-process, .pj-process--2, .pj-more { grid-template-columns: 1fr; }
}
