Republican presidential candidate Ted Cruz loosens his tie while speaking to supporters after a townhall at Mekeel Christian Academy in Scotia, N.Y., on April 7. (Cassi Alexandra/For The Washington Post)

Eight days before Republican voters in the state of New York would award a massive trove of 95 delegates, Ted Cruz was nowhere near the Empire State.

Instead, he was three time zones away in a California ballroom, where supporters applauded as a list of local officials backing Cruz was read to the crowd.

“We give the names and we give them one clap, and if you also want to say Cruz at the same time I will not object,” Michael Schroeder, a Republican dignitary from the area, told the audience.

Cruz’s decision to lavish attention on parochial power brokers 3,000 miles away from the next big contest underscored his novel approach to the final three months of the Republican presidential race: He is effectively creating his own primary calendar, map and ­electorate in hopes of cobbling together enough support to ­prevent front-runner Donald Trump from clinching the nomination outright.

It is a strategy born of necessity for the senator from Texas, who now acknowledges that his best path to the nomination is through a contested convention decided by thousands of little-known activists. With polls showing Cruz running well behind Trump in New York and five other northeastern and Mid-Atlantic states voting in the next two weeks, the pressure for him to make gains elsewhere is intensifying.

You've probably heard the term "Republican establishment" thrown around. What does that actually mean? (Peter Stevenson/The Washington Post)

Cruz is largely looking ahead to May and June contests in California, Indiana and Nebraska, states where his strategists believe the delegate rules and natural political tilts are favorable.

His campaign has beefed up a team dedicated to bird-dogging the arcane state-by-state process of selecting delegates — which Trump is struggling to navigate — assigning each delegate to a dedicated campaign staffer for support. Cruz is also wooing new donors to ease the financial strains of a lengthy campaign with significant travel costs.

[Cruz likely to block Trump on a second ballot at the GOP convention]

At the heart of his mission is one goal: keeping Trump from getting to 1,237 delegates, which would seal up the nomination before the GOP convention in Cleveland in late July.

“Let me tell you, in that scenario, I think we will go in with an overwhelming advantage,” Cruz said in a recent speech. “I believe the first ballot will be the highest vote total Donald Trump receives. And on a subsequent ballot, we’re going to win the nomination and earn the majority.”

Trump’s strategy is essentially the mirror of Cruz’s: to clinch the nomination by racking up a majority in pledged delegates by the time the last states vote in June. The Manhattan billionaire is also moving to beef up his ground operation by bringing more seasoned professionals into his inner circle. Trump would have to perform better than he has up to now to guarantee a win, but his aides insist he can do so — especially with the favorable contests coming for him this month.

Senior adviser Ed Brookover told reporters in Washington Thursday that Trump was on “a glide path” to the nomination, with the possibility of amassing 1,265 delegates by the convention.

1 of 53 Full Screen Autoplay Close Skip Ad × Presidential hopeful Ted Cruz on the campaign trail View Photos The Texas Republican was the first major presidential candidate to formally declare a bid. Caption Looking back at the Texas senator’s presidential bid. May 3, 2016 Sen. Ted Cruz speaks with his wife, Heidi, by his side during a primary night campaign event in Indianapolis. Cruz ended his presidential campaign, eliminating the biggest impediment to Donald Trump’s march to the Republican nomination. Darron Cummings/AP Buy Photo Wait 1 second to continue.

For Cruz, California — where 172 delegates are at stake on June 7 — is central to his plan. The state GOP awards three delegates to the winner of each congressional district as well as 10 to the statewide winner. “California,” Cruz told the boisterous crowd in Irvine, “is going to determine the Republican nomination.”

The Cruz campaign believes it can energize a Republican base in a state that hasn’t had a leading voice in the GOP presidential primary in decades. It plans to hire additional paid staffers here, and it rolled out dozens of endorsements from local and state officials this week.

The campaign has targeted Orange County, San Diego County, the San Fernando Valley, the rural, agricultural Central Valley, Santa Barbara and San Luis Obispo — the home town of Cruz’s wife, Heidi — as potential reservoirs of support.

His team and supporters are much less optimistic about New York, Trump’s home state. Cruz campaigned there last week and is returning this week for televised town halls. But he is in danger of finishing third behind Trump and Ohio Gov. John Kasich.

