I believe Minimal’s Heading spacing option only adjusts this:
--heading-spacing
defines the spacing above a heading when it follows a paragraph (defaults to 2.5x paragraph spacing).
For directly under the headings, is seems you need work with the heading margin-bottom and paragraph top margin. Without using negative values (which you can do but probably shouldn’t), you could give this a try:
.markdown-rendered div:has( > :is(p,pre,table,ul,ol)) + div > :is(h1,h2,h3,h4,h5,h6) {
margin-bottom: 5px;
}
.markdown-rendered p {
margin-block-start: 0px;
}
Before:
After:
I haven’t checked every scenario with this, but you can always adjust it (or not use it) if you see any weirdness in other places.