/**
 * WordPress editor compatibility styles.
 *
 * Covers classic alignment classes (alignnone, aligncenter, alignleft,
 * alignright) and other markup commonly output by the Block Editor /
 * media library. Scoped to both frontend post content and the editor
 * iframe so admin preview matches the live single pages.
 */

/* ------------------------------------------------------------------ */
/* Classic media alignment (img, figure, div, p, .wp-caption, etc.)   */
/* ------------------------------------------------------------------ */

.entry-content.post-content .alignleft,
.post-content .alignleft,
.editor-styles-wrapper .alignleft {
    float: left;
    margin: 0.5em 1.5em 1em 0;
    clear: none;
}

.entry-content.post-content .alignright,
.post-content .alignright,
.editor-styles-wrapper .alignright {
    float: right;
    margin: 0.5em 0 1em 1.5em;
    clear: none;
}

.entry-content.post-content .aligncenter,
.post-content .aligncenter,
.editor-styles-wrapper .aligncenter {
    clear: both;
}

.entry-content.post-content img.aligncenter,
.post-content img.aligncenter,
.editor-styles-wrapper img.aligncenter,
.entry-content.post-content figure.aligncenter,
.post-content figure.aligncenter,
.editor-styles-wrapper figure.aligncenter,
.entry-content.post-content div.aligncenter,
.post-content div.aligncenter,
.editor-styles-wrapper div.aligncenter,
.entry-content.post-content p.aligncenter,
.post-content p.aligncenter,
.editor-styles-wrapper p.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.entry-content.post-content figure.aligncenter,
.post-content figure.aligncenter,
.editor-styles-wrapper figure.aligncenter {
    display: table;
}

.entry-content.post-content figure.aligncenter > img,
.post-content figure.aligncenter > img,
.editor-styles-wrapper figure.aligncenter > img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.entry-content.post-content .alignnone,
.post-content .alignnone,
.editor-styles-wrapper .alignnone {
    clear: none;
    float: none;
    margin: 0.5em 0;
    max-width: 100%;
    height: auto;
}

.entry-content.post-content img.alignleft,
.post-content img.alignleft,
.editor-styles-wrapper img.alignleft,
.entry-content.post-content img.alignright,
.post-content img.alignright,
.editor-styles-wrapper img.alignright {
    display: inline;
    max-width: 100%;
    height: auto;
}

/* ------------------------------------------------------------------ */
/* Caption shortcode / classic caption markup                         */
/* ------------------------------------------------------------------ */

.entry-content.post-content .wp-caption,
.post-content .wp-caption,
.editor-styles-wrapper .wp-caption {
    max-width: 100%;
    margin-bottom: 1.25rem;
}

