Donald Trump won the Electoral College by a 306-232 margin, but lost the popular vote by a more than 2 million votes (and still counting) ― more than any previous presidential winner ever has in a split decision. How this happened is a complex story, much more nuanced than most “here’s why Trump won” stories imply.

Almost all of those stories contain a piece of the puzzle, but in order to see the real story you need to consider all of the explanations combined. Neither party has much reason to celebrate the outcome of the 2016 election. Republicans have a demographics problem, and Democrats have a geography problem compounded by turnout issues.

At the state level, the 2016 vote patterns seem to show a sea of red states with blues isolated to the coasts plus Colorado, New Mexico, Minnesota and Illinois. Looking county-by-county, it becomes clear that the divide isn’t just coasts vs. flyover territory; it’s rural-urban. Pockets of blue in the major cities, college towns and a handful of majority-black areas in the South are evident in this view. The New York Times’ graphic below shows just how little actual land area went to Hillary Clinton at the county level: She won 15 percent of the land to Trump’s 85 percent.

Yet declaring the United States a country divided by population density overlooks several trends that are key to understanding Trump’s success. The urban-rural split is nothing new; perhaps it’s more exaggerated in 2016 than before, but we’ve known for a long time that rural areas are conservative and urban areas are liberal. But if we consider gradations ― not just dividing counties by which candidate a majority of voters selected, but shading by the proportion of Trump and Clinton voters in each county ― the story is far less clear.

Here, America. Have some context. This is what you look like. Not that sea of red with little blue islands. pic.twitter.com/nwLKFkzs8T — Adam Smith (@AdamSmith_usa) November 20, 2016

If we can’t blame everything on the rural-urban divide, then what happened? There’s not one single reason why Clinton lost several states where majorities voted for President Barack Obama twice: there are several reasons.

A few, significant, subplots played out in the supposed Democratic “firewall” states of Pennsylvania, Michigan and Wisconsin, and the perennial battleground of Ohio. These states have been close recently, but in 2008 and 2012 Democrats were able to generate support among the rural working class to win over majorities of voters in the states.

But there was a sizable shift in 2016. It’s unclear how many people voted for Trump that had voted for Obama, but Trump did pull a larger percentage of the vote in many counties: more than Mitt Romney did in 2012. That could be in part different groups of voters turning out in 2016 as compared to 2012, but anecdotal stories and survey data reveal that there were some party switchers.

Turnout is part of the picture, though, particularly in Michigan and Wisconsin. As HuffPost previously reported, turnout was down in Detroit’s Wayne County, Michigan and Milwaukee County, Wisconsin, in numbers large enough to swing the election in those states. Clinton received nearly 78,000 fewer votes in Wayne County than Obama did in 2012, and lost Michigan by under 12,000 votes. She underperformed Obama by 39,000 votes in Milwaukee County and lost Wisconsin by just over 27,000 votes.

Similar patterns of lower urban turnout were evident in Philadelphia and other cities in the Midwest. The numbers suggest these people didn’t vote for Trump: they just didn’t vote at all. And according to reports, the Clinton campaign didn’t make concerted efforts to get them to the polls. Many of these nonvoters were likely minorities who Democrats assumed would support the party in large numbers ― which they do, when they vote.

An additional subplot involves suburban areas and white women. Democrats hoped to make gains in these areas, particularly among typically-conservative women who might be turned off by Trump’s actions and rhetoric. That hope proved false. Nationally, suburban areas and white women voted for Trump in very similar proportions to their votes for Romney in 2012. Romney received 50 percent of the suburban vote, and Trump garnered 59 percent. Fifty-six percent of white women voted for Romney, and 52 percent supported Trump.

Nationally, as well as in the Rust Belt, Democrats lost support among the least educated groups. According to the exit polls, education didn’t matter much in 2012: Obama won college graduates by 2 points and non-college graduates by 4 points. Clinton won college graduates by 10 points and lost non-college graduates by 7 points. Relative to Obama’s totals, Clinton gained 2 points among college graduates and lost 7 points among non-college graduates.

The difference is even more stark among whites: Trump won white college graduates by 2 points, but he won white non-college graduates by 37 points. The racial breakdown isn’t provided in the 2012 results, but it’s safe to say there wasn’t that sharp of a divide among whites or there would have been a gap in the overall numbers. Among minorities, Clinton won college graduates by 50 points and non-college graduate by 56 points. Once you account for the educational divide, income doesn’t seem to make a difference in vote choice.

Yet despite all these trends that favored Trump, Clinton won the popular vote by a wider margin than several past presidents. Clinton cut the Republican advantage to around 5 points in the red state strongholds of Arizona and Georgia, and Texas dropped from a 16-point Republican advantage in 2012 to a 9 point win for Trump. California is still counting, but it looks like Clinton blew Trump out by nearly 30 points in the state ― substantially more than Obama’s 23-point win over Romney four years ago.

These results were likely driven by high support for Clinton among minority populations, particularly among Latinos and Hispanics in the Southwest. And although there’s some dispute over just how strongly that group supported Clinton, the most conservative estimates from the National Exit Polls indicate that Clinton won Latinos by 36 points. Other pre-election polls show even stronger Democratic leanings among the group.

Republicans also struggled with black voters. Trump’s 8 percent support is actually slightly more than Mitt Romney’s 6 percent in 2012, but slightly less than George W. Bush’s support among black voters in 2000 and 2004. Black turnout was slightly lower this year compared to 2012 as well, which helped states like Georgia stay red. An uptick in turnout among a group that so heavily favors Democrats has considerable potential to shift those states.

The problem is that none of these states actually switched directions. Had Clinton won Arizona’s 11 electoral votes and Georgia’s 16 electoral votes, she still would have been short of the 270 mark, but it would have compensated for the losses in Michigan and Wisconsin, which combine for 26 electoral votes. But neither state appears as close to turning blue as some polls had indicated. So these gains meant nothing for the Electoral College, which is what really matters.

To state the obvious, as long as the Electoral College determines the winner, Democrats can’t rely on increasing support in already-blue states, and it seems that key red states aren’t ready to flip yet. The best strategy for 2020 will be to focus on the very narrow losses in the Rust Belt and win those voters back ― which probably means convincing them that Democrats are a better option for improving their economy than Republicans. Democrats clearly lost that battle this year.

Meanwhile Republicans will try to hold onto those gains and build their very fragile coalition that won the Electoral College. Whether it survives beyond 2016 is anyone’s guess. The Obama coalition didn’t outlast Obama, but the Trump coalition might not survive Trump.