Theory of covalent-metallic phase transitions of Si, Ge and Sn under pressure