/* Ordinary body images and editor previews: limits, not forced enlargement. */
body.emf-page-background :is(.field--name-body, .ck-content) img {
  box-sizing: border-box;
  max-width: min(100%, 640px);
  max-height: 480px;
  height: auto;
  object-fit: contain;
  padding: .5rem;
  margin-block: .25rem 1rem;
}
/* Intrinsic sizing preserves proportions when both limits constrain an image.
 * Keep supported authored width attributes and inline resize choices intact. */
body.emf-page-background :is(.field--name-body, .ck-content) img:not([width]) {
  width: auto;
}
body.emf-page-background .field--name-body :is(img, figure, .media).align-right {
  max-width: min(calc(100% - 1rem), 640px);
  margin-left: 1rem;
}
body.emf-page-background .field--name-body :is(img, figure, .media).align-left {
  max-width: min(calc(100% - 1rem), 640px);
  margin-right: 1rem;
}
