/**
 * Framed Minds — single post reading order
 *
 * Target order:
 *   post -> share -> categories -> responses -> related -> newsletter -> join
 *
 * WHY THE DEFAULT RULE MATTERS
 * CSS `order` defaults to 0. An earlier version of this file assigned 1-5 to
 * the children it knew about and left everything else unset — so the moment a
 * new direct child appeared (the relocated CTA block), it inherited order 0 and
 * sorted above the article. The `> *` rule below gives every child a non-zero
 * default, so anything added later lands near the end instead of jumping to
 * the top. Values are spaced by 10 to leave room to insert without renumbering.
 *
 * WHY CSS AND NOT PHP
 * The template parts at the end of content.php are ordered in the PHP override.
 * Comments are not: the parent theme calls comments_template() from its own
 * hooks, outside any file we override, and calling it again would render the
 * thread twice.
 *
 * TRADE-OFF: this changes visual order, not DOM order, so a screen reader still
 * meets Related Articles before Responses.
 */

.single-post #main.site-main {
    display: flex;
    flex-direction: column;
}

/* Safe default — never 0. Unknown children sit late, never above the article. */
.single-post #main.site-main > * {
    order: 45;
}

/* The article, including the FM Share row appended inside the_content. */
.single-post #main.site-main > article {
    order: 10;
}

/* Categories and tags. */
.single-post #main.site-main > .post-meta-wrapper-main {
    order: 20;
}

/* Responses — ahead of Related Articles. The comment form belongs to the piece
   the reader just finished, not after a browse surface. */
.single-post #main.site-main > #comments,
.single-post #main.site-main > .comments-area,
.single-post #main.site-main > .bb-comments-wrap {
    order: 30;
}

.single-post #main.site-main > .post-author-info {
    order: 40;
}

.single-post #main.site-main > .post-related-posts,
.single-post #main.site-main > .bb-related-posts {
    order: 50;
}

/* Newsletter and membership CTAs last — the page should finish the article
   before it asks for anything. */
.single-post #main.site-main > .bb-subscribe-wrap,
.single-post #main.site-main > .fm-post-cta {
    order: 60;
}

/* Belt and braces: if the parent theme's share box ever returns (a theme
   update, or the PHP override lost on reinstall), hide it rather than let it
   collide with the FM Share row again. */
.single-post .author-box-share-wrap.bb-sharing-box {
    display: none !important;
}
