The bad news for Republicans came last November, when they lost the Virginia gubernatorial race to an eminently beatable Terry McAuliffe. The good news is that the Democrats didn’t crack the code for off-year elections. Nor did the Democrats come up with the perfect message. According to some detailed analysis by Dave Wasserman of the Cook Political Report, the GOP just chose the wrong candidate at the wrong time:

Virginia gubernatorial candidates Terry McAuliffe, left, and Republican Ken Cuccinelli, II participate in a debate. (Nikki Kahn/The Washington Post) Terry McAuliffe, left, and Ken Cuccinelli in a Virginia gubernatorial debate last fall. (Nikki Kahn/The Washington Post)

Until 2013, the white-collar inhabitants of Virginia’s wealthiest enclaves were a dependably GOP bunch. In 2009, voters making over $100,000 a year were 32 percent of Virginia’s electorate and voted for Republican gubernatorial candidate Bob McDonnell 58 percent to 42 percent. In 2012, they were 34 percent of all voters and voted for Republican presidential candidate Mitt Romney 51 percent to 47 percent.

In 2013, these wealthy voters ballooned to an astounding 40 percent of the electorate — and they abandoned the Republican candidate, [Ken] Cuccinelli, voting for McAuliffe 49 percent to 43 percent. . . . Even though Cuccinelli actually won a higher share of votes than Romney did statewide, he badly under-performed Romney in the wealthiest precincts.

Why did Cuccinelli underperform? One explanation is that those wealthier suburbs were disgusted with the government shutdown associated with right-wing Republicans. Cuccinelli tried to distance himself from the stunt but didn’t succeed. Wasserman also cites Cuccinelli’s ideological rigidity. (“It’s not shocking that Cuccinelli, who investigated [University of Virginia] climate scientists and held a rally with professional right-wing provocateur Mark Levin weeks before the election, alienated Virginia’s upper crust.”) In short, Virginia’s suburbs are defined by their moderation, and Cuccinelli personified immoderation.

There are a few lessons here for Republicans. Don’t shut down the government or try other maneuvers that alienate natural constituents who expect stable and functioning government. Don’t nominate candidates defined by staunch social issues if you are running in a heterogeneous area in which diverse voters believe in tolerance and compromise.

The good news for Republicans is that their elected officials seem determined not to run the ship of state aground once more. And they seem to be favoring more mainstream candidates. Moreover, as Wasserman writes, “Very few competitive House and Senate races will take place in states and districts where voters making more than $100,000 comprise anywhere near two-fifths of the electorate. . . . For Democrats, the real concern for 2014 isn’t [wealthy suburbs], but instead the lower-income demographic melting pots that turn out strongly and give Democrats more than 70 percent of the vote in presidential years, but seem to fall asleep in off-year elections.”

Democrats need to whip up their base. Their extreme agenda and fiery language may turn off these same suburban voters. Provided Republicans offer reasonable alternatives, these voters should “return home” to the GOP. We’ll see how it works in practice.