/* ============================================================
   22. POST LAYOUT FIX — one full-width content column
   ------------------------------------------------------------
   At 985px+ the parent Twenty Sixteen theme floats
   .entry-content right at 71% and .entry-footer (author/date)
   left at 21%, then its JS tags large photos ".below-entry-meta"
   and pulls them 40% back to the left so they "bleed" under the
   meta column. Inside our white cards that leaves body text
   starting ~115px right of the headline while photos sit
   flush-left. Undo all of it so text, headline and photos share
   the same left edge.
   ============================================================ */
@media screen and (min-width: 61.5625em) {
    body:not(.search-results) article:not(.type-page) .entry-content,
    body:not(.search-results) article:not(.type-page) .entry-summary,
    body:not(.search-results) article:not(.type-page) .entry-footer {
        float: none !important;
        width: 100% !important;
    }

    body:not(.search-results) article:not(.type-page) img.below-entry-meta,
    body:not(.search-results) article:not(.type-page) figure.below-entry-meta {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Reorder the card's children.
   - Twenty Sixteen outputs the featured image AFTER the headline,
     but section 20 bleeds it up 2em to the card edge — so on posts
     with a featured image it was sitting on top of the title. Put
     it first, where that bleed was designed to go.
   - On single posts the byline/date live in .entry-footer, which
     Twenty Sixteen showed as a left column. Now that it is a normal
     block it would drop to the bottom — move it under the headline
     like it is on the blog index. */
article.hentry:not(.type-page) {
    display: flex;
    flex-direction: column;
}
article.hentry:not(.type-page) > .post-thumbnail { order: -1; }
article.hentry:not(.type-page) > .entry-header   { order: 0; }
article.hentry:not(.type-page) > .entry-content,
article.hentry:not(.type-page) > .entry-summary  { order: 2; }
article.hentry:not(.type-page) > .entry-footer   { order: 3; }   /* index: categories stay at the bottom */

.single article.hentry:not(.type-page) > .entry-footer {
    order: 1;
    margin: 0 0 1.5em 0 !important;
}

/* Lay the meta out as one row: avatar + name, date, categories, tags */
.single .entry-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25em 1.5em;
}
.single .entry-footer > span,
.single .entry-footer .author.vcard {
    display: inline-flex !important;
    align-items: center;
    margin: 0 !important;
}
.single .entry-footer .avatar {
    display: inline-block !important;
    width: 32px !important;
    height: 32px !important;
    margin: 0 0.5em 0 0 !important;
    border-radius: 50%;
}
.single .entry-footer .edit-link { margin-left: auto !important; }


/* ============================================================
   23. IN-CONTENT PHOTOS — consistent sizing + wrapping
   ------------------------------------------------------------
   Posts use "align right/left" on large photos that are wider
   than the column, so the float just hangs off the edge with
   zero gap to the text. Large and full-size photos now stack
   full-width and centered; genuinely small ones (medium /
   thumbnail) still float, but with breathing room.
   ============================================================ */
.entry-content figure,
.entry-content .wp-block-image,
.entry-content .wp-caption {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Large / full-size photos: no float, fill the column */
.entry-content figure.size-large,
.entry-content figure.size-full,
.entry-content .wp-block-image.size-large,
.entry-content .wp-block-image.size-full,
.entry-content .wp-caption.size-large,
.entry-content .wp-caption.size-full,
.entry-content figure.alignright.size-large,
.entry-content figure.alignleft.size-large,
.entry-content figure.alignright.size-full,
.entry-content figure.alignleft.size-full {
    float: none !important;
    display: block !important;
    width: 100% !important;
    margin: 1.5em 0 !important;
}

.entry-content figure.size-large img,
.entry-content figure.size-full img,
.entry-content .wp-block-image.size-large img,
.entry-content .wp-block-image.size-full img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-left: auto;   /* a photo resized smaller in the editor
                            (inline width wins) stays centered */
    margin-right: auto;
}

/* Small photos that really are floated: keep the float, restore
   the gap the child theme's "margin: auto" removed. */
.entry-content figure.alignright:not(.size-large):not(.size-full),
.entry-content .wp-block-image.alignright:not(.size-large):not(.size-full),
.entry-content .wp-caption.alignright:not(.size-large):not(.size-full) {
    float: right !important;
    max-width: 50% !important;
    margin: 0.375em 0 1em 1.75em !important;
}
.entry-content figure.alignleft:not(.size-large):not(.size-full),
.entry-content .wp-block-image.alignleft:not(.size-large):not(.size-full),
.entry-content .wp-caption.alignleft:not(.size-large):not(.size-full) {
    float: left !important;
    max-width: 50% !important;
    margin: 0.375em 1.75em 1em 0 !important;
}

/* Phones: nothing floats */
@media (max-width: 600px) {
    .entry-content figure,
    .entry-content .wp-block-image,
    .entry-content .wp-caption {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 1.25em 0 !important;
    }
}

/* Never let a floated photo push the next heading or the
   post footer sideways */
.entry-content h2,
.entry-content h3,
.entry-content::after,
.entry-footer,
.sharedaddy {
    clear: both;
}
.entry-content::after { content: ""; display: table; }
