/* ============================================================
   project-animations.css
   Add after portfolio.css on every project page.
   ============================================================ */

@font-face {
  font-family: 'Moulin Light';
  src: url('fonts/Moulin-Light-Trial.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ── Project-to-project navigation — follows the carousel order ────
   Rule runs full-bleed; the links sit on the page grid. */
.project-nav {
  margin-top: var(--sp-2xl);
  border-top: 1px solid var(--c-border);
}

.project-nav__inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--sp-lg) 4vw 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-md);
}

/* Arrow sits on the same line as the title */
.project-nav__link {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--c-text);
  cursor: none;
  max-width: 45%;
  transition: transform 0.5s var(--ease-expo);
}

.project-nav__link--next {
  text-align: right;
}

.project-nav__arrow,
.project-nav__title {
  font-family: var(--ff-medium);
  font-size: var(--text-h3);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.project-nav__arrow {
  flex-shrink: 0;
}

.project-nav__link--prev:hover { transform: translateX(-8px); }
.project-nav__link--next:hover { transform: translateX(8px); }

.project-nav__link:focus-visible {
  outline: 1px solid var(--c-text);
  outline-offset: 6px;
}

@media (max-width: 600px) {
  .project-nav__inner { padding: var(--sp-md) var(--sp-md) 0; }
  .project-nav__title { font-size: var(--text-h4); }
  .project-nav__link  { max-width: 48%; }
}

.project-footer {
  padding: 6rem 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-footer .footer-copy {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.4);
  margin-left: auto;
}

/* ── Hero image
   portfolio.css sets `transform: scale(0.92)` and a CSS transition
   on .detail-hero img. GSAP takes over scale entirely, so we
   override the CSS starting transform to prevent a double-animation
   flash (CSS scale(0.92) + GSAP scale(1.08) stacking on first frame).
────────────────────────────────────────────────────────────── */
.detail-hero img {
  transform: none;       /* GSAP sets scale(1.08) immediately via gsap.set() */
  transition: none;      /* GSAP owns all transforms on this element */
}

/* ── Malmo Grid Refinement ────────────────────────────────── */
.grid-container {
  padding-top: 140px;
}

.detail-meta {
  grid-column: 2 / 5;
  grid-row: 2;
  margin-top: var(--sp-md);
}

.detail-intro {
  grid-column: 6 / 12;
  grid-row: 2;
  margin-top: var(--sp-md);
}

.detail-meta p,
.intro-desc {
  line-height: 1.6;
  margin: 0;
}

.intro-desc {
  max-width: 100%;
  margin-left: 0;
}

.detail-hero {
  grid-column: 2 / 12;
  grid-row: 1;
  padding: 0;
  padding-top: 0;
  margin-bottom: var(--sp-lg);
}

/* ── Responsive gallery wrappers
────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .detail-meta,
  .detail-intro,
  .detail-hero {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .detail-hero {
    margin-top: var(--sp-md);
    margin-bottom: var(--sp-md);   /* 4rem hero gap + grid gap + meta
                                      margin stacked to ~128px on phones */
  }

  .detail-meta {
    margin-top: 0;
  }

  /* 140px is desktop navbar clearance; on mobile the masthead text ends
     ~2.2rem down (plus the notch inset), so reclaim the rest */
  .grid-container {
    padding-top: calc(4rem + env(safe-area-inset-top, 0px));
  }
}

/* ════════════════════════════════════════════════════════════
   EDITORIAL GALLERY — asymmetric, flowing layout
   Replaces the rigid .gallery-grid. Images keep their natural
   aspect ratio; rhythm comes from placement, scale and air.
──────────────────────────────────────────────────────────────── */
.editorial-gallery {
  max-width: 1600px;
  margin: clamp(2rem, 5vw, 5rem) auto 0;
  padding: 0 4vw;
}

.ed-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--sp-md);
  align-items: end;
  margin: 0;
}

.ed-row + .ed-row {
  margin-top: clamp(4.5rem, 10vw, 10rem);
}

.ed-media {
  position: relative;
  overflow: hidden;
}

.ed-media img {
  display: block;
  width: 100%;
  height: auto;
}

