Donald Trump lost Tuesday. Bigly.

He wasn’t on the ballot in Virginia but make no mistake, he’s the reason the race turned out like it did.

In a normal year, Democrat Ralph Northam would not have won as easily as he did.

In a normal year, Northam may not have won at all.

Four years ago, Terry McAuliffe won with just under 48 percent of the vote in a three-way race. Even then, McAuliffe barely scraped by against Ken Cuccinelli, a polarizing figure who turned off many moderate voters.

This time around, Republican Ed Gillespie was as mainstream a Republican as you’d find. He seemed well-positioned to win back the suburban moderates who first defected from Cuccinelli and then recoiled from Trump a year ago. And yet none of that seemed to matter, not with Virginia voters feeling the way they do about Trump.

They didn’t vote for Trump a year ago and in exit polls Tuesday they made it clear they liked him even less. In the only poll that matters — the one held at the ballot box — voters went for Democrats in a way that seems impossible to explain except as a reaction to Trump.

Northam’s percentage margin was the biggest for a Democratic candidate for governor since Gerald Baliles in 1985. His raw vote margin was the biggest ever.

It’s not just that the Democrats swept the three statewide races— with Justin Fairfax becoming the state’s second African-American lieutenant governor and Mark Herring winning re-election as attorney general. Democrats also made astounding gains in the House of Delegates, and might win back control of the chamber for the first time since 1999. Nobody — at least nobody you’d take seriously — predicted that could happen.

Democrats needed to pick up 17 seats, which seemed in surmountable number — yet they won 13 with six others still too close to call Tuesday night. Even if they fall short, the dynamics in the General Assembly will be very different come January. Medicaid expansion might yet happen.

In the night’s biggest shocker, a transgender candidate even upset Del. Bob Marshall of Manassas, the state’s most vocal Republican legislator on cultural issues. The Democratic wave didn’t spare moderate Republicans either. Del. Joseph Yost, R-Giles County, was perhaps the most atypical Republican around, but even he was upset by Democrat Chris Hurst, the former newscaster. Democrats once again have something that was previously thought nearly impossible — a legislator from west of Roanoke (even if the New River Valley isn’t very far west).

This was no ordinary night. ...It’s instructive to look at where and how the Democrats won, because the results give more shape to a Virginia that we’ve long known was changing, but now is changing perhaps more dramatically.

In rural Virginia, we saw Republicans continue to grow their share of the vote while the Democratic share continued to dwindle.

Look at Buchanan County in the coalfields. In the 1980s, Democrats often took 65 percent of the vote there. That percentage shrank over the years but as recently as 2005, Democrat Tim Kaine carried Buchanan with 52 percent of the vote. Four years ago, though, McAuliffe took just 30 percent of the vote.

It turns out that wasn’t the floor. Hillary Clinton polled just 18.6 percent of the vote there last fall. On Tuesday, Northam took 23 percent. You can look at that two ways: He ran slightly better than Clinton did, or his showing was poorer than McAuliffe.

Either way, Northam wasn’t really a factor in rural Virginia — even though he grew up in a rural area and had a military background that in another time might have played well with rural voters.

One of Northam’s signature issues was a proposal to expand the University of Virginia’s College at Wise to create a bigger economic engine in the heart of the coalfields. His electoral reward? None at all. McAuliffe took just 26 percent of the vote in Wise County; Northam ran even worse, at just under 22 percent.

And none of that mattered, because voters in the urban crescent went decisively for Northam.

Four years ago, McAuliffe couldn’t even get 50 percent of the vote in Loudoun County, carrying it by 3,905 votes. This year, Northam took nearly 60 percent of the vote in Loudoun County, with a margin of 23,432 votes.

Look at Prince William County, another suburban bellwether. McAuliffe took 52 percent of the vote there, for a margin of 8,010 votes. Northam won the county with almost 61 percent, and a margin of 24,673 votes.

Republicans simply can’t win in Virginia if they’re losing in northern Virginia by margins like that. There just aren’t enough votes in rural Virginia to make that up, even if Gillespie did win many rural localities with a Trump-like share of the vote, often 70 percent or more.

Going forward, Republicans will need to figure out that puzzle. Gillespie thought he had the key — emphasize tax cuts to bring back the suburbs while invoking cultural issues to energize Trump voters.

The latter might have worked in rural areas, but clearly did not in northern Virginia. This is perhaps a landmark moment. Exit polls — and pre-election polls — showed that voters overwhelmingly favored keeping Confederate monuments in place. Northam said they should come down; Gillespie rallied to their defense.

Either the Confederate issue simply didn’t matter that much to many voters — or Gillespie’s embrace of it backfired in northern Virginia.

Trump acolytes will no doubt say Gillespie didn’t go far enough in embracing Trump. There is zero evidence in these returns to support that argument. Instead, what we see is that voters — especially in northern Virginia — wanted to cast a vote against Trump and took that out against the nearest Republicans they could find, whether they deserved it or not.

It’s unclear how Republicans disentangle themselves from Trump, but the Virginia results make it very clear he is an electoral problem for them heading into the 2018 mid-terms.

With either candidate, Virginia would have found itself with a competent chief executive. In Northam, we have one who — at least temporarily — will become something of a national star. Northam seems too level-headed to get excited about that, and that’s a good thing.

He might have expected to win, but he surely didn’t expect to bring in this many Democratic delegates with him. Richmond will be a different place, and we suspect Washington may be too.

Outbrain