/* Photography — Quiet Sequence
   Image-first editorial pacing. Visible titles are intentionally omitted until the edit is named. */

:root {
  --photo-rail: clamp(12.5rem, 23vw, 21rem);
  --photo-gap: clamp(2rem, 5vw, 6rem);
  --photo-ease: cubic-bezier(.22, 1, .36, 1);
}

html {
  scroll-behavior: smooth;
  background: var(--paper-warm);
}

body.photo-sequence-page {
  margin: 0;
  overflow-x: clip;
  background: var(--paper-warm);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.photo-sequence-page ::selection {
  background: color-mix(in srgb, var(--clay) 28%, transparent);
  color: var(--ink);
}

.photo-shell {
  display: grid;
  grid-template-columns: var(--photo-rail) minmax(0, 1fr);
  gap: var(--photo-gap);
  width: min(100% - clamp(2rem, 8vw, 8.75rem), 100rem);
  margin: 0 auto;
}

.photo-rail {
  position: sticky;
  top: var(--cs-nav-height);
  height: calc(100vh - var(--cs-nav-height));
  padding: clamp(3rem, 8vh, 6.5rem) 0 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.photo-rail h1 {
  max-width: 7ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.25rem, 6vw, 6rem);
  font-weight: 300;
  line-height: .9;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.photo-intro {
  max-width: 29ch;
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  font-size: .8125rem;
  line-height: 1.6;
}

.photo-rail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: .625rem;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.photo-rail-foot span:last-child {
  color: var(--ink);
}

.photo-sequence {
  min-width: 0;
  padding: clamp(2rem, 7vh, 5rem) 0 18vh;
}

.photo-spread {
  min-height: 82vh;
  padding: clamp(2rem, 6vh, 4.75rem) 0;
  display: grid;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  border-bottom: 1px solid var(--rule);
}

.photo-spread--one { grid-template-columns: 1fr; }
.photo-spread--pair { grid-template-columns: 1.22fr .78fr; }
.photo-spread--reverse { grid-template-columns: .76fr 1.24fr; }
.photo-spread--triptych { grid-template-columns: 1fr .72fr .72fr; }

.photo-figure {
  min-width: 0;
  margin: 0;
}

.photo-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.photo-frame {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper) 76%, var(--ink));
}

.photo-button img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 76vh;
  object-fit: cover;
  filter: saturate(.94);
  transition: transform 700ms var(--photo-ease), filter 250ms ease-out;
}

.photo-button:hover img,
.photo-button:focus-visible img {
  transform: scale(1.012);
  filter: saturate(1.02);
}

.photo-button:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: .35rem;
}

.photo-spread--one .photo-figure {
  width: min(100%, 68rem);
}

.photo-spread--one:nth-child(4n + 1) .photo-figure {
  width: min(79%, 56rem);
  justify-self: end;
}

.photo-spread--one:nth-child(4n + 3) .photo-figure {
  width: min(73%, 51rem);
  justify-self: start;
}

.photo-spread--pair .photo-figure:last-child,
.photo-spread--reverse .photo-figure:first-child {
  align-self: end;
  margin-bottom: 8vh;
}

.photo-spread--triptych .photo-figure:nth-child(2) {
  align-self: start;
  margin-top: 10vh;
}

.photo-spread--triptych .photo-figure:nth-child(3) {
  align-self: end;
  margin-bottom: 7vh;
}

.photo-reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .js .photo-reveal {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity 550ms ease-out, transform 700ms var(--photo-ease);
  }

  .js .photo-reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

.photo-viewer {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #11110f;
  color: #f6f2e9;
}

.photo-viewer::backdrop { background: #11110f; }

.photo-viewer-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3.5rem);
}

.photo-viewer img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 7rem);
  object-fit: contain;
}

.photo-viewer-close,
.photo-viewer-step {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(17, 17, 15, .76);
  color: inherit;
  font: inherit;
  cursor: pointer;
  backdrop-filter: blur(.5rem);
  transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}

.photo-viewer-close:hover,
.photo-viewer-close:focus-visible,
.photo-viewer-step:hover,
.photo-viewer-step:focus-visible {
  border-color: #f6f2e9;
  background: #f6f2e9;
  color: #11110f;
  outline: 0;
}

.photo-viewer-close {
  position: absolute;
  z-index: 2;
  top: clamp(1rem, 3vw, 2.25rem);
  right: clamp(1rem, 3vw, 2.25rem);
  padding: 0 1rem;
}

.photo-viewer-controls {
  position: absolute;
  z-index: 2;
  right: clamp(1rem, 3vw, 2.25rem);
  bottom: clamp(1rem, 3vw, 2.25rem);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.photo-viewer-count {
  margin-right: .5rem;
  color: rgba(255, 255, 255, .64);
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}

.photo-viewer-step {
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 1.125rem;
}

@media (max-width: 47.5rem) {
  .photo-shell {
    display: block;
    width: calc(100% - 2rem);
  }

  .photo-rail {
    position: relative;
    top: auto;
    height: auto;
    padding: 3rem 0 3.75rem;
  }

  .photo-rail h1 { font-size: clamp(3rem, 15vw, 4.5rem); }
  .photo-rail-foot { margin-top: 3rem; }
  .photo-sequence { padding-top: 0; }

  .photo-spread,
  .photo-spread--one,
  .photo-spread--pair,
  .photo-spread--reverse,
  .photo-spread--triptych {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 2.125rem 0;
  }

  .photo-spread--one .photo-figure,
  .photo-spread--one:nth-child(n) .photo-figure {
    width: 100%;
  }

  .photo-spread--pair .photo-figure:last-child,
  .photo-spread--reverse .photo-figure:first-child,
  .photo-spread--triptych .photo-figure:nth-child(n) {
    align-self: auto;
    margin: 0;
  }

  .photo-spread .photo-figure + .photo-figure { margin-top: 1.75rem; }
  .photo-button img { max-height: none; }

  .photo-viewer-inner { padding: 1rem; }
  .photo-viewer img { max-height: calc(100vh - 9rem); }
  .photo-viewer-controls { left: 1rem; right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .photo-button img,
  .photo-viewer-close,
  .photo-viewer-step { transition-duration: .01ms !important; }
}

@media print {
  .photo-shell { display: block; width: 100%; }
  .photo-rail { position: static; height: auto; }
  .photo-spread { min-height: auto; break-inside: avoid; }
}
