Determinants of social capital: New evidence on religion, diversity and structural change