Handle media queries when finding matching CSS rules