/* V52.88: editorial staggered gallery rhythm for project-14 and project-15.
   Pattern: after 1–2 large full-width images, insert an offset side-by-side pair.
   Captions sit directly below each image. Scoped only to the two PDF-derived case pages. */
.yf-project-poster .yfpp-gallery .yfpp-case-block{margin:0 0 clamp(58px,8vw,112px);}
.yf-project-poster .yfpp-gallery .yfpp-case-block>.yfpp-full{margin-bottom:0;}
.yf-project-poster .yfpp-gallery .yfpp-full img{display:block;width:100%;height:auto;}
.yf-project-poster .yfpp-gallery .yfpp-case-caption{max-width:900px;margin:18px auto 0;padding:0 12px;font-size:15px;line-height:1.8;color:#3a3a3a;text-align:center;overflow-wrap:anywhere;}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair{display:grid;grid-template-columns:minmax(0,.76fr) minmax(0,1.24fr);gap:clamp(24px,5vw,96px);align-items:start;max-width:1320px;margin:0 auto clamp(70px,8vw,128px);}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair.is-reverse{grid-template-columns:minmax(0,1.24fr) minmax(0,.76fr);}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair.is-equal{grid-template-columns:repeat(2,minmax(0,1fr));}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair figure{margin:0;}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair figure img{display:block;width:100%;height:auto;}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair figure.yfpp-offset{margin-top:clamp(44px,6vw,118px);}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair figcaption{margin:16px auto 0;padding:0 2px;font-size:14px;line-height:1.75;color:#3a3a3a;text-align:center;overflow-wrap:anywhere;}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair.is-landscape-bias figure:first-child img{aspect-ratio:4/5;object-fit:cover;}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair.is-landscape-bias figure:last-child img{aspect-ratio:16/10;object-fit:cover;}
@media (max-width:1100px){
  .yf-project-poster .yfpp-gallery .yfpp-stagger-pair,
  .yf-project-poster .yfpp-gallery .yfpp-stagger-pair.is-reverse,
  .yf-project-poster .yfpp-gallery .yfpp-stagger-pair.is-equal{gap:24px;}
}
@media (max-width:900px){
  .yf-project-poster .yfpp-gallery .yfpp-case-block{margin-bottom:44px;}
  .yf-project-poster .yfpp-gallery .yfpp-case-caption{font-size:13px;line-height:1.72;margin-top:14px;padding:0 4px;}
  .yf-project-poster .yfpp-gallery .yfpp-stagger-pair,
  .yf-project-poster .yfpp-gallery .yfpp-stagger-pair.is-reverse,
  .yf-project-poster .yfpp-gallery .yfpp-stagger-pair.is-equal{grid-template-columns:1fr;gap:34px;max-width:760px;margin:0 auto 50px;}
  .yf-project-poster .yfpp-gallery .yfpp-stagger-pair figure.yfpp-offset{margin-top:0;}
  .yf-project-poster .yfpp-gallery .yfpp-stagger-pair figcaption{font-size:12px;line-height:1.66;margin-top:12px;}
  .yf-project-poster .yfpp-gallery .yfpp-stagger-pair.is-landscape-bias figure:first-child img,
  .yf-project-poster .yfpp-gallery .yfpp-stagger-pair.is-landscape-bias figure:last-child img{aspect-ratio:auto;object-fit:contain;}
}

/* V52.88: reattach the existing viewport reveal system via .yfpp-pair while
   preserving the authored stagger, not the legacy pair's translate offsets. */
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair.yfpp-pair,
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair.yfpp-pair.reverse{
  padding:0!important;
  position:relative;
  margin:0!important;
  overflow:visible;
}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair.yfpp-pair>figure,
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair.yfpp-pair>figure:first-child,
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair.yfpp-pair>figure:last-child{
  transform:none!important;
  transition:none;
  margin:0!important;
}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair.yfpp-pair>figure.yfpp-offset{
  margin-top:clamp(44px,6vw,118px)!important;
}
.yf-project-poster .yfpp-gallery .yfpp-stagger-pair.yfpp-pair img.yf-v37-reveal{
  display:block;
  width:100%;
  max-width:100%;
  height:auto;
}
@media(max-width:900px){
 .yf-project-poster .yfpp-gallery .yfpp-stagger-pair.yfpp-pair>figure.yfpp-offset{margin-top:0!important;}
}

/* V52.94: mobile copy-safety fix for the two editorial case galleries.
   Legacy V33/V37 reveal systems transform the image down by 56/58px on mobile.
   Captions are only ~12px below the image, so that translate paints the image
   on top of its own caption during entry/re-entry. Keep opacity fades, but
   disable translate only for these gallery media on mobile. Other reveals and
   all desktop stagger offsets are unchanged. */
@media (max-width: 900px) {
  .yf-project-poster.yf-v37-detail-motion .yfpp-gallery .yfpp-case-block .yfpp-stagger-pair img.yf-v37-reveal,
  .yf-project-poster.yf-v37-detail-motion .yfpp-gallery .yfpp-case-block > .yfpp-full.yf-v37-reveal,
  .yf-project-poster.yf-detail-scroll-active .yfpp-gallery .yfpp-case-block .yfpp-stagger-pair img.yf-project-reveal,
  .yf-project-poster.yf-detail-scroll-active .yfpp-gallery .yfpp-case-block > .yfpp-full.yf-project-reveal {
    transform: none !important;
    transition-property: opacity !important;
  }
  .yf-project-poster .yfpp-gallery .yfpp-case-block .yfpp-stagger-pair > figure {
    min-width: 0;
  }
  .yf-project-poster .yfpp-gallery .yfpp-case-block .yfpp-stagger-pair figcaption,
  .yf-project-poster .yfpp-gallery .yfpp-case-block > .yfpp-case-caption {
    position: static;
    display: block;
    height: auto;
    overflow: visible;
  }
}

/* V52.96: mobile section-flow protection; the first gallery image must never
   paint over the closing project summary, even during a scroll reveal or
   language-induced line-wrap changes. Scope to the two PDF-derived projects. */
@media (max-width: 900px) {
  .yf-project-poster.yf-case-editorial-v5296 .yfpp-copy {
    display: flow-root;
    position: relative;
    margin-bottom: 0 !important;
    padding-bottom: clamp(50px, 12vw, 88px) !important;
    min-height: 0;
  }
  .yf-project-poster.yf-case-editorial-v5296 .yfpp-gallery {
    position: relative;
    display: flow-root;
    clear: both;
    margin-top: 0 !important;
  }
  .yf-project-poster.yf-case-editorial-v5296 .yfpp-gallery .yfpp-case-block:first-child {
    position: relative;
    margin-top: 0;
  }
  .yf-project-poster.yf-case-editorial-v5296 .yfpp-gallery .yfpp-case-block:first-child
  .yfpp-full,
  .yf-project-poster.yf-case-editorial-v5296 .yfpp-gallery .yfpp-case-block:first-child
  .yfpp-full.yf-v37-reveal,
  .yf-project-poster.yf-case-editorial-v5296 .yfpp-gallery .yfpp-case-block:first-child
  .yfpp-full.yf-project-reveal {
    transform: none !important;
    transition-property: opacity !important;
    position: relative;
  }
}
