.dmxts-glow-image {
    position: relative;
    display: block;
    box-sizing: border-box;
    max-width: 100%;
    line-height: 0;
    isolation: isolate;
}

.dmxts-glow-image img {
    box-sizing: border-box;
}

.dmxts-glow-image__main {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.dmxts-glow-image__backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
}

.dmxts-glow-image figcaption {
    position: relative;
    z-index: 3;
    margin-top: .55em;
    line-height: 1.45;
    text-align: center;
}

.dmxts-glow-left {
    margin-left: 0;
    margin-right: auto;
}

.dmxts-glow-center {
    margin-left: auto;
    margin-right: auto;
}

.dmxts-glow-right {
    margin-left: auto;
    margin-right: 0;
}

.dmxts-glow-float-left {
    float: left;
}

.dmxts-glow-float-right {
    float: right;
}

:where(.entry-content, .post-content, .post-entry, .article-content, .hentry):has(.dmxts-glow-image)::after {
    content: "";
    display: table;
    clear: both;
}

@media (max-width: 640px) {
    .dmxts-glow-float-left,
    .dmxts-glow-float-right {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 1em !important;
    }
}

/* Full-width alignment row prevents theme figure rules or editor paragraph
   context from shifting normal left/centre/right images. */
.dmxts-glow-row {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    clear: both !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dmxts-glow-row-left {
    justify-content: flex-start !important;
}

.dmxts-glow-row-center {
    justify-content: center !important;
}

.dmxts-glow-row-right {
    justify-content: flex-end !important;
}

.dmxts-glow-row > .dmxts-glow-image {
    flex: 0 0 auto !important;
    float: none !important;
    margin: 0 !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}


/* Compatibility with older themes that force #content img { width:auto; }.
   The ID selector in those themes is more specific than the plugin classes,
   so the glow image must explicitly reclaim the figure width. */
#content .dmxts-glow-image > img,
#content .dmxts-glow-image > a,
#content .dmxts-glow-image > a > img,
.entry-content .dmxts-glow-image > img,
.entry-content .dmxts-glow-image > a,
.entry-content .dmxts-glow-image > a > img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#content .dmxts-glow-row,
.entry-content .dmxts-glow-row {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
}
