Rick Santorum said he would never attend a same-sex wedding. Marco Rubio said he might attend one. Scott Walker actually went to a same-sex wedding reception, not to be confused with an actual same-sex wedding ceremony. Ted Cruz said he is firmly opposed to gay marriage, but would be comfortable if his daughter were gay.

Republican presidential candidates are struggling to adjust to a rapidly changing legal, political and cultural landscape this primary season, as the Supreme Court prepares to hear arguments Tuesday on whether same-sex marriage is a constitutionally protected right.

Once a winning primary issue as well as a powerful wedge issue wielded against Democrats, opposing same-sex marriage has grown far more complicated for Republicans. While it could offer conservative candidates a way to break through a crowded primary field, it looms as a liability with general election voters, particularly independent ones, who are more supportive of same-sex marriage than more conservative Republicans.

“The country has moved decidedly in the direction of gay unions,” said Frank Keating, the former governor of Oklahoma and an opponent of same-sex marriage. “That doesn’t mean those of us who have always been of the view that marriage is between a man and a woman will not be heard. It’s just that things have changed, and this is an issue that has changed the dynamics of the conversation.”