/* =========================================================
   TALES BY TWO — EDITORIAL PHOTOGRAPHY GALLERY
   Reusable layout + motion system (photographs page only)
   ========================================================= */

.photoPage {
  background: var(--ink);
  color: #f6f2e9;
}

.photoPage header {
  mix-blend-mode: difference;
}

/* ── Gallery shell ── */

.photoGallery {
  position: relative;
  overflow-x: hidden;
}

.photoGallery__track {
  display: flex;
  flex-direction: column;
}

/* ── Intro ── */

.photoIntro {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 7vw 12vh;
  position: relative;
  background: var(--ink);
  animation: photoIntroIn 1.35s var(--ease-lux) both;
}

@keyframes photoIntroIn {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.photoIntro small {
  color: var(--gold);
  letter-spacing: 0.22em;
  font-size: 9px;
  display: block;
  margin-bottom: 28px;
}

.photoIntro h1 {
  font: clamp(52px, 8.5vw, 130px) / 0.86 var(--serif);
  letter-spacing: -0.045em;
  margin: 0 0 32px;
  max-width: 14ch;
}

.photoIntro h1 em {
  font-style: italic;
  color: var(--gold);
}

.photoIntro p {
  max-width: 420px;
  line-height: 1.75;
  color: #bbb;
  margin: 0 0 48px;
  font-size: 14px;
}

.photoIntro__scroll {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--gold);
  opacity: 0.7;
}

.photoIntro__scroll i {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(var(--gold), transparent);
  animation: photoScrollPulse 2.4s var(--ease-soft) infinite;
}

@keyframes photoScrollPulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ── Frame base (reveal target) ── */

.photoFrame {
  position: relative;
  opacity: 0;
  transform: translate3d(0, 48px, 0) scale(0.985);
  transition:
    opacity 1.15s var(--ease-lux),
    transform 1.15s var(--ease-lux);
  will-change: opacity, transform;
}

.photoFrame.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.photoFrame figcaption {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-top: 18px;
  text-transform: uppercase;
}

/* ── Reusable image component ── */

.photoImage {
  position: relative;
  overflow: hidden;
  background: #1a1916;
  cursor: pointer;
}

.photoImage__placeholder {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(24px);
  transform: scale(1.08);
  transition: opacity 0.8s var(--ease-lux);
  will-change: opacity;
}

.photoImage__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 1s var(--ease-lux),
    transform 1.4s var(--ease-lux);
  will-change: opacity, transform;
}

.photoImage.is-loaded .photoImage__img {
  opacity: 1;
  transform: scale(1);
}

.photoImage.is-loaded .photoImage__placeholder {
  opacity: 0;
}

/* ── Layout: Full viewport ── */

.photoFrame--full {
  width: 100%;
  height: 100svh;
  min-height: 560px;
}

.photoFrame--full .photoImage {
  width: 100%;
  height: 100%;
}

.photoFrame--full figcaption {
  position: absolute;
  left: 7vw;
  bottom: 6vh;
  z-index: 2;
  margin: 0;
  color: #f6f2e9;
  text-shadow: 0 2px 24px #0008;
}

.photoFrame--full::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 35%;
  background: linear-gradient(transparent, #090a08aa);
  pointer-events: none;
  z-index: 1;
}

/* ── Layout: Portrait ── */

