Becoming an Ideologue: Social Sorting and the Microfoundations of Polarization