/* Under-image caption (comparison pairs) */
.ed-cap {
  margin-top: var(--sp-sm);
  font-size: var(--text-small);
  letter-spacing: -0.01em;
  color: var(--c-text-muted);
}

/* Margin note (figure number + a line of context) */
.ed-note {
  font-size: var(--text-small);
  line-height: 1.5;
  color: var(--c-text-muted);
  max-width: 28ch;
  padding-bottom: 0.35rem;
}

.ed-num {
  display: block;
  margin-bottom: var(--sp-xs);
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-text-faint);
  font-variant-numeric: tabular-nums;
}

/* — Placements (DOM order is always: media, then note) — */
.ed-align-left  .ed-media { grid-column: 1 / 9;   grid-row: 1; }
.ed-align-left  .ed-note  { grid-column: 10 / 13; grid-row: 1; }

.ed-align-right .ed-media { grid-column: 5 / 13;  grid-row: 1; }
.ed-align-right .ed-note  { grid-column: 1 / 4;   grid-row: 1; }

.ed-align-wide  .ed-media { grid-column: 1 / -1;  grid-row: 1; }
.ed-align-wide  .ed-note  { grid-column: 1 / 6;   grid-row: 2; margin-top: var(--sp-sm); }

/* Opening spread — main render (left) + aside holding a sketch + process note */
.ed-intro-row { align-items: start; }
.ed-intro-row .ed-media--main { grid-column: 1 / 7; grid-row: 1; }
.ed-intro-row .ed-aside {
  grid-column: 8 / 13;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

/* Lead note — body size, medium weight, full-strength text (reads like the intro copy) */
.ed-lead {
  font-family: var(--ff-medium);
  font-weight: 500;
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--c-text);
  max-width: none;
}

/* Text-beside-image spread — text left, image right */
.ed-spread { align-items: start; }
.ed-spread .ed-media { grid-column: 6 / 13; grid-row: 1; }
.ed-spread .ed-note  { grid-column: 1 / 5;  grid-row: 1; }

/* — Comparison pair — */
.ed-pair { align-items: start; }
.ed-pair .ed-col:nth-child(1) { grid-column: 1 / 7;  grid-row: 1; }
.ed-pair .ed-col:nth-child(2) { grid-column: 7 / 13; grid-row: 1; }
.ed-pair + .ed-pair { margin-top: var(--sp-md); }   /* tight 2x2 block */

/* — Four-up row: family typologies side by side — */
.ed-quad { align-items: start; column-gap: var(--sp-md); row-gap: var(--sp-md); }
.ed-quad .ed-col:nth-child(1) { grid-column: 1 / 4;   grid-row: 1; }
.ed-quad .ed-col:nth-child(2) { grid-column: 4 / 7;   grid-row: 1; }
.ed-quad .ed-col:nth-child(3) { grid-column: 7 / 10;  grid-row: 1; }
.ed-quad .ed-col:nth-child(4) { grid-column: 10 / 13; grid-row: 1; }

/* One per row on narrow screens — matches how .ed-pair and .ed-trio
   stack, and gives each typology the full width */
@media (max-width: 900px) {
  .ed-quad { row-gap: clamp(2rem, 8vw, 3rem); }
  .ed-quad .ed-col:nth-child(1),
  .ed-quad .ed-col:nth-child(2),
  .ed-quad .ed-col:nth-child(3),
  .ed-quad .ed-col:nth-child(4) { grid-column: 1 / -1; grid-row: auto; }
}

/* — Section divider label — */
.ed-label-row { align-items: center; }
.ed-section-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(26, 26, 26, 0.72);
}
.ed-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

