/* Keep legacy Blogger images aligned with the readable article column. */
:root {
  --skypray-content-image-max: var(--skypray-article-max, 760px);
}

.wp-block-post-content > .wp-block-post-featured-image,
.entry-content > .wp-block-post-featured-image,
.wp-block-post-content > figure.wp-block-image,
.entry-content > figure.wp-block-image,
.wp-block-post-content > table.tr-caption-container,
.entry-content > table.tr-caption-container {
  clear: both !important;
  float: none !important;
  display: table !important;
  width: min(100%, var(--skypray-content-image-max)) !important;
  max-width: 100% !important;
  margin-inline: auto !important;
  text-align: center !important;
}

.wp-block-post-content .wp-block-post-featured-image img,
.entry-content .wp-block-post-featured-image img,
.wp-block-post-content figure.wp-block-image img,
.entry-content figure.wp-block-image img,
.wp-block-post-content table.tr-caption-container img,
.entry-content table.tr-caption-container img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin-inline: auto !important;
}

.wp-block-post-content table.tr-caption-container td,
.entry-content table.tr-caption-container td {
  max-width: 100%;
  text-align: center !important;
}

/* Standalone legacy image links which were not stored in a caption table. */
.wp-block-post-content a[style*="margin-left"]:has(> img),
.entry-content a[style*="margin-left"]:has(> img) {
  clear: both !important;
  float: none !important;
  display: table !important;
  width: fit-content !important;
  max-width: min(100%, var(--skypray-content-image-max)) !important;
  margin-inline: auto !important;
}

.wp-block-post-content a[style*="margin-left"] > img,
.entry-content a[style*="margin-left"] > img,
.wp-block-post-content img.alignleft,
.wp-block-post-content img.alignright,
.wp-block-post-content img.aligncenter,
.entry-content img.alignleft,
.entry-content img.alignright,
.entry-content img.aligncenter {
  clear: both !important;
  float: none !important;
  display: block !important;
  width: auto !important;
  max-width: min(100%, var(--skypray-content-image-max)) !important;
  height: auto !important;
  margin-inline: auto !important;
}

.wp-block-post-content figcaption,
.wp-block-post-content .wp-caption-text,
.entry-content figcaption,
.entry-content .wp-caption-text {
  margin-inline: auto !important;
  text-align: center !important;
}
