In 1964, the first national advocacy group devoted to sex education was founded: the Sex Information and Education Council of the United States. At the time, it seemed—at least from elite vantage points—that America was reaching a consensus about the need for sex education in schools. “The organization was as much a part of the zeitgeist as hula hoops,” Janice M. Irvine writes in Talk About Sex: The Battles Over Sex Education in the United States. In 1966, an article on sex education in Look magazine reported, “Backwardness is succumbing as surely as snow to spring.”

The frost ended up sticking around a lot longer than liberals expected. By the end of the 1960s, bitter controversies over sex education had erupted nationwide. They provided a crucial organizing tool for the nascent religious right, as organizations like the Christian Crusade and the John Birch Society swooped in to help outraged parents fight any mention of sex at school. “Sexual politics helped launch the American right wing out of dormancy into a prominence from which they reconfigured American politics,” Irvine writes. Sex ed remains patchy to this day; a recent Centers for Disease Control and Prevention report found that less than half of high schools teach all of the 16 sex education topics recommended by the agency.

The long war over sex ed could provide a template for the current fight over trans people and public bathrooms, which is playing out both on the state level—most notably in North Carolina—and in local school districts. Both are volatile because they involve kids, schools, and sex. In both, recalcitrant conservatives feel that a strange new consensus is being foisted upon them by distant elites. Each features an alliance between national right-wing organizations and local parents. If the battle over sex heralded the beginning of the religious right, the battle over trans people in bathrooms will show us whether the religious right has any power left.

* * *

Absurd as the war over bathroom access might sound to outsiders, it’s hard to overstate how serious it is to many religious conservatives. The specter of penises in the ladies’ room has haunted the religious right since its inception, usually invoked as a sign of imminent dystopia. As Neil J. Young reported in Slate last year, opponents of the Equal Rights Amendment in the early 1970s terrified housewives with warnings of men in women’s restrooms, even branding the ERA the “Common Toilet Law.” For social conservatives, a world in which sexual distinctions lose their social significance is the nightmare endpoint of all the modernizing trends they decry.

“Down the road, this basically blows the doors off of any boundaries in society—we’ll have a completely sexless society,” Jesse Kremer tells me. Kremer is a Wisconsin Republican lawmaker who recently tried to pass a bathroom bill in his state.

At the state and national level, Kremer’s side is losing. North Carolina is being culturally and financially ostracized for HB2, a law that, among other things, seeks to limit trans people to public bathrooms and changing rooms that match the sex on their birth certificates. Similar bills are failing in other states, with Republicans spooked by the possibility of boycotts and lawsuits. In March, South Dakota’s Republican governor vetoed a bathroom bill aimed at public school students. In April, a similar bill that Kremer introduced in Wisconsin didn’t make it out of the state assembly. A bathroom bill in Tennessee was withdrawn by its sponsor. In South Carolina, a bill modeled after HB2 was defeated in the state Senate.

Meanwhile, on April 19, the 4th U.S. Circuit Court of Appeals ruled that a trans boy could sue his school under Title IX for barring him from the boy’s bathroom. Donald Trump, the presumptive Republican nominee, wants nothing to do with the issue and has called North Carolina’s bathroom bill a mistake. “People go, they use the bathroom that they feel is appropriate, there has been so little trouble,” Trump said of the pre-HB2 status quo. Ted Cruz thought he could use Trump’s uncharacteristic tolerance against him—starting April 22, he ran an ad asking, “Should a grown man pretending to be a woman be allowed to use the women’s restroom? The same restroom used by your daughter? Your wife? Donald Trump thinks so.” Cruz’s decisive defeat in Indiana on Tuesday showed how well that worked.

Yet despite repeated failures, this issue is roiling grassroots religious conservatives, some of whom had been in a slump since their rout on gay marriage. “There’s a sense that that battle is lost, but that energy remains,” says Cathryn Oakley, senior legislative counsel at the Human Rights Campaign. “I think that energy has unfortunately been diverted in the direction of attacking trans people, specifically trans kids, but also trans adults.”

Even though most of this year’s legislation targeting trans people has failed, we can expect another round of these bills next year. Kremer plans to introduce an even more sweeping version of his bathroom bill in Wisconsin’s next legislative session—one that goes beyond schools to apply to all public facilities, just as North Carolina’s does.

