When Adam Ebbin, the first openly gay Virginia state lawmaker, arrived in Richmond 16 years ago, he looked around at the hundreds of staffers working in the Capitol and realized he didn’t know a single one who was gay.

Danica Roem, in contrast, says she was inundated with volunteers from the LGBTQ community when she ran for the House of Delegates in 2017. Her openness about her own transgender identity, Roem says, made those individuals feel that her campaign would be a “safe” place to work.

As Democrats gear up for the elections of 2019 and 2020, party officials at the national and state levels are trying to diversify other campaigns as well, recruiting and training staffers who are women, people of color or members of the LGBTQ community — all constituencies that are increasingly visible parts of the party’s base.

The National Democratic Training Committee just finished an eight-week class of 60 people, chosen from 600 applicants. More than half of the participants were women, more than half were people of color and more than one-third identify as members of the LGBTQ community.

Program manager Allyson Raines said the group developed the program “in response to what we were hearing from our partners . . . that they needed more high-quality, diverse and trained staff members.”

The committee is one of several Democratic-affiliated nonprofits that have begun training both potential candidates and staffers in the past three years — but this program was the first, they say, that was offered free of charge to participants. Members were recruited with the help of state and national party committee, and others.

“There was a recognition that those folks who did have the [fundraising and digital] skills didn’t reflect people of color, women, LGBTQ folks and others,” Raines said.

There’s no question the profile of voters and candidates who are either not white, not male or not heterosexual or heteronormative is rising. Transgender rights were prominently mentioned in the Democratic presidential debate Wednesday night. And the candidates talking about them were Sen. Cory Booker (N.J.), who is African American, and former San Antonio mayor Julián Castro, who is Latino. Women are getting elected to Congress and statehouses in record numbers, and voter turnout is growing among young voters, blacks, Asians and Hispanics.

According to the Associated Press VoteCast survey, in the 2018 congressional elections, Democrats captured the support of 58 percent of women voters, 76 percent of nonwhite voters and 74 percent of LGBT voters.

But party officials and advocates say those groups are underrepresented on political campaign staffs.

“Politics is still a relationship business,” said Eric Lundy, program director of Inclusv, an organization that seeks to promote racial diversity and found in a 2017 report that 32 percent of state Democratic staffers were people of color. “People tend to hire people they know . . . and in some ways we’re still a segregated society.”

Samreena Farooqui, 24, a Pakistani-born immigrant who lives in Arlington and identifies as gender non-binary, was one of the 60 participants in the National Democratic Training Committee class. Farooqui has worked as a field organizer for nonprofits in the past, but still frequently feels like an outsider.

“Growing up as an immigrant after 9/11, the general feeling was you couldn’t be politically involved if you were Muslim,” Farooqui said. “And I was working class. The whole [political] structure is built around connections, so that was an obstacle.”

The sessions teach campaign finance and fundraising skills, such as how to track donations, research donors and follow each state’s campaign laws. They also teach how to create websites and digital content calendars and write effective social media posts and emails. Leadership and management training focuses on how to handle volunteers, create an inclusive team atmosphere and manage priorities.

Michael Muller, chief executive of the New Jersey Democratic Assembly Campaign Committee, made several job offers to new graduates of the training last week. He said that while there’s no problem finding diverse and qualified staff in his state’s urban areas, many suburban political campaigns seemed to hire mostly white heterosexual men.

Peter Nouhan, 24, who is openly gay, called the digital strategy skills he learned the “connective tissue” of political campaigns.

A former communications intern for campaigns in both Maryland and New Hampshire, he said he hopes to become a campaign manager and then run for office himself one day.

Both he and Farooqui said the network that the training sessions create is just as important as the skills they teach. The graduates, while watching the first presidential debate Wednesday, for example, shared their reactions on a shared chat app even though their program was finished.

“It doesn’t feel so much like training as a new community,” Farooqui said.

Ebbin (D-Alexandria) said aspiring campaign workers from marginalized groups should think big.

“A lot of times, people from different groups don’t see every field as open” because they don’t see people like themselves, Ebbin said. But, he added, campaigns need workers who represent the “rich experience” of the community.