Sen. Ted Cruz (R-Tex.), a 2016 presidential candidate, has proposed a constitutional amendment that would allow states to define marriage as only between a man and a woman. (Mary Schwalm/AP)

Republican presidential hopefuls are struggling with how to position themselves on same-sex marriage, an issue that is bedeviling a party hoping to avoid social controversies as the 2016 election approaches.

Rapidly changing public opinion has forced much of the field to recalibrate their pitches. Early front-runners have sought balance between the GOP base and the broader electorate — saying that they have no problem with gay people but oppose a national right to gay marriage and favor strong legal protections for business owners who do not want to serve same-sex ceremonies.

It is a difficult task, with the perils on stark display last month in Indiana. Republican state lawmakers encountered criticism when they tried to strengthen religious-liberties laws in the face of legal same-sex marriage in that state. With support for same-sex marriage hovering around 60 percent nationally, opponents also risk being labeled bigots.

At the same time, some conservative strategists see an upside for candidates who boldly oppose same-sex marriage. In arguments scheduled for Tuesday, the Supreme Court will consider whether there is a constitutional right to same-sex marriage or whether it should be left to the states. If the court establishes a national right as expected, it could energize Christian activists.

The tensions were evident this week when Sen. Ted Cruz (R-Tex.) made headlines at a meet-and-greet hosted by prominent gay New York hoteliers in which he reportedly said he would still love one of his daughters if she came out as gay, and did not discuss his opposition to same-sex marriage.

Under fire from conservatives, he clarified in a news release that he strongly supported “traditional marriage.” On Thursday, he also introduced a pair of bills to amend the Constitution to allow states to define marriage as between a man and a woman, and to forbid courts from intervening.

Cruz’s comment about his daughter at the gathering, first reported by the New York Times, “doesn’t suddenly mean we now support same-sex marriage. They’re different,” Cruz spokesman Rick Tyler said. The distinction, however, could be lost on voters and donors who have begun to view support for same-sex marriage and gay rights as a litmus test for tolerance and modern sensibilities.

Other GOP candidates have tried to tread a similarly fine line. Sen. Marco Rubio (Fla.) has said he opposes same-sex marriage and thinks the decision to legalize such unions should be left to the states. Yet he has been courting the Log Cabin Republicans, a national organization of gay conservatives, and in media interviews has said he would attend a same-sex wedding.

Former Florida governor Jeb Bush, a strident social warrior in office, has since softened his stance, suggesting that Americans should respect “couples making lifetime commitments to each other.” His top political adviser, David Kochel, has advocated for same-sex marriage.

Speaking last week in New Hampshire, Wisconsin Gov. Scott Walker said marriage is “defined as between a man and a woman” and that he would prefer to see states decide on the matter. He also said that, in spite of that position, he has been to a “reception” for a gay family member.

But even careful maneuvering can be perilous. Rebecca Rutter, a Republican voter who attended a Walker event Sunday in Derry, N.H., said in an interview that she worried the candidate was out of step with the times.

“These candidates keep saying ‘states should decide’ without getting into what this means for real people,” she said. “I worry that my party is on the wrong side of history.”

For Republicans, the moment illustrates growing strife within the party’s ranks over the future of the GOP, in both posture and policies. Veteran hands are protective of the party’s long-held positions on marriage and other social issues, while a younger generation of Republicans is eager to move beyond the battlegrounds of their parents.

Jesse Benton, 37, a political confidant of Sen. Rand Paul (R-Ky.), said younger-than-40 Republicans especially are holding back from such fights.

“There is a growing sentiment among [Generation Y members] and millennials, even those who are committed followers of Jesus, that the issue of same-sex marriage should not be political,” he said.

On the stump, Paul has drifted between calls for more personal freedom with concerns about the “moral crisis” of gay marriage.

Some young conservatives want to do more. A group of high-profile younger conservatives, including Meghan McCain, Sen. John McCain’s (R-Ariz.) daughter, and Alex Lundry, former data director for Mitt Romney, are part of a campaign called “Reform the Platform,” which seeks to revamp Republican Party planks viewed as anti-gay.

But their efforts are butting up against the reality that evangelical voters remain a large and influential part of the Republican base — a fact that gets amplified every election season because of their outsize presence in Iowa, which hosts the first-in-the-nation caucuses.

Nodding to the tilt of caucusgoers there, a crowd of conservative Republicans this week have come out strongly for traditional marriage and amped up their rhetoric about what they see as an ideological onslaught from the political left and its allies.

“Christian convictions are under attack as never before,” former Arkansas governor Mike Huckabee said in a conference call Thursday with pastors. He added: “We are moving rapidly toward the criminalization of Christianity.”

Taking to the op-ed pages of the New York Times, Louisiana Gov. Bobby Jindal wrote, “Hollywood and the media elite are hostile to our values and they tip the scales to our liberal opponents at every opportunity.”

Critics of same-sex marriage are also stepping up the pressure on Republican candidates. The demands were visible Friday at a Las Vegas meeting of evangelical pastors hosted by the American Renewal Project, where the pastors grilled Cruz and another potential GOP contender, former Texas governor Rick Perry.

David Lane, a Christian organizer who directs the Renewal project, said Rubio’s comments on the issue were anathema.

“He is being politically correct but theologically incorrect,” Lane said. “I don’t think he is viable within the evangelical community.”

Former Pennsylvania governor Tom Ridge (R) signed a ban on gay marriage into law in his state in 1996 but said in an interview Friday that Republicans should evolve with the country.

“We have become a party that is extraordinarily judgmental about people’s lives, almost moralistic in our tone,” Ridge said. “Instead of talking about jobs and the economy, we’re putting far too much emphasis on something that shouldn’t be at the epicenter of our national agenda.”

Tom Hamburger and Katie Zezima contributed to this report.