/* SWELL nested-section paragraph spacing, v1.0.0
 * The article body already contains semantic <p> elements. SWELL often sets
 * block spacing for direct children only; text in nested article sections
 * can appear visually stuck together. This is a presentation-only fix.
 * No .cse-affiliate-cta, buttons, figures, tables or FAQ cards are changed.
 */
body.single .post_content section > p + p,
body.page .post_content section > p + p,
body.single .post_content .cap_box_content > p + p,
body.page .post_content .cap_box_content > p + p,
body.single .post_content .wp-block-group__inner-container > p + p,
body.page .post_content .wp-block-group__inner-container > p + p {
  margin-block-start: 1.25em !important;
}
body.single .post_content section > :is(ul,ol,blockquote,figure,.cse-table-scroll,.cse-comparison-table) + p,
body.page .post_content section > :is(ul,ol,blockquote,figure,.cse-table-scroll,.cse-comparison-table) + p {
  margin-block-start: 1.2em !important;
}
body.single .post_content section > :is(h2,h3,h4) + p,
body.page .post_content section > :is(h2,h3,h4) + p {
  margin-block-start: 0.75em !important;
}
body.single .post_content section > p + :is(ul,ol,blockquote),
body.page .post_content section > p + :is(ul,ol,blockquote) {
  margin-block-start: 0.85em !important;
}
/* Add a little separation when a source note directly follows the explanation. */
body.single .post_content section > p:has(> strong:first-child) + p:has(> strong:first-child),
body.page .post_content section > p:has(> strong:first-child) + p:has(> strong:first-child) {
  margin-block-start: 1.5em !important;
}
/* Keep body text calm and readable; do not override a user's theme size. */
body.single .post_content section > p,
body.page .post_content section > p {
  line-height: 1.9;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  body.single .post_content section > p + p,
  body.page .post_content section > p + p,
  body.single .post_content .cap_box_content > p + p,
  body.page .post_content .cap_box_content > p + p {
    margin-block-start: 1.15em !important;
  }
}

/* Narrative section headings need gaps even when they follow a table or list. */
body.single .post_content section > :is(.cse-table-scroll,table,ul,ol,figure,blockquote,p) + :is(h2,h3,h4),
body.page .post_content section > :is(.cse-table-scroll,table,ul,ol,figure,blockquote,p) + :is(h2,h3,h4) {
  margin-block-start: 1.75em !important;
}
body.single .post_content section > p + :is(.cse-table-scroll,table,figure),
body.page .post_content section > p + :is(.cse-table-scroll,table,figure) {
  margin-block-start: 1.1em !important;
}
/* Do not create overly large gaps below the inline comparison buttons. */
body.single .post_content section.cse-conversion-quick > p,
body.page .post_content section.cse-conversion-quick > p {
  line-height: 1.75;
}
