/* ══════════════════════════════════════════════════════════════════════════
   Project fiche — layout v2 (DESKTOP ONLY, > 1024 px). Draft 2026-11-24.
   Txema: no full-bleed images, more space, closer to davidchipperfield.com.
   Same ACF modules as today (full_image, two_col, single_side, three_col,
   asym, video, text) — only placement, size and rhythm change. Nothing is
   cropped: every image shows at its natural ratio.
   Scoped to body.layout-v2 so it can be previewed before switching on.
   Mobile / tablet (≤ 1024 px) untouched.
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1025px) {

  body.layout-v2 {
    --v2-gap:    clamp(120px, 11vw, 200px);   /* vertical air between modules */
    --v2-inner:  32px;                          /* gap inside pairs / trios     */
    --v2-wide:   78%;                           /* the large image              */
    --v2-mid:    58%;                           /* standard full_image          */
  }

  body.layout-v2 .proj-body { padding-bottom: var(--v2-gap); }

  /* ── reset the old edge-to-edge treatment: natural ratio, no crop, no tint ── */
  body.layout-v2 .mod-full,
  body.layout-v2 .mod-2col-item,
  body.layout-v2 .mod-3col-item,
  body.layout-v2 .mod-asym-main,
  body.layout-v2 .mod-asym-side { aspect-ratio: auto; overflow: hidden; background: transparent; }
  body.layout-v2 .mod-full img,
  body.layout-v2 .mod-2col-item img,
  body.layout-v2 .mod-3col-item img,
  body.layout-v2 .mod-asym-main img,
  body.layout-v2 .mod-asym-side img { width: 100%; height: auto; object-fit: initial; display: block; }

  /* ── full_image: never full-bleed. Left at 58vw, every second one to the
        right margin; the first image of the fiche larger (78vw). Portraits
        keep their height cap so they never overflow the screen. ── */
  body.layout-v2 .mod-full {
    width: var(--v2-mid); margin: var(--v2-gap) 0 0 var(--px);
  }
  body.layout-v2 .mod-full:nth-child(even of .mod-full) { margin-left: auto; margin-right: var(--px); }
  body.layout-v2 .mod-full:nth-child(1 of .mod-full)    { width: var(--v2-wide); margin-left: var(--px); margin-right: 0; }
  body.layout-v2 .mod-full--portrait { display: block; }
  body.layout-v2 .mod-full--portrait img { width: auto; max-width: 100%; max-height: 88vh; margin: 0; }

  /* ── two_col: a pair inside 64vw, natural heights, aligned at the top ── */
  body.layout-v2 .mod-2col {
    width: 64%; margin: var(--v2-gap) 0 0 var(--px);
    gap: var(--v2-inner); align-items: start;
  }
  body.layout-v2 .mod-2col:nth-child(even of .mod-2col) { margin-left: auto; margin-right: var(--px); }
  body.layout-v2 .mod-2col--portrait .mod-2col-item img { object-fit: initial; }

  /* ── asym (7:5): same width as a pair ── */
  body.layout-v2 .mod-asym { width: 70%; margin: var(--v2-gap) 0 0 var(--px); gap: var(--v2-inner); align-items: start; }

  /* ── three_col: small, a row of three across 60vw (tall 9:16 renders stay
        readable without dominating the screen) ── */
  body.layout-v2 .mod-3col { width: 60%; margin: var(--v2-gap) auto 0 var(--px); gap: var(--v2-inner); align-items: start; }
  body.layout-v2 .mod-3col--tall { width: 48%; }

  /* ── single_side: one image against a margin, never wider than 38vw ── */
  body.layout-v2 .mod-single { margin: var(--v2-gap) var(--px) 0; }
  body.layout-v2 .mod-single-fig { max-width: 38%; }  /* of the row */
  body.layout-v2 .mod-single-fig img { max-height: 84vh; }

  /* ── video ── */
  body.layout-v2 .mod-video { margin: var(--v2-gap) 0 0 var(--px); background: transparent; }
  body.layout-v2 .mod-video--16-9,
  body.layout-v2 .mod-video--4-3,
  body.layout-v2 .mod-video--1-1 { width: var(--v2-mid); }
  body.layout-v2 .mod-video--9-16,
  body.layout-v2 .mod-video--4-5 { margin-left: auto; margin-right: auto; }

  /* ── captions sit under their image, aligned with it ── */
  body.layout-v2 .img-caption { padding: 12px var(--px) 0; }

  /* ── text: same typography and column as today; only the vertical air changes ── */
  body.layout-v2 .proj-text { padding: var(--v2-gap) var(--px) 0; }   /* typography and 680px column unchanged from main.css; only the air above */
  body.layout-v2 .proj-body > .proj-text:first-child { padding-top: 96px; }
  body.layout-v2 .proj-quote,
  body.layout-v2 .proj-plan { margin-top: var(--v2-gap); }

  /* ── HEIGHT CAP (audit 2026-11-24): no image or video taller than the screen.
        Portrait photos (4:5) in full / pair / asym modules were up to 1977 px high on a
        1080 px screen. Width shrinks instead, ratio intact, aligned to its side. ── */
  body.layout-v2 .mod-full { display: flex; }
  body.layout-v2 .mod-full:nth-child(even of .mod-full) { justify-content: flex-end; }
  body.layout-v2 .mod-full img,
  body.layout-v2 .mod-2col-item img,
  body.layout-v2 .mod-asym-main img,
  body.layout-v2 .mod-asym-side img,
  body.layout-v2 .mod-3col-item img { width: auto; max-width: 100%; max-height: 88vh; }
  body.layout-v2 .mod-video { aspect-ratio: auto; }
  body.layout-v2 .mod-video video { position: static; display: block; width: auto; height: auto; max-width: 100%; max-height: 88vh; object-fit: initial; }

  /* ── justified rows (set by layout-v2-gallery.js): equal heights, widths by ratio ── */
  body.layout-v2 .is-justified { display: flex; align-items: flex-start; gap: var(--v2-inner); }
  body.layout-v2 .is-justified > * { min-width: 0; aspect-ratio: auto; }
  body.layout-v2 .is-justified img { width: 100%; height: auto; max-height: none; }

  /* ── further reading: lead + link read as one paragraph of the project text
        (same 15px / 1.5 as .proj-text p, no gap between the two lines) — Txema 2026-11-24 ── */
  body.layout-v2 .proj-further-lead { font-size: 15px; line-height: 1.5; margin-bottom: 0; max-width: none; }
  body.layout-v2 .proj-further-link { font-size: 15px; line-height: 1.5; }

  /* no zoom-on-hover in the calmer layout */
  body.layout-v2 .mod-full:hover img,
  body.layout-v2 .mod-2col-item:hover img,
  body.layout-v2 .mod-3col-item:hover img,
  body.layout-v2 .mod-single-fig:hover img,
  body.layout-v2 .mod-asym-main:hover img,
  body.layout-v2 .mod-asym-side:hover img { transform: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Gallery (assets/js/layout-v2-gallery.js) — click an image to view it large.
   Desktop + iPad (≥ 768 px). Cream ground, image whole with margin, thin arrows,
   × top right (no counter) (after davidchipperfield.com). Below the custom cursor.
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  body.layout-v2 .bzg-trigger { cursor: zoom-in; }
}
html.bzg-lock, html.bzg-lock body { overflow: hidden; }
.bzg { position: fixed; inset: 0; z-index: 9000; background: var(--cream); display: none; }
.bzg.is-open { display: block; }
.bzg-stage { position: absolute; inset: 64px 96px; display: flex; align-items: center; justify-content: center; }
.bzg-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; opacity: 0; transition: opacity .35s var(--ease); }
.bzg-img.is-in { opacity: 1; }
.bzg-top { position: absolute; top: 0; right: 0; left: 0; height: 64px; display: flex; align-items: center; justify-content: flex-end; gap: 22px; padding: 0 var(--px); z-index: 2; }
.bzg-close { background: none; border: 0; padding: 6px; font-size: 18px; line-height: 1; color: var(--black); cursor: pointer; }
.bzg-prev, .bzg-next { position: absolute; top: 64px; bottom: 64px; width: 96px; background: none; border: 0; cursor: pointer; z-index: 2; }
.bzg-prev { left: 0; } .bzg-next { right: 0; }
.bzg-prev span, .bzg-next span { position: absolute; top: 50%; left: 50%; width: 34px; height: 1px; background: var(--black); }
.bzg-prev span { transform: translate(-50%, -50%); } .bzg-next span { transform: translate(-50%, -50%); }
.bzg-prev span::before, .bzg-next span::before { content: ''; position: absolute; top: -6px; width: 12px; height: 12px; border: solid var(--black); border-width: 0 0 1px 1px; }
.bzg-prev span::before { left: 0; transform: rotate(45deg); transform-origin: 0 100%; top: -12px; }
.bzg-next span::before { right: 0; border-width: 1px 1px 0 0; transform: rotate(45deg); transform-origin: 100% 0; top: 0; }
.bzg-prev:hover span, .bzg-next:hover span, .bzg-close:hover { opacity: .5; }
@media (max-width: 1024px) { .bzg-stage { inset: 56px 64px; } .bzg-prev, .bzg-next { width: 64px; } }
.bzg:focus { outline: none; }
.bzg button:focus:not(:focus-visible) { outline: none; }