@media (max-width: 900px) {
  .ed-row { grid-template-columns: 1fr; }
  .ed-row + .ed-row { margin-top: clamp(3rem, 12vw, 5rem); }

  .ed-align-left  .ed-media, .ed-align-left  .ed-note,
  .ed-align-right .ed-media, .ed-align-right .ed-note,
  .ed-align-wide  .ed-media, .ed-align-wide  .ed-note,
  .ed-spread .ed-media, .ed-spread .ed-note,
  .ed-intro-row .ed-media--main, .ed-intro-row .ed-aside {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .ed-intro-row .ed-aside { margin-top: clamp(2rem, 8vw, 3rem); }

  .ed-note { margin-top: var(--sp-sm); max-width: none; }

  .ed-pair .ed-col:nth-child(1),
  .ed-pair .ed-col:nth-child(2) { grid-column: 1 / -1; grid-row: auto; }
  .ed-pair .ed-col + .ed-col { margin-top: clamp(2rem, 8vw, 3rem); }
}

/* ── Step Into the Lens — centered statement + moodboard collage ───────── */
.ed-statement p {
  grid-column: 3 / 11;
  margin: 0 auto;
  max-width: 60ch;
  text-align: center;
  font-family: var(--ff-medium);
  font-weight: 500;
  font-size: var(--text-lede);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--c-text);
}

.ed-moodboard { align-items: start; }
.ed-moodboard .ed-collage { grid-column: 1 / 9;  grid-row: 1; }
.ed-moodboard .ed-note    { grid-column: 9 / 13; grid-row: 1; align-self: end; }

.ed-collage {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-xs);
}
.ed-collage .ed-media { aspect-ratio: 1; }
.ed-collage .ed-media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) {
  .ed-statement p { grid-column: 1 / -1; }
  .ed-moodboard .ed-collage,
  .ed-moodboard .ed-note { grid-column: 1 / -1; grid-row: auto; }
  .ed-moodboard .ed-note { margin-top: var(--sp-md); }
  .ed-collage { grid-template-columns: repeat(2, 1fr); }
}

/* ── Leica Initial Concepts — smaller sketch w/ centred text, offset render pair */
.ed-concept .ed-media { grid-column: 7 / 13; }   /* sketch slightly smaller */
.ed-concept .ed-note  { align-self: center; }     /* text on the sketch's centre line */

.ed-offset .ed-col:nth-child(1) { grid-column: 1 / 6; }                                   /* initial1 smaller */
.ed-offset .ed-col:nth-child(2) { grid-column: 6 / 13; margin-top: clamp(3rem, 8vw, 8rem); } /* initial2 bigger + lower */

@media (max-width: 900px) {
  .ed-concept .ed-media { grid-column: 1 / -1; }
  .ed-offset .ed-col:nth-child(1) { grid-column: 1 / -1; }
  .ed-offset .ed-col:nth-child(2) { grid-column: 1 / -1; margin-top: clamp(2rem, 8vw, 3rem); }
}

/* ── SPIK — editorial rows ─────────────────────────────────────────── */

/* Three sketches on one line — a shared crop ratio makes all three
   align flush at both top and bottom despite differing source sizes */
.ed-trio { align-items: start; column-gap: var(--sp-md); }
.ed-trio .ed-col:nth-child(1) { grid-column: 1 / 5;  grid-row: 1; }
.ed-trio .ed-col:nth-child(2) { grid-column: 5 / 9;  grid-row: 1; }
.ed-trio .ed-col:nth-child(3) { grid-column: 9 / 13; grid-row: 1; }
.ed-trio .ed-media { aspect-ratio: 10 / 7; }
.ed-trio .ed-media img { width: 100%; height: 100%; object-fit: cover; }

/* Lighting-simulation 2x2 — lock every cell to 3:2 (the drone shots'
   native ratio) so both rows align; the other two crop vertically */
.spik-sim { row-gap: var(--sp-md); }
.spik-sim .ed-col:nth-child(1) { grid-column: 1 / 7;  grid-row: 1; }
.spik-sim .ed-col:nth-child(2) { grid-column: 7 / 13; grid-row: 1; }
.spik-sim .ed-col:nth-child(3) { grid-column: 1 / 7;  grid-row: 2; }
.spik-sim .ed-col:nth-child(4) { grid-column: 7 / 13; grid-row: 2; }
.spik-sim .ed-media { aspect-ratio: 3 / 2; }
.spik-sim .ed-media img { width: 100%; height: 100%; object-fit: cover; }

