After pivoting Turkey away from Western allies, President Tayyip Erdogan has changed tack with moves that have pleased the US and upset Russia, a turnaround seen aimed partly at reversing his country’s economic downturn and boosting foreign investment.