A national debate over LGBT rights. A court battle over voter ID laws. A public outcry over the police shooting of a black man that could become a turning point in the debate on police brutality.

Any one of those issues — among the nation's thorniest, most attention-grabbing debates over social justice and race — has the potential to be a career-defining challenge for a state's governor. In the span of six months, North Carolina Gov. Pat McCrory (R) has had to deal with all three.

Last year, McCrory had started pivoting away from some of the socially conservative debates that defined his first term as governor — and preparing for the fight of his political life this November.

But the past six months or so have found him engaged again in battles that have pitted some of North Carolina's fastest-growing demographic groups, millennials and African Americans, against his administration — and have made it an open question whether McCrory will win a second term.

Let's start from the beginning.

The 'bathroom bill' that backfired on Republicans

On May 9, North Carolina Gov. Pat McCrory (R) and U.S. Attorney General Loretta Lynch announced dueling lawsuits regarding HB2, a law that requires people to use public restrooms according to the sex they were assigned at birth, rather than the one they identify with. (Monica Akhtar/The Washington Post)

In a matter of hours one spring day in March, McCrory and his state became ground zero for the next battle in LGBT rights: What bathrooms and locker rooms transgender people can use.

In a dramatic special session that lasted 12 hours, North Carolina became the first state in the nation to require transgender people to use the bathroom corresponding with the gender listed on their birth certificate rather than the one they identify with. The law also took away municipalities' power to create their own LGBT anti-discrimination ordinances.

Gay rights groups and Democrats seized on the law as an example of Republican bigotry in action. The business, entertainment and sports community — from PayPal to Bruce Springsteen to the NBA and the NCAA — did, too, taking their business elsewhere and dealing a damaging blow to McCrory's argument that this law will protect North Carolinians, not hurt them.

McCrory and his team desperately grasped for some way to explain themselves — the law would protect girls and women from sexual predators, they said. But few seemed to be listening. And it seems McCrory still hasn't found a successful narrative. An August Monmouth University poll of North Carolina showed the governor performing worse against his Democratic challenger than GOP nominee Donald Trump is against Hillary Clinton there. A RealClearPolitics average of recent polls has McCrory trailing his Democratic challenger, Attorney General Roy Cooper, by 2.5 points.

Targeting African Americans 'with almost surgical precision'

The boiling debate over the bathroom law had just come down to a simmer this summer when McCrory was forced into yet another defensive position, this time over yet another controversial bill he signed into law.

In July, three judges on a federal appeals court struck down the state's controversial 2013 voter ID law, writing: "The new provisions target African Americans, with almost surgical precision." (They pointed to the fact that the law allows government-issued driver’s licenses but not ­government-issued public assistance cards, the latter of which are used disproportionately by minorities in the state.)

The Washington Post's William Wan reviewed records from the law's speedy making and declared: "North Carolina GOP leaders launched a meticulous and coordinated effort to deter black voters, who overwhelmingly vote for Democrats."

The court ruling striking down the law was a huge win for voting rights advocates, who had been playing whack-a-mole with voter ID laws across the country. It was a blow to McCrory just months before the election: North Carolina is expected to be a major swing state in November, thanks in part to its increasingly politically active African American community, whose members overwhelmingly vote Democratic.

McCrory accused the court — three Democratic-appointed judges — of "undermining the integrity of our elections and maligning our state." But beyond lobbing accusations, there's not much else he can do. He tried to get the law reinstated, but the Supreme Court — the next level in this tangled legal battle — refused to stay the lower court's ruling.

Charlotte erupts over police violence

A few months later, violence. And perhaps the biggest test of McCrory's term.

On a Tuesday afternoon, 43-year-old Keith Lamont Scott was fatally shot by a police officer outside a Charlotte apartment complex. Police said Scott, who was black, had a gun and posed an "imminent deadly threat" to police; his family says he was reading a book in his car while waiting to pick up his child from school.

Scott's death hit a nerve in North Carolina's largest city. Nightfall on Wednesday brought with it a second night of protests, some of which turned violent. Police clashed with a majority-black crowd, and amid the demonstrations came a shooting that left one critically injured.

McCrory has declared a state of emergency. At least one protester compared the scene to that several years ago in Ferguson, the Missouri city that has become a symbol of the national debate over police brutality.

"We cannot tolerate" violence and destruction, McCrory said at a press conference Thursday, his first time speaking publicly since Scott was killed. McCrory, who was mayor of Charlotte before becoming governor, added a personal plea for the image of his city: "Charlotte, North Carolina, is a great city. ... And we're not going to let a few hours give a negative impact on a great city."

Even if the anger and violence roiling his state somehow fades in the next few days, there are still plenty of landmines for McCrory to navigate over the next few weeks: A controversial police body-camera bill he signed in July that created a court-driven process whether to make the footage public (but some critics said restricted public view of footage) goes into effect on Oct. 1. And less than three weeks later, North Carolina's early voters begin casting ballots.