Nancy Pelosi and Donald Trump have a lot in common.

Neither one drinks, yet they have family vineyards. They both love big bowls of ice cream. Their last names are – depending on the shade of the state – curse words. Pelosi was once dubbed “Mussolini in a skirt,” while she has compared the Donald to Il Duce, clocking their shared need to be at the centre of all conversations.

And the most powerful woman and most powerful man in the United States are both devilishly good at trolling – usually one another.

“If he could be president, this glass of water could be president!” Madam Speaker exclaimed disgustedly, as we ate omelettes in a restaurant by the bay after she mingled with adoring constituents in last Sunday’s glittery, feathery Pride parade.

Many in the crowd were still grateful to Pelosi, now 79, that in her first moments on the floor of the House in 1987, as the plague decimating gay men raged, she defied the advice of Democratic elders and sang out that she had come to Washington to fight Aids.

The fracas over the border Bill illustrates the treacherous nature of Pelosi’s job

She regarded the little box of chocolates I brought her with delight and said, “Now we’re talking,” popping one in her mouth as I asked about something less sweet.

Some House liberals have been furious with the speaker since she capitulated to Republicans and Democratic moderates and agreed to pass a Bill to send more funding to the southern US border, giving up demands for stronger protections for the migrant children ensnared in the nightmare of shelters there.

“The Mighty Moderates,” as they were christened wanted to show that they weren’t going to be pushed around by the liberals, who have so far got all the attention.

I asked Pelosi whether, after being the subject of so many you-go-girl memes for literally clapping back at Trump, it was jarring to get a bad headline like the one in HuffPost that day – “What the hell is Nancy Pelosi doing?” The article described the outrage of the Squad, as Alexandria Ocasio-Cortez of New York, Ilhan Omar of Minnesota, Rashida Tlaib of Michigan and Ayanna Pressley of Massachusetts are known.

Pelosi feels the four made themselves irrelevant to the process by voting against “our Bill,” as she put it, which she felt was the strongest one she could get. “All these people have their public whatever and their Twitter world,” she said. “But they didn’t have any following. They’re four people and that’s how many votes they got.”

Attacks

She has withstood attacks from left – and right – before, after all. Some top Democrats who called me before the 2018 midterms, urging me to write a column saying that it was time for Pelosi to go, admit now that they were wrong and that they love the way she put together a winning coalition and has got into Trump’s head.

While Democrats have been wringing their hands over whether a woman can beat Trump, or whether they should settle for getting one on the ticket as a helpmeet to a white male, Pelosi has offered a master class, with flair and fire, on how a woman can spar with Trump.

She pinned the blame for the border Bill on Mitch McConnell. In an era when millennials prize authenticity, she said, McConnell is “authentically terrible.” She has had a working relationship with him for years but now, she says, the Senate majority leader has “really crossed a threshold with me.” The trim speaker, wearing white pants and a purple cardigan to match her purple Manolo heels, stabbed her fork into one of my home fries.

The thing is that, every day Trump practically self-impeaches by obstructing justice and ignoring the subpoenas

“With all due respect, the press likes to make a story that is more about Democrats divided than the fact that Mitch McConnell doesn’t care about the children,’’ she said, referring to what she called “trash” stories about a supposed rift between her and Chuck Schumer. She also accused the press of “constantly enabling” Trump by allowing him to suck up all the oxygen and says journalists are “accomplices to their own denigration”.

“You would think that within a couple of days, 48 hours or so, of seeing that little child with her father, there would have been some challenge of conscience,’’ she said of Republicans. “But understand this: They don’t care.”

The fracas over the border Bill illustrates the treacherous nature of Pelosi’s job. Even with all her remarkable skill, it is a herculean task to weave together her anarchic progressives and the moderates who helped flip the House by winning in districts where Trump won in 2016.

On top of that, many Democrats see Pelosi as the thin blue line – albeit in fiery orange and hot pink hues – standing between them and a lawless Trump.

While the president was squandering millions to prove his manliness by rolling out tanks and jets on the fourth of July, Pelosi was holed up at her vineyard getaway in Napa with her family, eating Mexican food, rereading the Mueller report and preparing to unman the president with a thousand legal and legislative cuts.

While the number of House Democrats who want an impeachment inquiry is growing – it’s up to 80 now – Pelosi knows that giving in to that primal pleasure could backfire.

Is the Fifth Avenue trust fund baby who loves to play victim actually goading the Democrats into impeaching him?

“Oh, he’d rather not be impeached,’’ she said. “But he sees a silver lining. And he wants to then say, ‘The Democrats impeached me but the Senate’ – he won’t say Republicans – ‘exonerated me.’ The thing is that, he every day practically self-impeaches by obstructing justice and ignoring the subpoenas.”

Pelosi announced in a letter to her members on Wednesday that the House will hold the Trump administration in contempt on the census donnybrook.

I asked about the Politico report that she privately told Jerry Nadler and other Democrats about the president: “I don’t want to see him impeached, I want to see him in prison.”

She said: “I didn’t exactly say that,” and noted: “You can’t impeach everybody. People wanted Reagan impeached but that didn’t happen. Okay, they impeached Clinton for something so ridiculous – getting impeached for doing a dumb thing as a guy. Then they wanted to impeach Obama.” And now comes Trump, who she says, “has given real cause for impeachment”.

I ask her if the president ever pressured her on the issue.

“He may have one time said something like, ‘I’m glad you’re not doing this impeachment because there’s nothing there,’” she said. “But that means nothing to me.”

