/* ==========================================================================
   Body Aesthetics Blog — single post content
   Migrated classic-editor HTML (alignleft / alignright / size-medium) sits
   inline inside Breakdance .bde-text. Without WP alignment CSS the image
   becomes a giant inline character: one line of text beside it, the rest
   dropped underneath. Stack images as blocks so copy stays readable.
   ========================================================================== */

body.single-post .bde-header-builder--sticky {
    background-color: #ffffff !important;
}

body.single-post .bde-text {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

body.single-post .bde-text h1,
body.single-post .bde-text h2,
body.single-post .bde-text h3,
body.single-post .bde-text h4 {
    scroll-margin-top: 96px;
    clear: both;
}

/* ----- Images: no wrap, own row ----- */

body.single-post .bde-text img,
body.single-post .bde-text img.alignleft,
body.single-post .bde-text img.alignright,
body.single-post .bde-text img.aligncenter,
body.single-post .bde-text img.alignnone,
body.single-post .bde-text img.size-medium,
body.single-post .bde-text img.size-full,
body.single-post .bde-text img.size-large,
body.single-post .bde-text img.size-thumbnail {
    display: block !important;
    float: none !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    max-height: min(70vh, 560px) !important;
    object-fit: contain;
    margin: 1.35em auto !important;
    border-radius: 12px;
}

body.single-post .bde-text a:has(img) {
    display: block;
    max-width: 100%;
    text-align: center;
}

body.single-post .bde-text .alignleft,
body.single-post .bde-text .alignright,
body.single-post .bde-text .aligncenter,
body.single-post .bde-text .alignnone {
    float: none !important;
    display: block !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.single-post .bde-text figure,
body.single-post .bde-text .wp-caption {
    display: block;
    float: none !important;
    max-width: 100% !important;
    margin: 1.35em auto;
    text-align: center;
}

body.single-post .bde-text .wp-caption-text,
body.single-post .bde-text figcaption {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #6b6b6b;
}

body.single-post .bde-text iframe,
body.single-post .bde-text video,
body.single-post .bde-text embed {
    display: block;
    max-width: 100%;
    margin: 1.35em auto;
}

/* WP galleries that survived migration */

body.single-post .bde-text .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 1.35em 0;
}

body.single-post .bde-text .gallery-item {
    margin: 0;
    float: none !important;
}

body.single-post .bde-text .gallery img {
    width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: cover;
}

body.single-post .bde-text p:empty {
    display: none;
}

@media (max-width: 599px) {
    body.single-post .bde-text img {
        max-height: min(55vh, 420px) !important;
        border-radius: 10px;
    }
}
