Altering the spacing on a horizontal rule attached to an inline title or heading

It’s most likely a bottom-border set on the headings creating the underlines. I’d look for that and see what paddings or margins are set (in general) for headings.

There are some variables/properties here, as well, to see what the theme has set: