A federal judge in Alaska has overturned U.S. President Donald Trump's attempt to open vast areas of the Arctic and Atlantic oceans to oil and gas leasing.