Add media queries to flexible layout