/* Public rendering for HTML produced by the Summernote article editor. */
.article-content {
    display: flow-root;
    overflow-wrap: anywhere;
}

/* frontpage.css sets `.dm-frontpage a { color: inherit; text-decoration:
   none; }` site-wide, which flattens in-body links (e.g. "Buy on Amazon")
   into plain body text. Brand them pink here instead, scoped to article
   content only so nav/header/button links elsewhere keep their own
   styling — uses frontpage.css's --pink custom property so both stay in
   sync if the brand color ever changes. */
.article-content a {
    color: var(--pink, #f4517b);
    text-decoration: underline;
}

.article-content a:hover,
.article-content a:focus-visible {
    color: var(--pink-dark, #e83c68);
}

.article-content::after {
    display: table;
    clear: both;
    content: "";
}

.article-content img {
    max-width: 100%;
    height: auto;
}

.article-content figure.image {
    display: table;
    max-width: 100%;
    margin: 1rem auto;
}

.article-content figure.image img {
    display: block;
}

.article-content figure.image figcaption {
    display: table-caption;
    padding: .5rem .75rem;
    caption-side: bottom;
    color: #6c757d;
    font-size: .875rem;
    line-height: 1.4;
    text-align: center;
}

.article-content :is(img, figure).alignleft,
.article-content :is(img, figure.image)[style*="float: left"],
.article-content :is(img, figure.image)[style*="float:left"] {
    float: left;
    margin: .25rem 1.5rem 1rem 0;
}

.article-content :is(img, figure).alignright,
.article-content :is(img, figure.image)[style*="float: right"],
.article-content :is(img, figure.image)[style*="float:right"] {
    float: right;
    margin: .25rem 0 1rem 1.5rem;
}

.article-content :is(img, figure).aligncenter,
.article-content :is(img, figure.image)[style*="margin-left: auto"][style*="margin-right: auto"],
/* The editor's "align center" button (admin/articles/_form.blade.php) sets
   the `margin` shorthand rather than separate margin-left/margin-right
   longhands, so it never matched the selector above — center-aligned
   images fell back to their default left-of-text position on the public
   page. */
.article-content :is(img, figure.image)[style*="margin: 1rem auto"] {
    float: none;
    display: block;
    margin: 1rem auto;
}

@media (max-width: 575.98px) {
    .article-content :is(img, figure).alignleft,
    .article-content :is(img, figure).alignright,
    .article-content :is(img, figure.image)[style*="float: left"],
    .article-content :is(img, figure.image)[style*="float:left"],
    .article-content :is(img, figure.image)[style*="float: right"],
    .article-content :is(img, figure.image)[style*="float:right"] {
        float: none;
        margin: 1rem auto;
    }
}
