/* Shared editorial rhythm. Keep last in every page's head. Values documented in DESIGN_SYSTEM.md. */
:root{--flow-heading-gap:20px;--flow-subheading-gap:14px;--flow-paragraph-gap:16px;--flow-block-gap:28px;--flow-section-gap:48px}
body main :is(h1,h2)+:is(p,ul,ol,dl){margin-top:var(--flow-heading-gap)}
body main :is(h3,h4)+:is(p,ul,ol,dl){margin-top:var(--flow-subheading-gap)}
body main p+p{margin-top:var(--flow-paragraph-gap)}
body main :is(p,ul,ol,dl)+:is(h2,h3,h4){margin-top:var(--flow-block-gap)}
body main :is(p,ul,ol)+:is(table,figure,form,.catalog-table-wrap,.specialty-table,.ph-three,.ph-services,.topic-grid,.clinical-doctors,.ps-process,.ph-links){margin-top:var(--flow-block-gap)}
body main :is(table,figure,.catalog-table-wrap,.specialty-table,.ph-three,.ph-services,.topic-grid,.clinical-doctors,.ps-process)+:is(p,h2,h3,h4){margin-top:var(--flow-block-gap)}
body main :is(h2,h3,h4)+:is(table,.catalog-table-wrap,.specialty-table,.topic-grid,.ph-three){margin-top:var(--flow-heading-gap)}
body main :is(.ph-heading,.section-heading)+:is(p,.ph-three,.ph-services,.topic-grid){margin-top:var(--flow-heading-gap)}
body main .eyebrow+:is(h1,h2,h3){margin-top:16px}
body main :is(.ph-links,.ph-faq)+:is(.ph-links,p){margin-top:var(--flow-block-gap)}
body main details>summary+p{margin-top:16px}
body main :is(.ps-editorial,.ph-three,.ph-services,.ph-issues,.ps-process) :is(h2,h3)+p{margin-top:var(--flow-subheading-gap)}
@media(max-width:700px){:root{--flow-heading-gap:16px;--flow-subheading-gap:12px;--flow-paragraph-gap:14px;--flow-block-gap:24px;--flow-section-gap:36px}}

/* Component collections use this shared contract in every new template. */
body main :is(h2,h3,h4)+:is(.content-grid,.pc-cards,.pc-reviews,.pc-compare,.pc-steps,.ph-services,.ph-issues,.clinical-doctors,.ps-process){margin-top:var(--flow-heading-gap)}
body main :is(p,ul,ol)+:is(.content-grid,.pc-cards,.pc-reviews,.pc-compare,.pc-steps){margin-top:var(--flow-block-gap)}
body main :is(.content-grid,.pc-cards,.pc-reviews,.pc-compare,.pc-steps)+:is(p,.underline){margin-top:var(--flow-block-gap)}
body main :is(.content-grid,.pc-cards,.pc-reviews,.pc-compare,.pc-steps,.topic-grid,.ph-three,.ph-services,.ph-issues,.clinical-doctors,.ps-process)+:is(h2,h3,h4){margin-top:var(--flow-section-gap)}

/* Structural fallback: section content must not depend on a component class name. */
body main :where(section,article,.content-section,.ph-section)>:is(h2,h3,h4)+:is(div,details,figure,table,nav,ul,ol){margin-top:var(--flow-heading-gap)}
body main :where(section,article,.content-section,.ph-section)>p+div{margin-top:var(--flow-block-gap)}
body main :where(section,article,.content-section,.ph-section)>div+:is(h2,h3,h4){margin-top:var(--flow-section-gap)}
body main :where(section,article,.content-section,.ph-section)>div+p{margin-top:var(--flow-block-gap)}
