Claudia Mendez was 15 with no clue about what having sex or getting venereal disease was about. Her parents abused her. Her mom, she said, expected her to get pregnant young and find “a sugar daddy.” Hopelessness was pretty much the recipe for the future.

Then Mendez found the New Generation Health Center, where doctors and counselors skipped the birds-and-bees business and got right down to brass tacks on the meaning of safe sex. And sexually transmitted diseases. And how to pick healthy relationships, and when to plan for children.

“All those things you normally talk to your mom and dad about?” Mendez said. “That didn’t happen with them — but it did at New Generation. Because of them, I was able to demand respect for my life. I was able to make smart choices.”

For more than 20 years, New Generation in San Francisco has played the same role for thousands of low-income teens and young adults who felt they had nowhere to turn for badly needed advice on reproductive health. But it all nearly ended just over a year ago.

Crippled by a drop-off in donations and grants, along with insurmountable costs it would need to pay to upgrade its leased Potrero Avenue building for seismic and disability codes, the clinic faced closure. UCSF, which had been running it, determined that the cost wasn’t sustainable.

On Wednesday, the fear of permanent closure was put to rest for good when New Generation officially opened at a new location in the cavernous headquarters of the Homeless Prenatal Program at 2500 18th St. As city leaders, including Supervisor Hillary Ronen and medical professionals, hailed it as a new day, the clinic’s counselors saw a bright future.

New Generation actually began its relocation a couple of months ago, slowly taking in patients, and by the time the ribbon cutting and speeches happened, its teams were already seeing about 40 young people a week, most of them women and girls.

The clinic had moved into a tiny space at San Francisco General Hospital after letting the lease run out at the old Potrero building and while the new location was being prepared. But few knew about it, and some young people who did were reluctant to go because they were afraid they’d run into friends of their parents or others they didn’t want to know they were looking for reproductive help.

Now that word is going out that the doors really are open at the new spot, they expect the numbers to swell.

“When we lost our lease, we were despondent, and our clients were worried,” Andrea Raider, lead clinician at the center, said the other day right after installing a birth control implant for a young woman. “It’s a really good feeling being here. Too many people depend on us for us not to be here.”

New Generation became a lifeline for Mendez as she moved into foster care to get away from her abusive parents, then went on to get a bachelor’s degree at San Francisco State University in comparative world literature. The kid from the troubled home overcame her tough early years so thoroughly that now, at 27, she works as a community organizer and has begun graduate studies in social work at San Francisco State. And she regularly brings other disadvantaged kids to New Generation, even as she continues to use its services.

“This staff is humble and understanding, especially Andrea,” Mendez said. “I don’t trust many people with my sexual health. But New Generation, I trust with everything.”

The clinic’s rescue came after community and medical leaders raised the alarm back in 2016 about its looming closure. Dr. Rebecca Jackson, the UCSF professor who had long overseen the university-run clinic, led the charge in raising more than $1.4 million in donations and grants from individuals and foundations. With other community leaders, she helped stitch together a new agreement for UCSF to work with the city Department of Public Health — which now owns the clinic — and the Homeless Prenatal Program on maintaining the center.

Jackson got so involved she strapped on a construction belt, grabbed an electronic drill and helped renovate the clinic’s new space on the third floor of the prenatal program’s building. The result of the work — and the hundreds of thousands of dollars donated for the renovation — is a cheery set of examining and counseling rooms with red and yellow accent colors and huge windows to match the welcoming vibe of the staff of educators and medical professionals.

“We are all very, very, very passionate about reproductive health,” said Jackson, who is also chief of obstetrics and gynecology at San Francisco General. “And, remember, back in 2016 ... with the gentrification of San Francisco, there was a lot of talk about people of color and low-income people being pushed out of the city. To me and the entire staff, closing was not a choice. There is too much need for this clinic.”

The prenatal program, which had always referred young pregnant women to the clinic and vice versa, turned out to be a perfect partner.

“This is about both the rescue of the clinic and the community coming together to do that,” said Martha Ryan, executive director of Homeless Prenatal Program, which has served 85,000 impoverished families with housing and provided prenatal, parenting and other support services since opening in 1989. “Just closing New Generation didn’t make any sense at all. Kids are still going to have sex and, if they get pregnant unexpectedly, it can stop their education, their ability to get a job, make life very complicated.

“Prevention is less expensive than handling what happens after those pregnancies. And having this clinic here in our building is very good for both of our programs.”

Already, the staffs of the two programs have found that the new arrangement has been a lot more efficient for moving clients back and forth for services.

“Honestly, some of the young women we see have such trauma in their lives that sometimes even having to walk across the street can be a barrier to seeking extra assistance,” said Kaitlin “Mo” Morrison, clinic coordinator for New Generation. “Sometimes they don’t want to be seen. Sometimes they’re afraid. And sometimes if you ask them to come back for another appointment, they won’t show up because there is so much turmoil in their lives.

“It makes a real difference being in the same space. Here, you can just walk in and be seen right at once, no need to come back two or three times like at some other places for something we can handle right away.

“This could not have worked out any better.”

Kevin Fagan is a San Francisco Chronicle staff writer. Email: kfagan@sfchronicle.com Twitter: @KevinChron