/* Lametino Paragraphs 1.1.1: optional photograph presentation only.
   Compatibility with the unchanged original Lametino user.css is deliberate.
   Its old first-photo selectors have higher specificity than a simple class.
   Restore the legacy lead typography rather than enable reading typography.
   A textual sibling next to an only-child IMG must never remain font-size:0.
   This visibility repair also applies to a protected first paragraph; its
   spacing opt-out is respected below. */
:is(body, section).view-article .com-content-article .com-content-article__body > p:first-of-type:has(> img:only-child:not([style*="float"])) {
    font-size: 18.5px !important;
    line-height: 1.7 !important;
}
/* Remove the legacy 24/6px special case from ordinary/mixed paragraphs.
   Pure photographs receive the intended 24/18px only after strict JS checks.
   Keep markers preserve existing spacing, but never the font-size:0 bug. */
:is(body, section).view-article .com-content-article .com-content-article__body > p:first-of-type:has(> img:only-child:not([style*="float"])):not([data-lam-layout-keep]),
:is(body, section).view-article .com-content-article .com-content-article__body > p:first-of-type:has(img:not([style*="float"])):not(:has(> img:only-child)):not([data-lam-layout-keep]) {
    margin-top: 0 !important;
    margin-bottom: 1.3em !important;
}
.view-article .com-content-article > .com-content-article__body > p.lam-layout-photo {
    margin: 0 0 18px !important;
    padding: 0;
    line-height: 1.75 !important;
}
/* Equal legacy selector plus body/own class: !important and later loading
   alone cannot override the original :first-of-type/:has specificity. */
:is(body, section).view-article .com-content-article .com-content-article__body > p.lam-layout-photo:first-of-type:has(> img:only-child:not([style*="float"])),
:is(body, section).view-article .com-content-article .com-content-article__body > p.lam-layout-photo:first-of-type:has(img:not([style*="float"])):not(:has(> img:only-child)) {
    margin-top: 24px !important;
    margin-bottom: 18px !important;
    line-height: 1.75 !important;
}
.view-article .com-content-article > .com-content-article__body > p.lam-layout-photo img {
    display: block;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
}
/* JS accepts these breaks only when they have no attributes and the paragraph
   contains one photograph and no text. Keep the saved HTML/DOM intact while
   preventing the editor's empty lines from adding height above/below the photo. */
.view-article .com-content-article > .com-content-article__body > p.lam-layout-photo > br {
    display: none !important;
}
.view-article .com-content-article > .com-content-article__body > p.lam-layout-photo-gap {
    display: none !important;
}
@media (max-width: 768px) {
    :is(body, section).view-article .com-content-article .com-content-article__body > p:first-of-type:has(> img:only-child:not([style*="float"])) {
        font-size: 17px !important;
    }
}
