Francesco Bagnaia claims an important pole position as he looks to regain the title lead from Martin.