“Part of the problem last session, a lot of our leadership team didn’t think this was a concern,” he says. “They weren’t hearing from people.” Now, according to Kremer, grassroots conservatives are mobilizing: “We had our finger on the pulse.” Ohio state Rep. John Becker is planning to introduce a similar bill in his state. A group in Washington state called Just Want Privacy is working to put a bathroom bill referendum on the November ballot.

As with sex ed, however, much of the fight is happening at the local level, where the Christian right has historically been well-organized. On Monday, a school board in Horry County, South Carolina, erupted in opposition to a policy allowing a trans boy to use the boy’s bathroom at his high school. In a video that has since gone viral, hundreds of attendees break into a chorus of “Jesus Loves Me” to drown out the sole speaker sympathetic to trans rights.

Then, on Wednesday, a group of 51 families in Palatine, Illinois, calling themselves Students and Parents for Privacy, filed a lawsuit challenging a school district policy that allows trans kids to use locker rooms aligning with their gender. It describes one high school where cisgender girls are mortified by having to change alongside a trans girl. “As a direct result of Defendants’ Policies and actions, every day these girls go to school, they experience embarrassment, humiliation, anxiety, fear, apprehension, stress, degradation, and loss of dignity because they will have to use the locker room and restroom with a biological male,” the suit says.

The Palatine school only gave the trans girl access to bathrooms and locker rooms under duress, after the U.S. Department of Education said that the school could lose federal funding for violating Title IX. Students and Parents for Privacy’s lawsuit, which names the Department of Education and Department of Justice as well as the directors of the high school, seeks to reverse that decision. Two socially conservative legal outfits, the Alliance Defending Freedom and the Thomas More Society, are representing the group.

“The ADF is playing a larger role here than some people realize,” says Rob Boston, director of communications at Americans United for Separation of Church and State. The ADF, which lists more than $42 million on its most recent tax filing, provides model policies for school districts and then offers free legal services when there’s a Title IX challenge. “They’ve got both ends of this covered,” Boston says.

Liberty Counsel, a Florida-based “nonprofit legal ministry,” does something similar. In March, the organization wrote to the superintendent of the Marion County Public Schools in Florida on behalf of a man upset by a trans boy sharing a bathroom with his devoutly Christian son. Liberty Counsel’s letter argued that federal guidance on Title IX and trans students need not be taken as settled law, and offered to represent the school system in court if it “returns to a gender-appropriate and legal policy.” If the schools refused, the letter implied there would be legal action on behalf of the Christian student. On April 26, the school board voted 4–1 to adopt the Liberty Counsel policy.

* * *

It’s easy enough to write these groups off as anachronisms, but backlash politics flourish in an environment in which deeply held beliefs suddenly become taboo. “The polling data that deals with the average Americans’ acceptance of gays and lesbians—at a certain point it went above 50 percent and continued to rise, and at that point there was no turning back,” Boston says. “There was a large number of people who said they knew someone who was gay. I don’t know that that’s happened with the transgender community. I think the religious right still sees them as vulnerable.”

They’re not wrong. Polls suggest that a slight plurality of Americans believe people should have to use the bathrooms that match the sex on their birth certificate. To a liberal, this is evidence that more education is needed. To a conservative, it’s proof that average people’s preferences are being trampled on.

When you talk to social conservatives about this issue, they often bring up the fact that more than 1 million people have signed a petition calling for a boycott of Target over its gender-inclusive bathroom policy. There are some signs that the controversy is damaging Target, albeit slightly; USA Today reported on a poll finding that its “brand perception” had fallen eight points in the past two weeks. While there is no sign that Target’s bottom line has been damaged, the Christian right sees the boycott as a popular uprising—the mirror image of the elite boycott of North Carolina.

“I don’t think that it would be wise to look at the Target boycott in a vacuum,” says Harry Mihet, Liberty Counsel’s senior litigation counsel. “We’re seeing that same sentiment being expressed certainly among our constituents and among our supporters, but really across a broad spectrum of society. When fathers find out that their daughters at their local school are about to be exposed in their most private moment to people of the opposite sex, when mothers find out that the restrooms at Target are now open to anyone who pretends to be a woman, those kinds of things trigger concerns amongst parents that are valid and serious. They demand action.” They will, unfortunately, continue to get it.