/* 3D exploration field — large but contained, note centred to its right */
.spik-3dfield .ed-media { grid-column: 1 / 9;   grid-row: 1; }
.spik-3dfield .ed-note  { grid-column: 10 / 13; grid-row: 1; align-self: center; }

/* Form lineups — wide panorama + small study, the study lifted a touch
   off the shared baseline for a livelier composition */
.spik-3dforms { align-items: end; }
.spik-3dforms .ed-col:nth-child(1) { grid-column: 1 / 8;   grid-row: 1; }
.spik-3dforms .ed-col:nth-child(2) { grid-column: 9 / 13; grid-row: 1; margin-bottom: clamp(0.75rem, 2vw, 1.5rem); }

/* A lead note on its own row — introduces the section's imagery */
.ed-note-row .ed-note { grid-column: 1 / 7; }

/* SPIK product description — text centred beside the tall exploded view */
.spik-product .ed-media { grid-column: 7 / 12; grid-row: 1; }
.spik-product .ed-note  { grid-column: 1 / 6;  grid-row: 1; align-self: center; }

/* SPIK exhibition — tall photo centred under its section label */
.spik-exhibit .ed-media { grid-column: 4 / 10; grid-row: 1; }

@media (max-width: 900px) {
  .ed-trio .ed-col:nth-child(1),
  .ed-trio .ed-col:nth-child(2),
  .ed-trio .ed-col:nth-child(3) { grid-column: 1 / -1; grid-row: auto; margin-top: 0; }
  .ed-trio .ed-col + .ed-col { margin-top: clamp(2rem, 8vw, 3rem); }

  .ed-note-row .ed-note,
  .spik-3dfield .ed-media, .spik-3dfield .ed-note,
  .spik-3dforms .ed-col:nth-child(1), .spik-3dforms .ed-col:nth-child(2),
  .spik-product .ed-media, .spik-product .ed-note,
  .spik-exhibit .ed-media, .spik-exhibit .ed-note { grid-column: 1 / -1; grid-row: auto; }

  .spik-3dforms .ed-col + .ed-col { margin-top: clamp(2rem, 8vw, 3rem); margin-bottom: 0; }

  /* One image per row, resequenced so the fixture render comes before
     the drone pair and the before/after overheads sit back to back.
     Placement must be respecified per nth-child — a plain .ed-col rule
     is less specific than the desktop ones and would lose. */
  .spik-sim { row-gap: clamp(2rem, 8vw, 3rem); }
  .spik-sim .ed-col:nth-child(1) { grid-column: 1 / -1; grid-row: auto; order: 1; }
  .spik-sim .ed-col:nth-child(3) { grid-column: 1 / -1; grid-row: auto; order: 2; }  /* modeltop */
  .spik-sim .ed-col:nth-child(2) { grid-column: 1 / -1; grid-row: auto; order: 3; }  /* top */
  .spik-sim .ed-col:nth-child(4) { grid-column: 1 / -1; grid-row: auto; order: 4; }

  .spik-product .ed-note,
  .spik-exhibit .ed-note { margin-bottom: var(--sp-sm); }
}

/* ── Air Lighting — video hero sits outside grid-container, so collapse the
   top padding and pin meta/intro to row 1 (the global Malmo rule places them
   on row 2 expecting a hero in row 1, which we don't have here). */
.air-lighting .grid-container { padding-top: 0; }
.air-lighting .detail-meta,
.air-lighting .detail-intro { grid-row: 1; margin-top: 0; }

/* ── Air Lighting — Euroluce offset spread (overlapping pair) */
.ed-air-euroluce {
  align-items: start;
  row-gap: 0;
  position: relative;
}
.ed-air-euroluce .ed-air-euro-a   {
  grid-column: 1 / 10;
  grid-row: 1;
  position: relative;
  z-index: 1;
}
.ed-air-euroluce .ed-air-euro-b   {
  grid-column: 8 / 13;
  grid-row: 1 / 3;
  margin-top: clamp(4rem, 12vw, 10rem);
  position: relative;
  z-index: 2;
}
.ed-air-euroluce .ed-air-euro-txt {
  grid-column: 1 / 7;
  grid-row: 2;
  margin-top: clamp(1rem, 3vw, 2.5rem);
}

