Danielle Rowley, the new Labour MP for Midlothian, wants to get one thing straight. “A lot of people automatically assume all of my politics comes from my dad,” the daughter of Scottish Labour’s deputy leader, Alex Rowley, says. “While I am influenced and inspired by him, I grew up with my mum and her parents. I have politics in all sides of my family.”

Both Rowley’s grandfathers were miners and Labour party activists. Her mother was a trade unionist and a case worker for the last Midlothian Labour MP, David Hamilton. “She was a very strong woman, a single parent, a hard worker,” Rowley says. At 27, she is upholding the family tradition by becoming Labour’s youngest MP.

When we meet in Portcullis House, in Westminster, she is dressed soberly in a navy suit jacket and blue print dress. She hopes to inspire young women in her constituency. “I grew up on a council estate,” she says. “I hope it shows them they can do any job they want to.”

Even so, Rowley’s election was a surprise. In 2015, Hamilton resigned and Midlothian went to the Scottish National Party’s Owen Thompson with a 23.4 per cent swing. Rowley, a campaigns officer for the housing charity Shelter, kept her expectations modest. After a nail-biting night, she won with a majority of 885.

“Obviously I had the aim of winning, but I was not getting my hopes up too much,” Rowley recalls. “I was thinking I could really reduce the SNP majority, that was all. But every day on the doorstep I got more and more hopeful.”

Rowley’s father Alex is a firm supporter of Labour leader Jeremy Corbyn (Scottish Labour leader Kezia Dugdale backed Owen Smith in the 2016 leadership contest), and is seen as being softer on independence than the official party line.

But Rowley says her anti-independence views come from her constituents: “People were fed up of the idea of another referendum.”

In 2014, the independence movement caught the imagination of much of Scotland’s youth – the majority of young voters opted for Yes. So why did Rowley buck the trend? “I am very strong willed,” she says. She spent the referendum working for Gordon Brown, and was there in Kirkcaldy when Yes supporters egged the Labour MP Jim Murphy. “I got a bit of egg on me that day. You can see me [in the photos] in a red raincoat ducking out of the way.”

She believes the same hope which pushed young voters towards independence may now be blowing in the sails of Labour. “I have got a lot of friends who were part of the Yes movement,” she says. “I think there is an assumption they would support the SNP, but actually most of them voted Labour.”

The Corbyn surge, then, is real. “People were fed up, but they needed to be given something to give them hope,” she says. “I think Labour gave them something to offer.

“Whenever we had younger voters on the doorstep, they were excited about the manifesto. Even some of my friends who hadn’t voted were excited about it.”

As for the suggestion – floated by the Labour MSP Neil Findlay – that it should have spent more time talking about Corbyn and less about independence, Rowley demurs. “You couldn’t have just opposing independence, you couldn’t just have the manifesto,” she says. “You had to have both.”