maybe try using css grid, instead of flexbox
as flexbox is really good at doing things in ONE PLANE - that is on one continues row.
it has NO AWARENESS of what comes next!
on the next row.
whereas
CSS Grid, knows the the whole page layout as it dictates the layout.
here is a free course on css grid
and this woman’s work is pretty good.
she speaks quite slow (sometimes) so translation could be easier for you.
this explains using css grid to get white space
this is how to get css grid layout to be arty. and how to fall back for older browsers