Macron pledges billions for climate after Greens make gains