A theoretical analysis of sex differences in same-sex friendships