A theory for particle size segregation in shallow granular free-surface flows