complete rewrite using CSS flex boxes