Thermodynamics of pressure plateaus in metal-hydrogen systems