The rise of an intellectual elite in medieval Europe