/* Make research imagery feel like part of each case, without empty gray mats. */
body.case-reference #main-content .case-story__gallery.research-gallery figure:nth-child(n) {
  position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden;
  box-sizing:border-box; margin:0; padding:0; border:0; min-width:0; aspect-ratio:16/10;
  background:radial-gradient(ellipse at 28% 24%,rgba(var(--research-tint),.2),transparent 63%),linear-gradient(135deg,#1c2021,#090d0f);
}
body.case-reference #main-content .case-story__gallery.research-gallery figure:nth-child(3n+1) {grid-column:1/-1;aspect-ratio:16/9}
body.case-reference #main-content .research-gallery figure > img {display:block;width:100%;height:100%;border-radius:0;object-fit:cover;object-position:center top}
body.case-reference #main-content .research-gallery figure.research-gallery__phone > img {
  width:auto; max-width:85%; height:92%; aspect-ratio:390/844; object-fit:cover; object-position:center top;
  box-sizing:border-box; border:clamp(3px,.35vw,7px) solid #141719; border-radius:clamp(14px,1.8vw,28px);
  box-shadow:0 0 0 1px rgba(255,255,255,.16),0 16px 35px rgba(0,0,0,.4);
}
body.case-reference #main-content .case-story__gallery.research-gallery figure.case-story__montage {aspect-ratio:auto}
body.case-reference #main-content .research-gallery figure.case-story__montage > img {width:100%;height:auto;object-fit:contain}
@media(max-width:600px) {
 body.case-reference #main-content .case-story__gallery.research-gallery figure:nth-child(n) {grid-column:1;aspect-ratio:16/10}
 body.case-reference #main-content .case-story__gallery.research-gallery figure.case-story__montage {aspect-ratio:auto}
 body.case-reference #main-content .research-gallery figure.research-gallery__phone > img {height:94%}
}
/* Let a phone share its row instead of leaving a wide, mostly empty panel. */
@media (min-width:601px) {
 body.case-reference #main-content .case-story__gallery.research-gallery figure.research-gallery__phone:nth-child(3n+1) {grid-column:auto;aspect-ratio:16/10}
 body.case-reference #main-content .research-gallery:has(figure.research-gallery__phone:nth-child(4)):not(:has(.case-story__montage)) figure:last-child {grid-column:1/-1;aspect-ratio:16/9}
 body.case-reference #main-content .research-gallery:has(figure.research-gallery__phone:nth-child(4)) .case-story__montage {order:2}
 body.case-reference #main-content .research-gallery:has(figure.research-gallery__phone:nth-child(4)) .case-story__montage ~ figure {order:1}
 body.case-reference #main-content .research-gallery:has(.case-story__montage):not(:has(figure.research-gallery__phone:nth-child(4))) .case-story__montage ~ figure:last-child {grid-column:1/-1;aspect-ratio:16/9}
}
@media(max-width:600px) {
 body.case-reference #main-content .case-story__gallery.research-gallery figure.research-gallery__phone:nth-child(n) {aspect-ratio:4/5}
}
