Rep. Barbara Comstock (R-Va.) in 2017 in Washington. (Katherine Frey/The Washington Post)

Mark J. Rozell is dean of the Schar School of Policy and Government at George Mason University.

Northern Virginia Rep. Barbara Comstock (R) has done a reasonably good job of insulating herself from the immense unpopularity of President Trump. But there is another issue that could pose a serious threat to her reelection this year: guns.

Let’s first look at how Comstock has dealt with the Trump card.

The president’s policies and outlandish behavior have fired up Democrats around the country, including in Northern Virginia, where Comstock is seeking her third term in Congress.

Comstock’s now blue-leaning Northern Virginia district went for Hillary Clinton by 10 percentage points in 2016 , and for Democratic gubernatorial candidate Ralph Northam by more than 12 points this past November.

Democrats label Comstock one of their top targets in this year’s midterm congressional elections. Ten Democrats have come forward to challenge her.

But Democrats should resist the temptation to feel overconfident. Comstock is no pushover.

The 10th District includes Democratic territory — Loudoun County and parts of Prince William and Fairfax counties — as well as deeply Republican rural counties on the West Virginia border in the Winchester area.

Comstock’s survival in Congress thus far — she was reelected by nearly six points even as Clinton carried the district two years ago — is a tribute to her constituent services and her ability to balance competing political forces in the district.

A lawyer by training, Comstock was an aide to Rep. Frank R. Wolf, who represented the 10th District for 34 years. She was chief counsel to a congressional committee looking into government waste and a public affairs officer at the Justice Department. She won three terms in Virginia’s House of Delegates before winning her congressional seat.

Regarding the unpopular current president, Comstock has shown the kind of independence that moderate Virginians appreciate (even though Democratic activists point out that she has voted with Trump 97 percent of the time).

During the presidential campaign, Comstock called on Trump to withdraw from the contest after the “Access Hollywood” tape revealed he had bragged about groping women.

She has been outspoken in her criticism of politicians accused of sexual abuse, including Alabama U.S. Senate candidate Roy Moore, whom Trump supported.

Comstock very publicly broke with the president by voting against Republican legislation to repeal Obamacare.

And, Comstock generated national headlines when she rebuked the president during a meeting last month at the White House on the dangers of the deadly gang MS-13.

The president announced that if congressional Democrats would not support a legislative crackdown on dangerous illegal immigrants, he would advocate shutting down the federal government.

“We don’t need a government shutdown on this,” countered Comstock. “I think both sides have learned that a government shutdown was bad, it wasn’t good for them.”

Comstock called it “a polite conversation.” Everyone else called it an extraordinary public scolding of a sitting U.S. president.

Beyond policy considerations, it was good politics for Comstock. She knows government shutdowns are now blamed on the Republican Party and that they are detested by the thousands of federal government workers and contractors in her district.

Yet, what may push Comstock off the political tightrope she’s walking is the guns issue.

Something feels different about the aftermath of the nation’s latest gun massacre, the mass shooting at Marjory Stoneman Douglas High School in Parkland, Fla., on Feb. 14. Surviving students and grieving parents refuse to back down from their demands for action. The momentum on the guns issue appears to be changing.

Comstock is vulnerable here. Last October, she ranked 10th among members of the House in accepting contributions from the National Rifle Association — more than $137,000, according to the New York Times.

Democrats will run hard on gun control. They will pressure Comstock to do more than just tweet about better funding for school-resource officers.

But if Comstock supports anything that even looks like gun control, she runs the risk of energizing the famously excitable gun lobby and perhaps even fueling a credible June primary challenge to her renomination.

Assuming she gets past the primary, Comstock then runs into major head winds: an unpopular GOP president, the shifting politics of gun control and a likely blue-wave election year. Reelection increasingly looks like a tall order for the 10th District incumbent.