Because of the way the New York GOP allocates delegates, however, Cruz could still add to his total even as a distant loser statewide. With that in mind, a pro-Cruz super PAC called Trusted Leadership began airing TV and radio ads in upstate New York on Thursday that attack Kasich and praise Cruz. The anti-Kasich TV ad ties him to President Obama through his support for expanding Medicaid in Ohio.

[With an Orthodox focus, Ted Cruz reaches out to Jewish donors and voters]

Kellyanne Conway, president of Trusted Leadership, said the group plans to air the ads in the Albany, Binghamton, Elmira, Olean, Poughkeepsie, Syracuse, Rochester, Utica-Rome and Watertown areas.

In addition, Conway said the group will be organizing on the ground in those areas as well as in the 7th, 9th and 15th Congressional Districts, which are heavily Democratic areas in New York City. The group believes that the few GOP voters in those districts could be persuaded to support Cruz’s ideological conservatism over Trump’s emotional pitch. They are so rarely targeted, “you can snap people into attention” by speaking to them, Conway said.

“If you’re a Republican in a nearly absolutely Democratic district, you really mean it,” she said.

Between New York on Tuesday and Indiana on May 3, there are few obvious targets for Cruz, whose staunchly conservative pitch appeals primarily to evangelical Christians and tea party activists. One exception is Pennsylvania, which will send most of its delegates to Cleveland unbound to any candidate. Cruz has also said he intends to compete hard in Maryland, but polls there show him trailing Trump badly.

Even as Cruz eyes upcoming contests, his team is deep in the process of influencing who gets to be delegates in states that already have voted. Cruz’s Houston-based delegate team, led by former Virginia attorney general Ken Cuccinelli II, has largely left the process up to activists at the state level who are well-versed in local rules.

If no candidate gets to 1,237 votes on the first ballot in Cleveland, more and more delegates will be freed up to support whomever they like on subsequent ballots. According to a Washington Post analysis, Cruz is already poised to pick up as many as 170 delegates on the second ballot — a number that could make it impossible for Trump to win.

[Cruz derided ‘New York values,’ but now he must face New Yorkers]

Cruz’s Virginia co-chair Shak Hill said local supporters recognized last fall that there was a chance of a contested convention and prepared accordingly, helping identify and elevate staunch Cruz supporters over the hurdles they needed to clear to eventually become delegates.

Now, he is making bullish forecasts in a state where Trump won the primary. “My prediction is that we will come out with 60 to 70 percent voting for Cruz on the second ballot,” Hill said.

One challenge facing Cruz is financial: He has yet to unite top Republican donors opposed to Trump and is burning through cash quickly. But his team has had some success targeting mid-level donors and fundraisers who raked in cash for former candidates such as Jeb Bush, who has introduced Cruz to his former supporters.

Anthony Gioia, a top fundraiser in Buffalo who supported Sen. Marco Rubio of Florida before he suspended his campaign, said Cruz’s team recently won him over at an intimate lunch in New York. The gathering, attended by Cruz national finance chair Willie Langston, included other former Rubio backers, Gioia said.

“Look at what he is doing in terms of focusing on the delegates,” said Gioia, explaining his decision to support Cruz.

George Seay, a Dallas-based investment manager who supported Rubio, said he has also been approached by Cruz. Seay said he is “happily ensconced on the sidelines,” but was impressed by Cruz’s organization, which he described as a “very tightly run, well-oiled campaign machine.”

Charles Foster, a close friend of the Bush family who supported Jeb Bush, has been contacting people in his network to back Cruz. Many had been reluctant, Foster said, but their views shifted in the past few weeks.

“At some point there was a tipping point, now it is pretty stark, the choices,” Foster said. “There does seem to be a consensus now that Ted is the only real alternative to Trump and people that had reservations about that, it’s now pretty black and white.”

Cruz is also rhetorically pivoting to the general election, brushing off Trump as a sore loser and a whiner and painting himself as the only candidate in the race who can prevail in a battle against Democratic front-runner Hillary Clinton. His campaign is also starting to talk about a “center-right coalition” to broaden his appeal. At a meeting of the Republican Jewish Coalition in Las Vegas last weekend, Cruz — who opposes abortion and same-sex marriage — suggested he could work with those opposed to him on those and other hot-button issues.

“Nobody wants to elect a hectoring scold,” he said. “I am not running here to be pastor in chief, I am running to be commander in chief, which is a very, very different job.”

Sullivan reported from Washington.