“Treat your women well and be kind to them,” Muhammad himself urged in his last sermon, during his final pilgrimage to Mecca. “It is true that you have certain rights with regard to your women, but they also have rights over you.”

So, kindness and rights, but also women as something less than men. It can feel patronizing, and diminishing of our full humanity. It is why I started to lose faith after a childhood in an observant family and what I still struggle with, at 38, living a life that is secular but guided by Islamic values.

Each day in Mecca provided powerful reminders of a religion that seems to simultaneously embrace women and push them away.

Another day at the Grand Mosque, I met Saraya, a middle-aged woman who is from South Africa but lives in Australia, where I grew up. She had longed to make the hajj for years but was unable because she lacked a mahram, or male guardian — usually a husband, brother or father — to accompany her; male pilgrims can come alone.

“I never thought I’d get here,” said Saraya, beaming.

She got here only because the Saudi government allows some women over 45 to come with an older female companion. (I got around the mahram requirement because I came on a journalist visa, which included a different kind of guardian, a Saudi minder named Abdul-Rahman who accompanied me during all my reporting.)

Saraya, whose last name and age I never had a chance to ask, said there had been “a few incidents” that detracted from the positive experience of her pilgrimage, like when someone in her delegation was “propositioned in a taxi,” and the fact that men frequently pushed in front of her.