At 3 o’clock in the morning on Sunday, Benjamin Newbern, a gay rights activist in northern Alabama, arrived home from a gay pride dance party he had organized, glanced at his cellphone and spotted an unsettling social media post: “Prayers for our brothers and sisters at the Pulse nightclub in Orlando.”

Mr. Newbern flipped on the television to news, he said, that “just kind of took my breath away.” And instantly, he knew that his life, as an activist and a gay person in America, had changed.

By Sunday afternoon, Mr. Newbern, 38 — who has spent two years trying to build a gay rights community in his home city, Florence, in part by persuading people that it is safe to come out of the closet — was struggling, as were gay people nationwide, to make sense of the worst mass shooting in American history, committed on a Latin-themed night in a gay nightclub by a Muslim gunman.