The speaker, who is trying to keep the party centre left, must know that getting Trump out of office is a goal that could be jeopardised by the fact that the Democrats lurched so far left in the first debates, with bilingual pandering and talk about busing and decriminalising illegal border crossings and abolishing private health insurance.

This is the politician whose name was synonymous for decades with extreme San Francisco liberalism. (A Saturday Night Live sketch in 2006 depicted Pelosi, played by Kristen Wiig, talking to a pair of chain-and-leather-clad aides, one with a ball-gag in his mouth.) Now, astonishingly, the woman formerly scorned as a pinko is the voice of moderation, urging the kids to turn down the music and slow their roll or risk having a second unbearable helping of Trump.

“If the left doesn’t think I’m left enough, so be it,” she said, breezily. “As I say to these people, come to my basement. I have these signs about single-payer from 30 years ago. I understand what they’re saying. But we have a responsibility to get something done, which is different from advocacy. We have to have a solution, not just a Twitter fight.”

What does she think about the latest sexual assault accusation from E Jean Carroll, the New York writer, who said Trump attacked her in a Bergdorf’s dressing room in the 90s?

“I respect the case she has but I don’t see any role for Congress, ” Pelosi said. Still, she marvelled: “How’s he president? Access Hollywood, porn stars, all the rest? So what else is new about him?”

Caveman

I ask her if dealing with the Neanderthals who were still roaming the Capitol’s marble halls when she first got to Congress taught her how to handle a caveman like Trump.

She said the president is always “courteous” with her in private, but also conceded: “I’ve never encountered, thought about, seen within the realm of my experiences as a child or an adult, anybody like this.”

Does she ever confront sexism any more on the job?

For an answer, she picks up a mini-gavel emblazoned with a pride rainbow that she’d been carrying during the parade, and pounds it on the table, looking mischievous.

Pelosi is womanly – often surrounded by her children and grandchildren – and yet she seems blithely unencumbered by insecurity about her gender.

This is in marked contrast to Hillary Clinton, the only other woman who rose to these heights in American politics. She was certainly tough enough, brainy enough and experienced enough to take on Trump. But she was always getting wrapped around the gender axle, ignoring Tina Fey’s advice to take a bad-ass “bitch is the new black” approach.

If combating an inhumane Trump requires a superhuman effort, Pelosi may be just the woman to do it

Unlike Pelosi, who passionately fought the misbegotten Iraq war, Hillary enabled George W Bush’s folly, afraid if she voted against it she would seem like a hippie chick. At the behest of Mark Penn, who said they don’t call it the “father of the country” for nothing, Hillary ran emulating a man in 2008. Then she did a 180 and self-consciously ran as a woman in 2016, with a Katy Perry soundtrack and Lena Dunham guest spots, trying to lure back young women from Bernie Sanders.

Pelosi also seems impossibly untroubled by those years of being hated and mocked and underestimated by so many. Ocasio-Cortez has now replaced Pelosi as top villainess on Fox prime time and the more moderate Pelosi’s poll numbers have risen. Beyond the veneer of San Francisco sophistication, she is always deftly channelling her father, Tommy D’Alesandro, the onetime boss of Baltimore politics. Trump’s lame attempt at a nickname – “Nervous Nancy” – did not make a dent because she’s anything but nervous.

Her experiences with the last two Democratic presidents were not exactly a stroll down the Embarcadero.

Bill Clinton upended his party with his reckless, selfish affair with an intern. Barack Obama never could have scooted past Clinton Inc without Pelosi’s well-manicured thumb on the scale for him, and he certainly could not have passed the Affordable Care Act without her muscle. But in the midterms that followed, Pelosi lost 63 of her foot soldiers and her gavel; some in the party felt that Obama had failed to supply enough air cover for the members who had gone out on a limb for him after Pelosi cajoled and prodded in a manner that LBJ would have admired.

Now Pelosi is in her element, ready for the fight of her life with Trump.

“Everyone thought she was at the sunset of her career and she’s written a whole new act,” one of her former critics recently gushed to me.

Two of the men who tried to run her out of office – Tim Ryan and Seth Moulton – are now floundering in the presidential race, while Pelosi keeps moving forward, a shark with a permagrin.

Border Bill

Trump called Pelosi from overseas to congratulate her on passing the border Bill.

“I actually think if he were here, we might have had a better shot” at getting more of what the Democrats wanted in the Bill, she said. “One thing he understands is the public view of things.” She said that when she urged Trump to speak to Xi Jinping about religious freedom for the Uighurs and democracy in Hong Kong, he typically was focused on the size of the crowd at the protests. “Did you see they had two million people in the streets?” he asked her, impressed.

If combating an inhumane Trump requires a superhuman effort, Pelosi may be just the woman to do it. Her staffers tell the story of how, last April, Pelosi was with a congressional delegation in Dublin, about to deliver a major address to the Dáil. As she got into her Suburban in the motorcade, a 300-pound armoured car door was accidentally closed on her right hand, crushing it in the locking mechanism.

The attending physician could offer her only ordinary Band-Aids to stop the bleeding from the wounds on her hand and Advil for a tear so bad that doctors who stitched her up afterward said that she could have lost her fingers.

Pelosi not only managed to get through the speech. She shook hundreds of hands without flinching. When I asked her about it, she was only rueful that she couldn’t concentrate enough to speak the Irish she had practiced.

“But Bono came,” she said with her bright grin. “And that really was fabulous.”