Towards an economic theory of party ideology