Even as a lesbian in a conservative Southern state, Katrina Martir managed to thrive in central Kentucky. She married — in another state — is raising an adopted child with her wife and recently started her own consulting business.

But when the former fourth-grade science teacher told her principal in 2010 that she planned to get pregnant and raise a child with her partner, Martir said she was promptly fired because public school officials feared a parent backlash over a lesbian teacher. Martir, 32, decided to sue for employment discrimination and went to see a lawyer. But she soon discovered that there was nothing illegal, either in Kentucky or her county, about firing someone for being gay.

“In most of Kentucky, they can do whatever they want, I guess,” Martir said. “I had three days to pack up.”

The Supreme Court on Friday delivered a landmark victory for same-sex marriage, but gay rights advocates were already preparing for the next great battle: the expansion of federal civil rights laws to protect gays in the workplace and elsewhere.

“The problem is, if gay marriage comes and gay couples go to get married, a number of them will get fired from their jobs for that,” said Bryan Gatewood, a gay rights lawyer in Louisville. He said a Supreme Court victory may even trigger a backlash from conservatives in some states and cities. “You are going to stir all these people up when [gays and lesbians] get married, so you’re going to get more discrimination.”

Though a broad high court ruling may very well send a legal message throughout the country that discrimination based on sexual orientation is on shaky legal ground, current federal civil rights laws do not explicitly ban such discrimination.

Only 22 states and the District of Columbia have laws against employment discrimination based on sexual orientation, leaving millions of gays and lesbians without a clear right to rent an apartment, eat at a restaurant or keep their jobs.

“This is the next frontier after gay marriage,” Gatewood said. Legislation to provide comprehensive federal protections for gays and lesbians nationwide is expected to be introduced in the coming weeks by Rep. David Cicilline (D-R.I.) in the House and Sen. Jeff Merkley (D-Ore.) in the Senate.

With Republican majorities in both chambers of Congress, the bills have little chance of passing anytime soon. But gay rights groups say prospects for gay marriage were similarly dim when that movement started over two decades ago.

“This is about laying the foundation for this legislation to eventually pass,” said Ian Thompson of the American Civil Liberties Union’s Washington office. “A majority of the people support this. It’s only a matter of time before that reality catches up to Congress.”

Sarah Warbelow, legal director for the Human Rights Campaign in Washington, predicted an LGBT nondiscrimination bill would be passed in the next three to six years. “There has been a very significant shift among Republicans about how they think about LGBT people and what it means to provide core protections,” she said.

The benefits of such laws are demonstrated by a client of Gatewood’s in Louisville, which passed an ordinance protecting gays.

When police Sgt. Kile Nave was called “queer” by a supervisor and then fired after he protested to the chief of his suburban Louisville department, he filed a lawsuit and a complaint with the city’s human rights commission.

The Audubon Park Police Department paid Nave damages, and he now works happily at another police department nearby. But had Nave worked across the county line just 10 miles away, or in most of the rest of Kentucky, he would have had no established legal right to complain.

Opponents of gay rights legislation are also ramping up. They are focusing a rival campaign around religious liberties, claiming that a mandate to serve gays and lesbians might sometimes violate their faith.

Some states, like Mississippi, have passed laws to protect businesses that refuse to serve gays and lesbians as a matter of religious conscience.

The Alliance Defending Freedom, a religious legal advocacy group based in Arizona, is advising churches, religious nonprofit organizations and schools on how to defend themselves from discrimination lawsuits. The organization is also representing a florist who refused to sell flowers for a gay wedding and a T-shirt printer who refused to make shirts for a gay pride parade, according to the group's spokesman Bob Trent.

Their cause was bolstered last year when the Supreme Court ruled that corporations with religious-minded owners have rights similar to those of individuals under a federal religious freedom law. The decision exempted the Hobby Lobby crafts chain from a federal requirement to offer certain forms of birth control to workers.

But sometimes efforts to use religious claims to rebuff anti-discrimination laws have caused a backlash. A bill approved in Indiana in March that critics said provided a legal basis for businesses to refuse services to gay customers was amended in April to explicitly outlaw such discrimination after the state was hit with a flood of negative national attention, including criticism from some major companies based in the state.

Even without a federal law banning discrimination against gays and lesbians, there have been several major — if little-known — advances in the area of employment in recent years. Since 2012, the Equal Employment Opportunity Commission has quietly reinterpreted the 1964 Civil Rights Act’s prohibition on sex discrimination in the workplace to cover gay and transgender people.

EEOC Commissioner Chai Feldblum said in an interview that the EEOC decided it was “a gender stereotype to think that a man should marry a woman,” ruling in favor of 223 LGBT people who claimed employment discrimination in the past two years. But that theory has not been fully tested in the courts, and a new federal law could give much broader protections, she said.

Last year President Obama signed an executive order prohibiting federal contractors from discriminating in hiring based on sexual orientation, which according to the Williams Institute at UCLA covers nearly a quarter of the entire civilian workforce.

All federal employees are also protected against discrimination based on sexual orientation, under executive orders issued by several presidents. The Pentagon announced an anti-discrimination policy in early June. Together they mean protection for more than 4 million more Americans.

Combined with some 200 local anti-discrimination ordinances, about half of all gay and lesbian workers in the U.S. are believed to be legally protected against employment discrimination, though firm numbers are not available.

In addition, nearly 90% of Fortune 500 publicly traded companies voluntarily prohibit discrimination on the basis of sexual orientation, according to the Human Rights Campaign.

But there are no laws protecting a majority of gays and lesbians from other forms of discrimination, including housing.

Because there are few legal protections and the EEOC has only recently gotten involved, it is difficult to quantify the extent of employment discrimination based on sexual orientation. A 2013 U.S. Government Accountability Office study found only between 3% and 5% of employment discrimination complaints were based on sexual orientation in states that offered protection against such bias.

A 2013 Pew Research Center poll found that 21% of gay workers surveyed said they had been treated unfairly by an employer based on their sexual orientation. That compares with 46% of African Americans who report they have been treated unfairly by an employer, according to Pew.

In a 2013 study, the U.S. Department of Housing and Urban Development found that landlords responded less favorably to same-sex couples compared to opposite-sex couples in housing inquires more than 15%of the time.

Rhode Island Rep. Cicilline, a former mayor of Providence, is one of six openly gay members of Congress. He is confident that his legislation will succeed in time

“I don’t think there is any question that we will live in a country where discrimination [against gays] is prohibited,” said Cicilline in an interview. “The question is when.”