/* Align the scientific drawing, keeping axes and colour scales in their original image. */
.method-gallery .mesh-response-pair{
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch;
  height:auto;
  gap:16px;
}
.method-gallery .mesh-response-pair .gallery-science-figure{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  overflow:hidden;
}
.method-gallery .mesh-response-pair .gallery-science-figure>img{
  flex:0 0 auto;
  width:100%;
  height:auto;
  max-height:none;
}
/* The original coarse crop starts six pixels lower; all three drawings are 619px high. */
.method-gallery .mesh-response-pair .gallery-science-figure:first-child>img{margin-top:-.667408%;}
.method-gallery .mesh-response-pair .gallery-science-figure:last-child>img{
  width:100.889878%;
  max-width:none;
  margin-left:8.342603%;
}
.method-gallery .mesh-response-pair figcaption{width:100%;margin-top:auto;padding-top:12px;}

/* Let the full field and its scale determine the media height. */
.method-gallery .method-slide-art:has(#preview-ai-fields),
.method-gallery .method-slide-art:has(.mesh-response-pair),
.method-gallery .method-slide-art:has(#preview-ai-fields) .method-preview-image,
.method-gallery .method-slide-art:has(.mesh-response-pair) .method-preview-image{height:auto;}

/* The same three-inclusion geometry/field pair is used throughout the site. */
.scale-field-pair,
.research-visual[data-layout="geometry-field"],
.solution-prediction-visual>div,
.mptt-opening-art>div{align-items:start;}
.solution-prediction-visual>div{grid-template-columns:repeat(2,minmax(0,1fr));}

:is(.scale-field-pair,.research-visual,.solution-prediction-visual,.mptt-opening-art,.data-source-image-window,.training-media-window) img[src$="/interface-3-geometry.webp"]{
  display:block;
  width:77.853063%;
  height:auto;
  max-height:none;
  margin:.83602% auto 0;
  transform:none;
}
:is(.scale-field-pair,.research-visual,.solution-prediction-visual,.mptt-opening-art,.data-source-image-window,.training-media-window) img[src$="/interface-3-stress-pred.webp"],
.data-source-image-window img[src$="/interface-3-stress-ref.webp"]{
  display:block;
  width:100%;
  height:auto;
  max-height:none;
  margin:0;
  transform:none;
}
/* The two labelled windows reserve space for the field's colour bar below the drawing. */
.data-source-view[data-source="mechanics"] .data-source-art{height:auto;align-items:start;}
.data-source-view[data-source="mechanics"] .data-source-image-window,
.training-overview[data-training-state="data"] .training-media-window{height:auto;aspect-ratio:902/1086;}
.data-source-view[data-source="mechanics"] .data-source-picture{justify-content:flex-start;}
.mptt-opening-art .mptt-opening-geometry,.mptt-opening-art .mptt-opening-field{transform:none;}

@media(max-width:520px){
  /* Keep the scale legible when it moves onto a separate row. */
  .method-gallery .mesh-response-pair{grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;}
  .method-gallery .mesh-response-pair .gallery-science-figure:last-child{grid-column:1/-1;max-width:260px;width:100%;justify-self:center;}
  .method-gallery #preview-ai-fields .scale-field-pair img:first-child{width:77.853063%;height:auto;max-height:none;}
  .method-gallery #preview-ai-fields .scale-field-pair img:last-child{height:auto;max-height:none;}
}
