Kevin Lamarque / Reuters

Democrats are locked out of power in Washington after losing the White House and failing to win back Congress. Hillary Clinton’s defeat has left the party without a unifying leader, and its hold on state legislatures has eroded significantly during President Obama’s time in office. But as bleak as current circumstances are for the Democratic party, the political landscape ahead may be even more challenging.

To start, Democrats must confront what looks like a punishing Senate map in 2018. The party that controls the White House tends to lose congressional seats in midterm elections, but it seems unlikely that Democrats will regain control of the Senate two years from now, much less the House of Representatives. Republicans significantly outnumber Democrats in the House, and only need to protect eight Senate seats in 2018 while Democrats must defend twenty-five seats.

Adding to the challenge, Democrats have senators up for reelection in states Donald Trump won by double digit margins such as North Dakota, West Virginia, Montana, Indiana and Missouri. Those aren’t the only perilous races: Democratic incumbents also need to defend Senate seats in Ohio, Pennsylvania, Michigan, Wisconsin, and Florida, states that voted for Obama in two presidential elections before switching to vote for Trump. “There’s no question the map will be extremely difficult for Democrats,” said Brad Bannon, a Democratic strategist and president of Bannon Communications.

That doesn’t mean Democrats can’t recover. The party has won the popular vote in six of the last seven presidential elections, and evidently has a dedicated base of popular support. Democrats will more credibly be able to run on a platform promising change after being shut out of government. And if Trump is unpopular with voters by the time the 2018 elections take place, they may also be able to capitalize on public resentment of the administration to win races. “The general mood may grow more favorable for Democrats as we get further into a Trump administration,” Bannon added. “I don’t think it’s time for Democrats to wring their hands and despair.”

A central challenge facing Democrats is whether they can hold together the diverse coalition of voters that propelled Obama to the presidency while making inroads with the white working-class voters who turned out in support of Trump. The answer may depend on how, and how much, Democrats oppose the incoming administration, and if the party can deliver a compelling and cohesive message about what it stands for. That task will be complicated by the fact that Democrats running races in states Trump won will feel pressure to find common ground with Republicans.

As Democrats engage in soul-searching and prepare for the battles ahead, the party will also need to consider whether the political map is in the process of being re-drawn. The electoral map is always in flux to some extent. But it remains to be seen whether Republican gains in the industrial midwest and the rust belt can be reversed during the course of Trump’s presidency, or whether they are a sign of increasing GOP dominance in those parts of the country in the years to come.

It’s possible that some states may be slipping away from Democrats. Wisconsin, Michigan, and Pennsylvania along with Iowa and Minnesota are all states that have “watched their Democratic leans evaporate over the last thirty years,” Brandon Finnigan, the director of the non-partisan election site Decision Desk HQ, wrote in an e-mail. “This doesn’t mean a Democrat won’t win these states ever again, or that Republicans have a lock on them. But they’ve red-shifted,” he said, adding that despite the state’s track record of voting for Democrats in presidential elections, “it’s just a matter of time” before even Minnesota breaks for the Republican candidate in a presidential race.

It won’t necessarily be easy for Democrats to win back voters that once supported Obama and then voted for Trump. In some parts of the country, “voters stampeded to Trump. They didn’t just move to Trump. They ran to Trump,” Finnigan said in an interview, adding: “It would take a massive event for them to come stampeding back in a cycle.” That dynamic could frustrate Democrats hoping to swiftly reverse the losses the party sustained in the presidential election.

That doesn’t mean there aren’t bright spots in the electoral map for Democrats. It might be possible for Democrats to pick up a Senate seat in Nevada, a state that Clinton won where Republican Senator Dean Heller faces re-election in 2018. Arizona, where Republicans will have to defend GOP Senator Jeff Flake’s seat in 2018, may be another potential battleground state. New Mexico and Illinois, states that Clinton won that have Republican governors, also have gubernatorial races in 2018.

National races typically receive more attention, but state races may be even more significant for rebuilding the Democratic party in the near future. The stakes are high given that most state legislatures will have control over redrawing congressional and state legislative maps following the 2020 U.S. Census. “I would expect to see a huge battle for control of state legislatures leading up to 2020 and redistricting,” said Michael Li, a senior counsel for the Brennan Center’s Democracy Program.

If Democrats win back state legislatures and governor’s mansions ahead of the census, the party will have more sway over the next round of redistricting. That, in turn, might make the difference between the party remaining locked out of control of the House of Representatives or winning it back. Electing more Democrats at the state level would also help develop talent within the party and set the stage for a larger field of candidates who might one day compete for national office.

For now, however, the outlook is grim for Democrats. According to the National Conference of State Legislatures, Republicans have control of both state houses as well as the governor's mansion in twenty four states, while Democrats have total control in only seven states in the wake of the 2016 elections.

The extent to which the party’s power has eroded at the state and national level makes the the task of rebuilding all the more urgent for Democrats. It also makes the task far more difficult. Tough odds may convince some demoralized Democrats in Congress to retire, altering the match-ups in the 2018 midterm races. But even if that happens, the electoral map will remain challenging for the party. As a result, Democrats should prepare for the possibility that they may face additional setbacks in the near-future that make it even harder to regain a substantial foothold in Washington and statehouses across the country.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.