/* Shared by the publication body and the writing iframe. */
#tinymce .hr-article-figure,
.hrnt-publication-text .hr-article-figure {
    display: block;
    width: fit-content;
    max-width: min(100%, 560px);
    margin: 1em 0;
}
#tinymce .hr-article-figure > img,
.article_content .hrnt-publication-text .hr-article-figure > img,
#tinymce img.img-fluid:not(.hr-article-sized)[src*="/articles/"],
.article_content .hrnt-publication-text img.img-fluid:not(.hr-article-sized)[src*="/articles/"] {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, 560px);
    max-height: 420px;
}
#tinymce .hr-article-figure > img,
.article_content .hrnt-publication-text .hr-article-figure > img {
    margin: 0;
    border: 0;
    box-shadow: none;
}
#tinymce .hr-article-figure figcaption,
.article_content .hrnt-publication-text .hr-article-figure figcaption {
    margin: .35em 0 0;
    color: var(--color-muted, #616575);
    font-size: var(--text-sm, 14px);
    font-weight: normal;
    font-style: italic;
    line-height: 1.45;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}
#tinymce .hr-article-figure figcaption {
    position: relative;
    min-width: min(10em, 100%);
    min-height: 1.45em;
    cursor: text;
}
#tinymce .hr-article-figure figcaption[data-mce-caption-empty]::before {
    content: "Добавить подпись";
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
}

/* An explicit size chosen by the author overrides the initial medium size. */
#tinymce .hr-article-figure:has(img.hr-article-sized),
.hrnt-publication-text .hr-article-figure:has(img.hr-article-sized),
#tinymce img.hr-article-sized,
.article_content .hrnt-publication-text img.hr-article-sized {
    max-width: 100%;
    max-height: none;
}
