if a rule has a media property, loop over its contents instead, wrapping each scoped rule with a media query