The new Netflix series "Ingobernable" — "Ungovernable" — is set in Mexico.
But when it came time to start filming the Spanish-language drama last summer, the show's star had a problem: She couldn't go there without risking arrest.
Kate del Castillo, one of Mexico's best-known actors, was wanted by authorities for having met with Joaquin "El Chapo" Guzman, Mexico's best-known drug lord, while he was on the run in 2015.
The actress, 44, shot to fame after starring in a string of popular soap operas. The drug lord, thought to be in his early 60s, started out as a street vendor and came to lead the world's most powerful and murderous criminal syndicate.
Their relationship, based on mutual fascination and formed over a series of secret text messages, became Guzman's undoing, eventually landing him in a U.S. prison awaiting trial on charges of drug trafficking and murder.
Less publicized are the problems it has caused for Del Castillo, who was vilified by Mexican officials for befriending Guzman, and who said her career has suffered in the fallout.
In the new show, Del Castillo plays Mexican First Lady Emilia Urquiza, who goes on the run when she is falsely accused of killing her husband.
"Of course there's an analogy, because I too have been persecuted," Del Castillo said in a recent phone interview from Los Angeles. "I've also been trying to prove my innocence."
The trouble started on a winter night in 2012.
Del Castillo was at home in Los Angeles, where she had moved several years earlier to try to break into Hollywood. Sipping a glass of wine, she sent out a flurry of tweets on love and politics, her usual fare on social media.
Then she turned to the subject of Guzman, who had escaped from prison a decade earlier and was still on the run.
"Today I believe more in El Chapo Guzman than I do in the governments that hide truths from me, even if they are painful," she wrote.
She then directed a question to the Sinaloa cartel leader. "Mr. Chapo, wouldn't it be cool if you started trafficking with the good? Let's traffic with love, you know how."
Del Castillo's provocative tweets lit a firestorm, with some in Mexico accusing her of celebrating the drug lord.
The tweets also attracted the attention of Guzman, who had become a fan of Del Castillo after seeing her play a plucky drug lord in the Mexican soap opera "La Reina del Sur."
In 2014, after the cartel leader was recaptured, his lawyers reached out to Del Castillo to offer her the rights to his life story for a film or television project. Del Castillo, who saw strong narrative potential in Guzman's exploits and folk hero status, jumped at the chance.
His lawyers eventually gave the actress a phone so she could communicate with Guzman via text message, where he confessed his admiration of her acting career and called her "the best woman in the world."
Guzman escaped again in July 2015 and three months later invited Del Castillo to visit him in a hideout in the mountains of Sinaloa. They shared tequila and spoke about his life late into the night. Actor Sean Penn, whom Del Castillo had invited along, later wrote about the experience in Rolling Stone.
The clandestine meeting helped Mexican authorities trace the drug lord's location — and recapture him a few months later.
It also embarrassed President Enrique Peña Nieto, raising the question of how his government had not been able to find Guzman sooner.
Del Castillo was already unpopular with Peña Nieto's Institutional Revolutionary Party, or PRI, because she had campaigned for an opposition candidate in the 2000 presidential election. After her meeting with Guzman, she said, she became the target of a "witch hunt" by the government.
In an interview early last year, then-Mexican Atty. Gen. Arely Gomez said her office was investigating Del Castillo on possible money laundering charges, suggesting the actress may have received money from Guzman for the film project. The government issued an order to find and question Del Castillo, who said the drug boss had paid her nothing.
As a result of the order, she said, several planned acting projects were shelved and the cost of her cast insurance went up.
"People were afraid because they didn't know if I would be able to perform, or if suddenly the FBI or the DEA was going to come and yank me out of production," she said.
For "Ingobernable," producers worked around the situation, shooting Del Castillo's parts in San Diego and using a double for her street scenes in Mexico.
The show is a none-too-subtle critique of her home country.
The first season unfolds against the backdrop of a bloody drug war, rampant government corruption and forced disappearances — much like the real Mexico. A main plot point is a thinly veiled reference to the disappearance of 43 students in Ayotzinapa in 2014.
"It's almost an obligation for us as actors and producers to talk about the issues that bother Mexico, about the corruption, about how we are broken," said Del Castillo. "We need to start questioning ourselves as Mexicans and start raising our voices."
Del Castillo's character clashes with her husband, the president, over his broken campaign promises.
Producer Epigmenio Ibarra said he never considered another actress for the role, despite Del Castillo's travel restrictions.
"Any producer or journalist would have pursued this story," he said of her meeting with Guzman. "We chose a great woman, a great actress and a great fighter. We are with her."
He said it felt like the role was written for Del Castillo.
"Kate is ungovernable," Ibarra said.
While her costars attended a red carpet premiere and news conferences in Mexico City last month, Del Castillo stayed home in Brentwood.
For one event, she was beamed in by satellite and answered question after question from Mexican reporters about her meeting with Guzman.
"It's a shame that I can't see the faces of the press and all my colleagues," she said, blinking back tears.
Del Castillo communicated to Guzman through lawyers about their film project while he was imprisoned in Mexico but hasn't spoken to him since his extradition this year to the United States.
She still hopes to make a film about his life, but says she will wait until she can confirm that her legal problems in Mexico are resolved.
In February, the attorney general's office announced that in compliance with a court ruling, it had canceled the order to find and question De Castillo.
But the actress said she believes the government is planning a new case against her and said her lawyers have told her it is not safe for her to go back to Mexico.
She said she'll return only "when my layers give me a green light, and I can go without any risks."
Cecilia Sanchez in the Times' Mexico City bureau contributed to this report.