a proper broker runs your margin against your aggregate position regardless how it’s executed. If the position changes, the margin changes.
The occ has a whole list of how Martin is calculated for various option spreads.
here is the rules based margin for interactive brokers...