RICHMOND, Va. (AP) – President Donald Trump had an outsized effect on Virginia’s primary contests for governor, but not in the ways most people expected. Democratic voters were energized in opposition to Trump and turned out in higher-than-expected numbers Tuesday. But the majority was happy to back the more moderate and establishment-favored Lt. Gov. Ralph Northam over a liberal insurgent who sought to portray his candidacy as the tip of the spear of the anti-Trump resistance.The biggest surprise was on the Republican side, where a well-connected frontrunner who has kept his distance from Trump squeaked out an uncomfortably close victory against a staunch Trump supporter who many viewed as a fringe candidate. Former Republican National Committee Chairman Ed Gillespie barely beat Corey Stewart, who focused his gubernatorial bid on preserving Virginia’s Confederate history.