Band gap crossover and insulator–metal transition in the compressed layered CrPS4