.entry-content.post-content .wp-caption img,
.post-content .wp-caption img,
.editor-styles-wrapper .wp-caption img {
    display: block;
    margin: 0;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.entry-content.post-content .wp-caption.alignleft,
.post-content .wp-caption.alignleft,
.editor-styles-wrapper .wp-caption.alignleft {
    float: left;
    margin: 0.5em 1.5em 1em 0;
}

.entry-content.post-content .wp-caption.alignright,
.post-content .wp-caption.alignright,
.editor-styles-wrapper .wp-caption.alignright {
    float: right;
    margin: 0.5em 0 1em 1.5em;
}

.entry-content.post-content .wp-caption.aligncenter,
.post-content .wp-caption.aligncenter,
.editor-styles-wrapper .wp-caption.aligncenter {
    display: table;
    margin-left: auto;
    margin-right: auto;
}

.entry-content.post-content .wp-caption-text,
.post-content .wp-caption-text,
.editor-styles-wrapper .wp-caption-text,
.entry-content.post-content figcaption,
.post-content figcaption,
.editor-styles-wrapper figcaption {
    font-size: 14px;
    color: #98A2B3;
    text-align: center;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* Image size classes from the media library                            */
/* ------------------------------------------------------------------ */

.entry-content.post-content img.size-thumbnail,
.post-content img.size-thumbnail,
.editor-styles-wrapper img.size-thumbnail {
    max-width: 150px;
}

.entry-content.post-content img.size-medium,
.post-content img.size-medium,
.editor-styles-wrapper img.size-medium {
    max-width: 300px;
}

.entry-content.post-content img.size-large,
.post-content img.size-large,
.editor-styles-wrapper img.size-large {
    max-width: 1024px;
}

.entry-content.post-content img.size-full,
.post-content img.size-full,
.editor-styles-wrapper img.size-full {
    max-width: 100%;
    width: auto;
    height: auto;
}

/* ------------------------------------------------------------------ */
/* Gutenberg image block — inner align classes on figure/img            */
/* ------------------------------------------------------------------ */

.entry-content.post-content .wp-block-image,
.post-content .wp-block-image,
.editor-styles-wrapper .wp-block-image {
    margin: 1.5rem 0;
}

.entry-content.post-content .wp-block-image .alignleft,
.post-content .wp-block-image .alignleft,
.editor-styles-wrapper .wp-block-image .alignleft {
    float: left;
    margin: 0.5em 1.5em 1em 0;
}

.entry-content.post-content .wp-block-image .alignright,
.post-content .wp-block-image .alignright,
.editor-styles-wrapper .wp-block-image .alignright {
    float: right;
    margin: 0.5em 0 1em 1.5em;
}

.entry-content.post-content .wp-block-image .aligncenter,
.post-content .wp-block-image .aligncenter,
.editor-styles-wrapper .wp-block-image .aligncenter {
    display: table;
    margin-left: auto;
    margin-right: auto;
    clear: both;
}

.entry-content.post-content .wp-block-image.alignleft,
.post-content .wp-block-image.alignleft,
.editor-styles-wrapper .wp-block-image.alignleft {
    float: left;
    margin: 0.25rem 1.5rem 1rem 0;
}

.entry-content.post-content .wp-block-image.alignright,
.post-content .wp-block-image.alignright,
.editor-styles-wrapper .wp-block-image.alignright {
    float: right;
    margin: 0.25rem 0 1rem 1.5rem;
}

.entry-content.post-content .wp-block-image.aligncenter,
.post-content .wp-block-image.aligncenter,
.editor-styles-wrapper .wp-block-image.aligncenter {
    text-align: center;
}

.entry-content.post-content .wp-block-image.aligncenter img,
.post-content .wp-block-image.aligncenter img,
.editor-styles-wrapper .wp-block-image.aligncenter img {
    margin-left: auto;
    margin-right: auto;
}

.entry-content.post-content .wp-block-image:not(.alignleft):not(.alignright) img,
.post-content .wp-block-image:not(.alignleft):not(.alignright) img,
.editor-styles-wrapper .wp-block-image:not(.alignleft):not(.alignright) img {
    display: block;
}

/* ------------------------------------------------------------------ */
/* Floated embeds, galleries, pullquotes, buttons                     */
/* ------------------------------------------------------------------ */

.entry-content.post-content .wp-block-embed.alignleft,
.post-content .wp-block-embed.alignleft,
.editor-styles-wrapper .wp-block-embed.alignleft {
    float: left;
    max-width: 360px;
    margin: 0.5em 1.5em 1em 0;
    clear: none;
}

.entry-content.post-content .wp-block-embed.alignright,
.post-content .wp-block-embed.alignright,
.editor-styles-wrapper .wp-block-embed.alignright {
    float: right;
    max-width: 360px;
    margin: 0.5em 0 1em 1.5em;
    clear: none;
}

.entry-content.post-content .wp-block-embed.aligncenter,
.post-content .wp-block-embed.aligncenter,
.editor-styles-wrapper .wp-block-embed.aligncenter {
    display: table;
    margin-left: auto;
    margin-right: auto;
    clear: both;
}

.entry-content.post-content .wp-block-gallery.alignleft,
.post-content .wp-block-gallery.alignleft,
.editor-styles-wrapper .wp-block-gallery.alignleft {
    float: left;
    margin: 0.5em 1.5em 1em 0;
}

.entry-content.post-content .wp-block-gallery.alignright,
.post-content .wp-block-gallery.alignright,
.editor-styles-wrapper .wp-block-gallery.alignright {
    float: right;
    margin: 0.5em 0 1em 1.5em;
}

.entry-content.post-content .wp-block-gallery.aligncenter,
.post-content .wp-block-gallery.aligncenter,
.editor-styles-wrapper .wp-block-gallery.aligncenter {
    margin-left: auto;
    margin-right: auto;
}

.entry-content.post-content .wp-block-pullquote.alignleft,
.post-content .wp-block-pullquote.alignleft,
.editor-styles-wrapper .wp-block-pullquote.alignleft {
    float: left;
    max-width: 420px;
    margin: 0.5em 1.5em 1em 0;
}

.entry-content.post-content .wp-block-pullquote.alignright,
.post-content .wp-block-pullquote.alignright,
.editor-styles-wrapper .wp-block-pullquote.alignright {
    float: right;
    max-width: 420px;
    margin: 0.5em 0 1em 1.5em;
}

.entry-content.post-content .wp-block-buttons.alignleft,
.post-content .wp-block-buttons.alignleft,
.editor-styles-wrapper .wp-block-buttons.alignleft {
    float: left;
    margin: 0.5em 1.5em 1em 0;
}

.entry-content.post-content .wp-block-buttons.alignright,
.post-content .wp-block-buttons.alignright,
.editor-styles-wrapper .wp-block-buttons.alignright {
    float: right;
    margin: 0.5em 0 1em 1.5em;
}

.entry-content.post-content .wp-block-buttons.aligncenter,
.post-content .wp-block-buttons.aligncenter,
.editor-styles-wrapper .wp-block-buttons.aligncenter {
    text-align: center;
}

/* ------------------------------------------------------------------ */
/* Classic [gallery] shortcode                                        */
/* ------------------------------------------------------------------ */

.entry-content.post-content .gallery,
.post-content .gallery,
.editor-styles-wrapper .gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
    clear: both;
}

.entry-content.post-content .gallery-item,
.post-content .gallery-item,
.editor-styles-wrapper .gallery-item {
    margin: 0;
    text-align: center;
}

.entry-content.post-content .gallery-icon img,
.post-content .gallery-icon img,
.editor-styles-wrapper .gallery-icon img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ------------------------------------------------------------------ */
/* Block text alignment utility classes                                 */
/* ------------------------------------------------------------------ */

.entry-content.post-content .has-text-align-left,
.post-content .has-text-align-left,
.editor-styles-wrapper .has-text-align-left {
    text-align: left;
}

.entry-content.post-content .has-text-align-center,
.post-content .has-text-align-center,
.editor-styles-wrapper .has-text-align-center {
    text-align: center;
}

.entry-content.post-content .has-text-align-right,
.post-content .has-text-align-right,
.editor-styles-wrapper .has-text-align-right {
    text-align: right;
}

/* ------------------------------------------------------------------ */
/* Clear floats after aligned media                                     */
/* ------------------------------------------------------------------ */

.entry-content.post-content::after,
.post-content::after,
.editor-styles-wrapper::after {
    content: "";
    display: table;
    clear: both;
}
