Eliza Bordley looks out the window while waiting to vote at the Durham School of the Arts in Durham, N.C., on March 15. (Kaitlin Mckeown/The Herald-Sun via Associated Press)

Republicans belong to a more ideological party, but ideology has mattered less in the GOP primaries this year than in the race between Hillary Clinton and Bernie Sanders.

Clinton is in a nearly unassailable position to win her party’s nomination. But assuming she prevails, her primary fight with Sanders has underscored weaknesses she will have to deal with to win in November.

And Donald Trump’s moves toward moderation on social issues last week reflect not only his campaign’s understanding that he cannot win as a far-right candidate but also his need to tread carefully to maintain the crazy-quilt coalition he has built in the GOP primaries.

New York and Massachusetts Republicans are quite different from the ones found in Alabama, Arkansas and Tennessee. Trump carried all five states, bringing together some of the most extreme voters on the right end of his party with a large share of those who consider themselves moderate.

As the 2016 primaries reach their decisive moment, the results so far point to a scrambling of alliances inside both parties.

Republican presidential candidates Ted Cruz and John Kasich sent out near-simultaneous statements announcing a collaborative effort to block rival and front-runner Donald Trump in Indiana, Oregon and New Mexico's primaries. (Jenny Starrs/The Washington Post)

To earn her delegate lead, Clinton has built a significantly different coalition in 2016 than she did in 2008. The most important and obvious shift is among African Americans, who formed Barack Obama’s base against her eight years ago and are now Clinton’s most loyal supporters. They will loom large in Tuesday’s primaries, particularly in Maryland and Pennsylvania.

Clinton ran well behind Obama among voters under 30. She’s doing even worse among younger voters this year against Sanders.

She has done well among voters over 45, among those with a strong identification with the Democratic Party, and among the roughly one-third of primary voters who do not identify themselves as liberal (a group that includes many nonwhites). In her New York victory, she carried moderate and conservative Democrats by 2 to 1. But even where she has lost, this group has come her way. In Michigan, for example, she carried the non-liberals 52 percent to 43 percent.

Sanders speaks of increasing participation in Democratic primaries, but turnout this year has not exceeded the admittedly exceptional 2008. He does, however, seem to have mobilized more progressive voters: A comparison of the exit polls with surveys of Democrats nationally suggests that the primary electorate this year is more liberal than is the party as a whole.

Overall, turnout patterns have been mixed. They were down in many of the earliest states, such as New Hampshire, and sharply down in some later states, including Alabama, Texas and Ohio. But 2008 and 2016 turnouts were roughly comparable in other states, including New York, Massachusetts and Wisconsin.

There is another factor in Sanders’s strength that points to a Clinton problem this fall: Even where she has won, she has run poorly among white men. In New York, Sanders got 57 percent of their votes; in Michigan, which Sanders won, he got 62 percent. She has also regularly lost in rural areas.

White men as a whole would likely prefer any Republican over any Democrat this fall, but Clinton would have to find a way to cut her losses. Against Trump, at least, polls suggest she would so overwhelm him among women that she could triumph anyway. This would be less clear if she faced a different Republican.

Democratic presidential candidates Bernie Sanders appeared on three Sunday morning shows on April 24. Sanders said his support for Clinton's nomination is "totally dependent" on whether she takes on a more progressive agenda. (Monica Akhtar/The Washington Post)

An awareness of his need to improve his standing among women may have prompted Trump to insist last week — to the consternation of social conservatives — that the GOP’s traditional platform plank against abortion include exceptions for rape, incest and protecting a mother’s life. He also spoke out against North Carolina’s anti-transgender law.

Trump’s willingness to part with social conservatives (for now, at least) also reflects the ways in which his vote defies the old Republican patterns.

In primary after primary, he has split white evangelical voters with Ted Cruz. At the same time, Trump has performed as well among moderates as he has among conservatives. A partial exception is New York, where Trump ran best among self-described conservatives. But even there, the exit polls still showed him defeating John Kasich narrowly, 46 percent to 42 percent, among moderates.

The failure of both movement conservatives and established Republican politicians to stop Trump so far arises from their inability to imagine that someone could appeal simultaneously to moderates — they see Trump more as a manager and leader who could get things done — and to the party’s most hardcore right-wingers on immigration and race, and also in the ferociousness of his opposition to Obama.

Trump’s GOP foes have six weeks to topple him from his high wire.

Read more from E.J. Dionne’s archive, follow him on Twitter or subscribe to his updates on Facebook.