/**
 * STEP3068 — ordinary post reading rhythm (public + Post Editor).
 *
 * Bounded to direct prose/heading blocks of ordinary posts. The stylesheet
 * does not descend into Custom HTML, tables, cards, charts, calculators,
 * embeds or DBLM-owned Player UI. User-supplied inline values still win.
 *
 * The Design System continues to own line-height via
 * --fpsj-setting-editorial-line-height. Balanced now supplies 1.90;
 * Compact/Spacious/Custom retain their independently selected values.
 */
.fpsj-theme.fpsj-reading-mode-light:not(.fpsj-layout-app)
.fpsj-article-shell--editorial .wp-block-post-content {
  --fpsj-reading-paragraph-gap:1.75rem;
  --fpsj-reading-h2-before:3rem;
  --fpsj-reading-h3-before:2.3rem;
  --fpsj-reading-heading-after:1rem;
  --fpsj-reading-heading-line-height:1.38;
}

/* Direct editorial prose only; no descendant blanket rule. */
.fpsj-theme.fpsj-reading-mode-light:not(.fpsj-layout-app)
.fpsj-article-shell--editorial .wp-block-post-content > :where(p,ul,ol,.wp-block-paragraph,.wp-block-list) {
  line-height:var(--fpsj-setting-editorial-line-height,1.90);
  margin-block:0;
}

.fpsj-theme.fpsj-reading-mode-light:not(.fpsj-layout-app)
.fpsj-article-shell--editorial .wp-block-post-content > :where(p,ul,ol,.wp-block-paragraph,.wp-block-list)
+ :where(p,ul,ol,.wp-block-paragraph,.wp-block-list) {
  margin-block-start:var(--fpsj-reading-paragraph-gap,1.75rem);
}

.fpsj-theme.fpsj-reading-mode-light:not(.fpsj-layout-app)
.fpsj-article-shell--editorial .wp-block-post-content > :where(h2,h3,h4,.wp-block-heading) {
  line-height:var(--fpsj-reading-heading-line-height,1.38);
  margin-block-end:var(--fpsj-reading-heading-after,1rem);
}

.fpsj-theme.fpsj-reading-mode-light:not(.fpsj-layout-app)
.fpsj-article-shell--editorial .wp-block-post-content > :where(h2,.wp-block-heading:where(h2)) {
  margin-block-start:var(--fpsj-reading-h2-before,3rem);
}

.fpsj-theme.fpsj-reading-mode-light:not(.fpsj-layout-app)
.fpsj-article-shell--editorial .wp-block-post-content > :where(h3,h4,.wp-block-heading:where(h3,h4)) {
  margin-block-start:var(--fpsj-reading-h3-before,2.3rem);
}

/* A heading's following paragraph/list consumes the heading's bottom gap,
 * rather than adding a second block gap on top of it. */
.fpsj-theme.fpsj-reading-mode-light:not(.fpsj-layout-app)
.fpsj-article-shell--editorial .wp-block-post-content > :where(h2,h3,h4,.wp-block-heading)
+ :where(p,ul,ol,.wp-block-paragraph,.wp-block-list) {
  margin-block-start:0;
}

/* Post Editor canvas: same values, without affecting controls or Site Editor. */
.editor-styles-wrapper .is-root-container {
  --fpsj-reading-paragraph-gap:1.75rem;
  --fpsj-reading-h2-before:3rem;
  --fpsj-reading-h3-before:2.3rem;
  --fpsj-reading-heading-after:1rem;
  --fpsj-reading-heading-line-height:1.38;
}

.editor-styles-wrapper .is-root-container > :where(p.wp-block-paragraph,ul.wp-block-list,ol.wp-block-list,[data-type="core/paragraph"],[data-type="core/list"]) {
  line-height:var(--fpsj-setting-editorial-line-height,1.90);
  margin-block:0;
}

.editor-styles-wrapper .is-root-container > :where(p.wp-block-paragraph,ul.wp-block-list,ol.wp-block-list,[data-type="core/paragraph"],[data-type="core/list"])
+ :where(p.wp-block-paragraph,ul.wp-block-list,ol.wp-block-list,[data-type="core/paragraph"],[data-type="core/list"]) {
  margin-block-start:var(--fpsj-reading-paragraph-gap,1.75rem);
}

.editor-styles-wrapper .is-root-container > :where(h2.wp-block-heading,h3.wp-block-heading,h4.wp-block-heading,[data-type="core/heading"]) {
  line-height:var(--fpsj-reading-heading-line-height,1.38);
  margin-block-end:var(--fpsj-reading-heading-after,1rem);
}
.editor-styles-wrapper .is-root-container > :where(h2.wp-block-heading,[data-type="core/heading"]:has(h2)) {
  margin-block-start:var(--fpsj-reading-h2-before,3rem);
}
.editor-styles-wrapper .is-root-container > :where(h3.wp-block-heading,h4.wp-block-heading,[data-type="core/heading"]:has(h3,h4)) {
  margin-block-start:var(--fpsj-reading-h3-before,2.3rem);
}
.editor-styles-wrapper .is-root-container > :where(h2.wp-block-heading,h3.wp-block-heading,h4.wp-block-heading,[data-type="core/heading"])
+ :where(p.wp-block-paragraph,ul.wp-block-list,ol.wp-block-list,[data-type="core/paragraph"],[data-type="core/list"]) {
  margin-block-start:0;
}
