Foes of same-sex marriage often cite scripture as the basis for their opposition, but the line between faith and homosexuality is a blurry, complicated place.
There are gay couples in committed relationships for whom religion is a lifelong anchor. There are secular singles who find homosexuality repugnant.
And there are people on both sides of the same-sex marriage debate who agree on one thing: that being gay and being religious are mutually exclusive.
Homosexuality violates biblical law, said the Rev. Mitch Minson, senior pastor of Daybreak Baptist Church.
Wednesday's historic U.S. Supreme Court ruling doesn't change that, he said.
The court ruled that in states that permit same-sex marriage, gay married couples are entitled to the same rights as heterosexual married couples.
"We would not permit same-sex ceremonies within the church because that would indicate an endorsement of the behavior, which runs contrary to the teachings of Scripture," Minson said.
Although many people of faith agree with him, the ranks of those who find homosexuality immoral are shrinking.
As of May, 59 percent of Americans believe gay or lesbian relationships are morally acceptable, compared with 40 percent in 2001, according to Gallup.
Loriann Toia grew up in the Catholic Church. She knew from an early age that she was a lesbian and used to wonder why "God made me this way."
Toia prayed for a "fix," which she tried to earn by volunteering at church. She attended retreats, was a youth group leader, and administered communion as a eucharistic minister.
Eventually she came to the conclusion that her sexual orientation could not be changed.
That's the point at which some religious gays and lesbians have a crisis of faith, abandon their religion and become atheists or agnostics.
Forty-eight percent of LGBT adults don't identify with any particular religion, versus 20 percent of the U.S. general public, according to the Pew Research Center.
Toia, 45, left the Catholic Church because her priest and fellow congregants made her feel unwelcome, but she wasn't willing to sever ties with God.
"When I adopted a child at the age of 39, I thought, 'I want her to have church in her life. I just don't want it to be Roman Catholic,'" Toia said.
The Catholic Church opposes same-sex unions.
"We believe that the Supreme Court got it wrong," said Kim Daniels, spokeswoman for the U.S. Conference of Catholic Bishops. "We know that marriage is a lifelong union between a man and a woman for the sake of their children.
"We need to strengthen this definition, not redefine it."
In 2008, Toia joined Grace Episcopal Church in Bakersfield. The Episcopal Church had ordained the first openly gay bishop in the United States in 2003, so Toia thought it would be a better fit for her.
She and her partner, Arcelia Aldapa, obtained a legal domestic partnership late last year, but also held a commitment ceremony at Grace.
"It was important to us to acknowledge that God is playing a role in our relationship, which is just as important as anyone else's," Aldapa said.
The leader of the church, the Rev. Tim Vivian, estimates that up to a quarter of his parishioners are LGBT.
"A lot of people have been very seriously hurt and damaged by other church experiences," he said. "Grace is well known in Bakersfield as being welcoming and affirming."
There is a spiritual hunger in the gay community, Vivian said, and churches should be trying to fill that hunger by providing "a warm and loving community where sexual orientation is not an issue."
Even conservative clergy generally agree that gays and lesbians should be treated with respect.
Scripture is "quite clear" on prohibiting sexual relations with the same gender, said Jeff Chandler, pastor of First Presbyterian Church in Bakersfield.
But that doesn't justify cruelty, he said.
"Sadly, we acknowledge some have used the Bible as a weapon to inflict pain, manipulate and rationalize evil," he said. "We do not stand in judgment of anyone. Instead, we seek to gently raise up the standard God has established and humbly invite others to follow Christ and his best."
Chad Vegas, pastor of Sovereign Grace Church in Bakersfield, said he's not an opponent of gay marriage "because it doesn't exist. It's like saying you're opposed to unicorns."
Rather, Vegas said, he's a "proponent of traditional marriage" who ministers to anyone who seeks Jesus Christ.
"We have members of our congregation who used to be in that lifestyle," he said. "I don't say, 'There's that gay man over there.' I just say, 'There's a Christian who struggles with sin.' It's a different sort of sin than I struggle with, but we all have sin."
What's difficult for the gay community is that some religious activists have gone beyond that theological position to advocating for same-sex marriage bans at the state and federal level.
The Muslim community has generally refrained from that even though homosexuality is prohibited in Islam, said Emad Meerza, president of the Islamic Soura Council of Bakersfield, an umbrella organization for mosques in the region.
"It's not an issue we talk a lot about," he said. "We understand that we live in the United States of America, and the law of the land is the law of the land. Generally it would only come up if someone came to us for private counseling."
Raymond Harkey, 24, wants no part of any house of worship.
He grew up Baptist in a church that preached frequently about damnation and hell. It turned him off to religion. Today, he's in a committed relationship with a man and doesn't go to church.
"I wouldn't want to be tied to any type of religion in any way," he said.
For his part, Harkey would like to see civil marriage be separate and distinct from the religious institution of marriage. That way neither side would feel uncomfortable.
Karen Briefer-Gose, who is 50 years old and Jewish, married her wife in 2008 during the brief window when same-sex marriage was legal in California. Those marriages are expected to resume after a separate Supreme Court ruling that left a lower court's invalidation of California's ban intact on technical grounds.
The Central Conference of American Rabbis, the most liberal of United States rabbinic organizations, has supported same-sex civil marriage since 1996.
"In the local Jewish community, there really were not many issues about our civil right to marry," Briefer-Gose said. "There were much more heated discussions within the temple about whether the rabbi should be able to perform Jewish rites."
The couple chose to have a secular marriage at the Kern County Administrative Center.
The couple's rabbi is Cheryl Rosenstein of Temple Beth El, a Reform synagogue in Bakersfield.
The congregation's attitude toward gays has evolved over time, she said. At one point, the temple was more reticent, but today there are at least four openly gay couples among the members, and the temple's religious practices committee leaves the decision to religiously sanction same-sex weddings to Rosenstein.
"They said within the bounds of my conscience, I could marry whomever I want," she said. "They were waiting for legality."
Now that the Supreme Court has ruled, Rosenstein said, she'd be willing to officiate at a same-sex wedding, provided both partners were Jewish.
Gay marriage opponents are waiting to see what the fallout is of the ruling. Some worry that they'll be branded bigots, or even suffer legal ramifications, if they adhere to the tenets of their faith in religious, business and social practices.
"We will not compromise the word of God," Daybreak Baptist Church's Minson said.
Gay rights groups argue the court's ruling shouldn't weaken religious practice because no clergy will be forced to officiate at weddings they don't approve of.
There could be issues that arise from refusing gay couples products and services that are marketed to the general public, but legislatures and courts have generally done a good job of balancing non-discrimination clauses and religious rights, said Gary Buseck, legal director of Boston-based Gay and Lesbian Advocates and Defenders, or GLAD.
Religious organizations are allowed to discriminate in hiring under certain circumstances, for instance.
"We've had legal same-sex marriage in Massachusetts for nearly 10 years, and really there's been almost no litigation on this," Buseck said. "Generally what we tell people is if a caterer refuses to do your wedding, you'd probably be better off picking someone else, anyway -- someone who values your business and really wants to give you good food or good photography or whatever.
"These things have a way of working themselves out on their own."