Best known for her Netflix shows and stand-up tours, Sofía Niño de Rivera is one of Latin America's leading comedians.
The 35-year-old from Mexico City has long been making audiences laugh, but she recently embarked on a more serious mission: supporting vulnerable women in Mexico's notoriously dangerous prisons.
In a bid to help female inmates overcome frustration and depression, Sofía gave 10 stand-up workshops in the Mexican capital's vast Santa Martha Acatitla penitentiary over the summer.
The project came about after her cousin, Saskia Niño de Rivera, asked her to do a benefit gig to raise funds for Reinserta, a charity she runs to improve conditions in Mexican jails.
The comedian accepted but wanted to do more than just raise money. They agreed that stand-up workshops could help inmates to use comedy as an emotional release for the benefit of their mental health.
"Stand-up is a really cathartic psychological tool. It has helped me a lot in my life," Sofía says at a hotel in Guadalajara, the morning after a sold-out public performance.
"Women in prison don't have a lot of tools to help them handle emotional issues," she adds. "I think stand-up is something that can help them."
A tough crowd
Women account for just 5% of Mexico's 211,000 prison population, but they receive fewer visits and are more likely to be abandoned by their families than male inmates, according to a Reinserta survey.
Saskia, a lawyer and philanthropist who founded Reinserta in 2013, says inmates rarely have access to psychologists and find therapeutic lessons difficult to put into practice when in "survival mode" in their cells.
The combination of her cousin's public profile and Reinserta's experience working in jails helped convince the prison authorities to back the project, but it proved tougher to persuade inmates to participate.
"It was very difficult because stand-up is a relatively new concept in Mexico," Saskia says. "The women in prison didn't know who Sofía was or what stand-up was, so it wasn't easy to introduce this activity."
Instead of giving stand-up performances herself, Sofía taught the inmates to laugh about their own experiences.
She also invited other Mexican comedians to perform specially tailored sets with jokes that inmates could relate to about life behind bars.
At first the women were reluctant to open up, but Sofía gradually began to win their trust.
"It's very hard to show them stand-up but it's been so interesting to learn their stories and watch them try," Sofía says. "It's a tool they didn't know they had."
While she encourages inmates to make light of their difficult surroundings, Sofía warns they must be careful to choose the right moment.
"It's not something they can use very publicly," she says, noting that one woman was transferred to a cell with stricter conditions for mocking the way a guard spoke.
Sofía and Saskia are currently working on a documentary to increase awareness about the conditions in Mexico's overcrowded and unsafe prisons.
A recent government survey revealed that almost half of inmates share their cell with more than five prisoners, nearly a third feel unsafe in prison, and one in five feel unsafe in their own cells.
One in three prisoners was a victim of illegal conduct last year, including theft, injury, extortion, threats and sexual assault. And four out of 10 inmates have suffered from corruption, with guards charging them to receive visitors, bedding, food, drinking water or medical attention.
Violent prison riots are common. More than a dozen inmates died in clashes at a prison in Nuevo Leon state last week.
Hazael Ruíz, the undersecretary for Mexico City's penitentiary system, says the stand-up workshops have helped ease tensions in Santa Martha Acatitla.
He's now planning more sessions in another women's prison and possibly a male facility.
"The girls that participated have shown a very positive change in attitude," Mr Ruíz says. "Through stand-up they found the tools to channel the negativity that they've experienced into comedy."
"They make daily life enjoyable," he adds. "They get along with less tension than the others and their new outlook on life is contagious."
Sofía is encouraged by this progress but warns that Mexico must do more to generate more humane conditions in its jails.
"Mexico would benefit if people inside a prison could really rehabilitate and go outside and not do drugs or be killers," she says.
"Prison is just like a little Mexico and every time I go in there I think: 'This country has a lot to change and it has to change fast.'"