Added support for more advanced media queries (see #5236)