/* Shared by current/legacy article pages and the administrator preview. */
:is(.article-body,.article-content,.paper .body) .article-figure {
  margin: 36px 0;
  padding: 22px;
  height: auto;
  max-height: none;
  overflow: visible;
  background: #fff;
  border: 1px solid #e0e7ed;
  border-radius: 8px;
}
:is(.article-body,.article-content,.paper .body) .article-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 560px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
}
:is(.article-body,.article-content,.paper .body) .article-figure figcaption {
  margin: 16px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid #edf1f4;
  color: #607487;
  font-size: 13px;
  line-height: 1.65;
}
/* User-specified widths remain useful; intrinsic ratio takes priority over old fixed heights. */
:is(.article-body,.article-content,.paper .body) .article-rich-layout img {
  display: block;
  height: auto !important;
  max-width: 100%;
  max-height: 600px;
  margin-inline: auto;
  object-fit: contain !important;
  object-position: center;
}
:is(.article-body,.article-content,.paper .body) .article-rich-layout figure {
  width: auto !important;
  max-width: 100%;
  height: auto !important;
  max-height: none;
  overflow: visible;
}
:is(.article-body,.article-content,.paper .body) .article-rich-layout :is(p,div) { max-width: 100%; }
@media(max-width:640px) {
  :is(.article-body,.article-content,.paper .body) .article-figure { padding: 14px; margin-block: 26px; }
  :is(.article-body,.article-content,.paper .body) .article-figure img { max-height: 440px; }
}
