/* Pictures inside news posts. Loaded by the public pages AND by the editor (content_css), so what you see while
   writing is what readers get. Text flows around floated pictures; on phones they stack above the text. */
.rich img { max-width: 100%; height: auto; border-radius: 8px; }

/* position: the editor's align buttons (inline float / centring) and the "Image class" presets */
.rich img.img-left,  .rich img[style*="float: left"],  .rich img[style*="float:left"]  { float: left;  margin: 4px 20px 12px 0; }
.rich img.img-right, .rich img[style*="float: right"], .rich img[style*="float:right"] { float: right; margin: 4px 0 12px 20px; }
.rich img.img-center, .rich img[style*="display: block"], .rich img[style*="display:block"] { display: block; float: none; margin: 12px auto; }
.rich img.img-full { display: block; float: none; width: 100%; margin: 12px 0; }

/* size presets (a CSS width beats the width attribute the editor writes when you drag a corner) */
.rich img.img-small  { width: 25%; }
.rich img.img-medium { width: 40%; }
.rich img.img-large  { width: 60%; }

/* the post box always ends below its floated pictures; headings and tables start below them */
.rich::after { content: ""; display: table; clear: both; }
.rich h2, .rich h3, .rich table, .rich hr { clear: both; }

@media (max-width: 600px) {
  .rich img.img-left, .rich img.img-right,
  .rich img[style*="float: left"], .rich img[style*="float:left"],
  .rich img[style*="float: right"], .rich img[style*="float:right"] { float: none; display: block; margin: 12px auto; }
  .rich img.img-small { width: 50% !important; }
  .rich img.img-medium, .rich img.img-large { width: 100% !important; }
}