.photoFrame--portrait {
  padding: 14vh 7vw;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.photoFrame--portrait .photoImage {
  width: min(42vw, 520px);
  aspect-ratio: 3 / 4;
}

.photoFrame--portrait-right {
  align-items: flex-end;
}

.photoFrame--portrait-right figcaption {
  text-align: right;
}

/* ── Layout: Landscape ── */

.photoFrame--landscape {
  padding: 10vh 7vw;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photoFrame--landscape .photoImage {
  width: min(88vw, 1400px);
  aspect-ratio: 16 / 10;
}

.photoFrame--landscape-offset {
  align-items: flex-end;
  padding-right: 12vw;
}

/* ── Layout: Diptych ── */

.photoFrame--diptych {
  padding: 8vh 7vw;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 2vw, 28px);
  align-items: end;
}

.photoFrame--diptych .photoImage:first-child {
  aspect-ratio: 4 / 5;
  margin-top: 8vh;
}

.photoFrame--diptych .photoImage:last-child {
  aspect-ratio: 3 / 4;
}

.photoFrame--diptych figcaption {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 24px;
}

/* ── Layout: Detail crop ── */

.photoFrame--detail {
  padding: 12vh 7vw;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photoFrame--detail .photoImage {
  width: min(32vw, 380px);
  aspect-ratio: 1 / 1;
}

.photoFrame--detail-left {
  align-items: flex-start;
  padding-left: 14vw;
}

.photoFrame--detail-right {
  align-items: flex-end;
  padding-right: 14vw;
}

/* ── Layout: Whitespace ── */

.photoFrame--whitespace {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16vh 7vw;
}

.photoFrame--whitespace blockquote {
  font: clamp(36px, 5vw, 72px) / 1.05 var(--serif);
  margin: 0;
  max-width: 16ch;
  letter-spacing: -0.02em;
}

.photoFrame--whitespace blockquote em {
  font-style: italic;
  color: var(--gold);
}

.photoFrame--whitespace cite {
  display: block;
  margin-top: 32px;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #888;
  font-style: normal;
}

.photoFrame--whitespace-center {
  align-items: center;
  text-align: center;
}

.photoFrame--whitespace-center blockquote {
  max-width: 22ch;
}

/* ── Tone alternation ── */

.photoFrame--light {
  background: var(--ivory);
  color: #151512;
}

.photoFrame--light figcaption {
  color: #8e6d26;
}

.photoFrame--light .photoFrame--whitespace cite,
.photoFrame--light cite {
  color: #666;
}

/* ── Closing CTA ── */

.photoOutro {
  padding: 18vh 7vw 22vh;
  text-align: center;
  background: var(--ink);
  border-top: 1px solid #ffffff12;
}

.photoOutro small {
  color: var(--gold);
  letter-spacing: 0.22em;
  font-size: 9px;
}

.photoOutro h2 {
  font: clamp(42px, 5.5vw, 82px) / 0.92 var(--serif);
  margin: 28px 0 36px;
}

.photoOutro h2 em {
  font-style: italic;
  color: var(--gold);
}

.photoOutro a {
  display: inline-block;
  padding: 14px 32px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.18em;
  transition: background 0.4s var(--ease-lux), color 0.4s var(--ease-lux);
}

.photoOutro a:hover {
  background: var(--gold);
  color: var(--ink);
}

/* ── Progress thread (photography page) ── */

.photoPage .scrollProgress {
  position: fixed;
  z-index: 910;
  left: 0;
  top: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  pointer-events: none;
}

/* =========================================================
   MOBILE LAYOUTS
   ========================================================= */

@media (max-width: 760px) {
  .photoIntro {
    padding: 0 24px 10vh;
    min-height: 92svh;
  }

  .photoIntro h1 {
    max-width: none;
  }

  .photoFrame--full {
    min-height: 72svh;
  }

  .photoFrame--full figcaption {
    left: 24px;
    bottom: 5vh;
  }

  .photoFrame--portrait,
  .photoFrame--portrait-right {
    padding: 10vh 24px;
    align-items: stretch;
  }

  .photoFrame--portrait .photoImage,
  .photoFrame--portrait-right .photoImage {
    width: 100%;
    aspect-ratio: 4 / 5;
  }

  .photoFrame--portrait-right figcaption {
    text-align: left;
  }

  .photoFrame--landscape,
  .photoFrame--landscape-offset {
    padding: 8vh 24px;
    align-items: stretch;
  }

  .photoFrame--landscape .photoImage,
  .photoFrame--landscape-offset .photoImage {
    width: 100%;
    aspect-ratio: 4 / 3;
  }

  .photoFrame--diptych {
    grid-template-columns: 1fr;
    padding: 8vh 24px;
    gap: 20px;
  }

  .photoFrame--diptych .photoImage:first-child {
    margin-top: 0;
    aspect-ratio: 3 / 4;
  }

  .photoFrame--diptych .photoImage:last-child {
    aspect-ratio: 16 / 11;
  }

  .photoFrame--detail,
  .photoFrame--detail-left,
  .photoFrame--detail-right {
    padding: 10vh 24px;
    align-items: stretch;
  }

  .photoFrame--detail .photoImage,
  .photoFrame--detail-left .photoImage,
  .photoFrame--detail-right .photoImage {
    width: 78%;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
  }

  .photoFrame--whitespace {
    min-height: 45vh;
    padding: 12vh 24px;
  }

  .photoFrame--whitespace blockquote {
    max-width: none;
  }

  .photoOutro {
    padding: 14vh 24px 18vh;
  }

  /* Tighter reveal motion on small screens */
  .photoFrame {
    transform: translate3d(0, 32px, 0) scale(0.99);
  }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  .photoIntro {
    animation: none;
  }

  .photoFrame,
  .photoImage__img,
  .photoImage__placeholder {
    transition-duration: 0.01ms !important;
    transform: none !important;
  }

  .photoFrame {
    opacity: 1;
  }

  .photoIntro__scroll i {
    animation: none;
  }
}