/* Air Lighting — pull the spread sketch down to 4 cols, centre the text */
.air-lighting .ed-spread .ed-media { grid-column: 7 / 13; }
.air-lighting .ed-spread .ed-note  { align-self: center; }

/* Air Lighting — top-view pair: narrower columns, bottom-aligned, locked ratio
   so the two renders share the exact same display height. */
.air-lighting .ed-pair { align-items: end; column-gap: var(--sp-sm); }
.air-lighting .ed-pair .ed-col:nth-child(1) { grid-column: 2 / 7; }
.air-lighting .ed-pair .ed-col:nth-child(2) { grid-column: 7 / 12; }
.air-lighting .ed-pair .ed-media { aspect-ratio: 3 / 4; }
.air-lighting .ed-pair .ed-media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) {
  /* The desktop rule pins meta + intro to the same grid row (video hero
     lives outside the grid); stacked single-column layout must release
     that pin or the two text blocks render on top of each other */
  .air-lighting .detail-meta,
  .air-lighting .detail-intro { grid-row: auto; }

  .ed-air-euroluce .ed-air-euro-a,
  .ed-air-euroluce .ed-air-euro-b,
  .ed-air-euroluce .ed-air-euro-txt {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-top: 0;
  }
  /* Read the exhibition note right after the first photo, not below both */
  .ed-air-euroluce .ed-air-euro-a   { order: 1; }
  .ed-air-euroluce .ed-air-euro-txt { order: 2; }
  .ed-air-euroluce .ed-air-euro-b   { order: 3; margin-top: clamp(2rem, 8vw, 3rem); }

  .air-lighting .ed-spread .ed-media,
  .air-lighting .ed-spread .ed-note { grid-column: 1 / -1; }
  /* Full width, one per row — the mobile grid has a single column, so
     12-column spans here would spawn auto-sized implicit columns and
     render the pair at wildly different sizes */
  .air-lighting .ed-pair .ed-col:nth-child(1),
  .air-lighting .ed-pair .ed-col:nth-child(2) { grid-column: 1 / -1; }
}

/* ── Bocuse d'Or — inspiration spread: text top-left with the smaller inspo3
   stacked beneath it, larger inspo1 on the right. */
.bocuse-inspo { align-items: start; }
.bocuse-inspo .bocuse-inspo-text { grid-column: 1 / 6; grid-row: 1; }
.bocuse-inspo .bc-img--lg { grid-column: 7 / 13; grid-row: 1; }
.bocuse-inspo .bc-img { margin: 0; overflow: hidden; }
.bocuse-inspo .bc-img img { display: block; width: 100%; height: auto; }
.bocuse-inspo .bc-img--sm { margin-top: var(--sp-md); max-width: 80%; }

@media (max-width: 900px) {
  .bocuse-inspo .bocuse-inspo-text,
  .bocuse-inspo .bc-img--lg { grid-column: 1 / -1; grid-row: auto; }
  .bocuse-inspo .bc-img--lg { margin-top: var(--sp-sm); }
}

/* ── Bocuse d'Or — process: narrative left, 2x2 equal-size collage right */
.bocuse-process { align-items: start; }
.bocuse-process .ed-note { grid-column: 1 / 5; grid-row: 1; }
.bocuse-process .bc-collage {
  grid-column: 6 / 13;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-sm);
}
.bocuse-process .bc-collage .ed-media { aspect-ratio: 1; }
.bocuse-process .bc-collage .ed-media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) {
  .bocuse-process .ed-note,
  .bocuse-process .bc-collage { grid-column: 1 / -1; grid-row: auto; }
  .bocuse-process .bc-collage { margin-top: var(--sp-md); }
}

/* ── Spice Tree carousel card — Moulin Light typography
────────────────────────────────────────────────────────────── */
.project-card[data-url="spice-tree.html"] .project-title,
.project-card[data-url="spice-tree.html"] .project-year,
.project-card[data-url="spice-tree.html"] .project-meta {
  font-family: 'Moulin Light', 'PPNeueMontreal-Medium', serif;
  font-weight: 300;
}

