/* IASCL V46.517 - Text with pictures. Same rules on the public pages and inside the editors, so what is seen while writing is what is published.
   Rules that keep the layout tidy:
   - the text area is a block formatting context (display:flow-root): pictures never leak out of it and never overlap the next section;
   - only the Small (25%) and Medium (40%) pictures may sit beside text; Large (60%) and Full (100%) always take their own row;
   - a picture that would have only a line or two of text beside it takes its own row too (script adds .rt-solo);
   - lists, quotes and tables start beside the picture, never under it;
   - on phones every picture is a centered block. */
.rt-body{display:flow-root;overflow-wrap:break-word}
.rt-body p{margin:0 0 1em}
.rt-body h2,.rt-body h3,.rt-body h4{margin:1.2em 0 .5em;line-height:1.35}
.rt-body ul,.rt-body ol{display:flow-root;margin:0 0 1em;padding-inline-start:1.6em}
.rt-body blockquote{display:flow-root;margin:0 0 1em;padding:.2em 1em;border-inline-start:3px solid #b9c7d6;color:#3b4a5a}
.rt-body table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;margin:0 0 1em}
.rt-body td,.rt-body th{border:1px solid #cfd8e2;padding:.35em .6em;vertical-align:top}
.rt-body a{color:#0b5a9c;text-decoration:underline}
.rt-body > :last-child{margin-bottom:0}
.rt-body p[style*="text-align:left"]{text-align:left!important}
.rt-body p[style*="text-align:right"]{text-align:right!important}
.rt-body p[style*="text-align:center"]{text-align:center!important}
.rt-body p[style*="text-align:justify"]{text-align:justify!important}

.rt-body figure.rt-fig{box-sizing:border-box;max-width:100%;margin:.2em auto 1em;padding:0;position:relative}
.rt-body figure.rt-fig img{display:block;width:100%;max-width:100%;height:auto;border-radius:6px;background:#eef2f6}
.rt-body figure.rt-fig figcaption{margin:.45em 0 0;font-size:.85em;line-height:1.5;color:#52606d;text-align:center!important;text-align-last:center}
.rt-body figure.rt-fig.rt-s{width:25%}
.rt-body figure.rt-fig.rt-m{width:40%}
.rt-body figure.rt-fig.rt-l{width:60%}
.rt-body figure.rt-fig.rt-full{width:100%}
.rt-body figure.rt-fig:not(.rt-s):not(.rt-m):not(.rt-l):not(.rt-full){width:60%}

/* beside the text */
.rt-body figure.rt-fig.rt-left.rt-s:not(.rt-solo),.rt-body figure.rt-fig.rt-left.rt-m:not(.rt-solo){float:left;clear:left;margin:.3em 1.3em .8em 0}
.rt-body figure.rt-fig.rt-right.rt-s:not(.rt-solo),.rt-body figure.rt-fig.rt-right.rt-m:not(.rt-solo){float:right;clear:right;margin:.3em 0 .8em 1.3em}
/* on their own row */
.rt-body figure.rt-fig.rt-center,.rt-body figure.rt-fig.rt-l,.rt-body figure.rt-fig.rt-full,.rt-body figure.rt-fig.rt-solo{float:none;clear:both;margin-left:auto;margin-right:auto}
.rt-body figure.rt-fig.rt-left.rt-l{margin-left:0;margin-right:auto}
.rt-body figure.rt-fig.rt-right.rt-l{margin-left:auto;margin-right:0}
/* a small / medium picture that cannot sit beside the text is centered, so no empty strip is left at one side */
.rt-body figure.rt-fig.rt-solo.rt-s{width:min(100%,260px)}
.rt-body figure.rt-fig.rt-solo.rt-m{width:min(100%,420px)}
.rt-body figure.rt-fig + figure.rt-fig{clear:both}

@media (max-width:640px){
  .rt-body figure.rt-fig,.rt-body figure.rt-fig.rt-left.rt-s:not(.rt-solo),.rt-body figure.rt-fig.rt-left.rt-m:not(.rt-solo),.rt-body figure.rt-fig.rt-right.rt-s:not(.rt-solo),.rt-body figure.rt-fig.rt-right.rt-m:not(.rt-solo){float:none;clear:both;margin:.4em auto 1em}
  .rt-body figure.rt-fig.rt-s,.rt-body figure.rt-fig.rt-m,.rt-body figure.rt-fig.rt-solo.rt-s,.rt-body figure.rt-fig.rt-solo.rt-m{width:min(100%,360px)}
  .rt-body figure.rt-fig.rt-l,.rt-body figure.rt-fig.rt-full{width:100%}
}
@media print{.rt-body figure.rt-fig{break-inside:avoid}}

/* inside editors */
.rt-body figure.rt-fig.rt-selected{outline:3px solid #0e83db;outline-offset:2px;cursor:pointer}
.rt-body figure.rt-fig[contenteditable="false"]{cursor:pointer;user-select:none}

/* V46.520 - English words inside Persian text: kept as one left-to-right unit, in the English typeface with English digits */
.rt-body .rt-latin{direction:ltr;unicode-bidi:isolate;font-variant-numeric:lining-nums}
html[lang="fa"] .rt-body .rt-latin{font-family:"IASCL Serif","Times New Roman",Times,serif!important}
.rt-body .rt-latin-block{display:block;margin:.35em 0;text-align:justify;text-align-last:left}
