As the Conservative party conducts its postmortem on the 2017 general election campaign, it will no doubt study the apparent surge in support for Jeremy Corbyn from young people. However, the party would do well to look deeper and recognise failures in other important areas.

In her shortlived campaign to be prime minister last year, Theresa May promised to lead “one nation … that works not for the privileged but for everyone”, a pitch that appealed to a large cross-section of the British public, not least thousands of Muslims and other minority groups who align closely to the core conservative values of family, meritocracy and aspiration, free enterprise, public duty and charity.

However the famous “nasty party” description of the party seems to have resonated far more at this election, with Muslim communities apparently turning away from the party in large numbers, according to analysis by the Muslim Council of Britain.

Muslim voters had the potential to affect the outcome of 33 swing seats in which the Conservative party was first or second – and in all bar one, there was a swing of well over 10% towards the Labour party (compared with a national swing of about 2%). Not only did the Tories fail to win even one of these seats held by Labour, they lost eight of the 12 marginals where they were the incumbent party.

The pull of Jeremy Corbyn’s broader anti-austerity message “for the many, not the few”, appears to have been a key driver for that result, striking a chord among many Muslims for whom public services and decreasing inequality are key priorities. His success with young voters would also disproportionately affect Muslim communities, given that half the British Muslim population is under the age of 25.

Yet we cannot ignore other Muslim-specific issues that may have played a role in pushing Muslims away from the Conservative party.

On the key issue of Islamophobia, the party appears to have ignored the huge increase in hate crime against Muslims on its watch. During the election campaign, when Amber Rudd (who has retained her position as home secretary) was asked how to stop ill-feeling towards Muslims on the ITV’s Peston on Sunday, she said: “We need to do more to prevent grooming in these communities” – a worrying victim-blaming approach to tackling hate crime.

Even the Anti-Muslim Hatred Working Group, set up for this purpose, has been all but discarded, with its advice consistently ignored, leading to the resignations of Dr Chris Allen, Muddassar Ahmed and Professor Matthew Goodwin. Lord Leveson’s recommendations on media regulation have also been shelved by the Conservative party, despite the media, according to Cambridge University, being one of the biggest drivers of Islamophobia and fuelling hostility towards Muslims.

It is possible that a party can emerge that realises the fallacy of appealing to the far right. Change can happen

It is not just inaction that has been the problem. The former Tory cabinet minister Sayeeda Warsi said there was a “simmering underbelly of Islamophobia in the Conservative party” – there is a wealth of evidence that supports the idea that Islamophobia is prevalent in the party.

To cap it all, the prime minister effectively condoned prejudice by selecting Zac Goldsmith as a prospective parliamentary candidate, despite his campaign for mayor of London being roundly described by some of his own colleagues as Islamophobic .

The prevalence of bigotry within the party has only been reinforced by the way it has failed to engage with Britain’s three million Muslims – and even when it has done so, it’s been almost entirely through the prism of extremism.

For instance, as part of the government’s widely castigated counter-extremism strategy, the prime minister wants to launch a hunt for Muslim extremists across the public sector following the so-called “Trojan horse” plot to take over schools in Birmingham.

Yet the education select committee determined there was no “evidence of a sustained plot” or of “extremism or radicalisation” in what the writer James Fergusson has called “the Trojan hoax”. Even the banning of five senior teachers for apparently being involved in this “plot” has been found to be an “abuse of justice”.

The prime minister even wanted to rip up our human rights protections as part of her approach to counter-terrorism. And the government appears to flatly ignore concerns about its Prevent strategy unfairly targeting Muslim communities from critics not only from within Muslim communities but from across the political spectrum, human rights groups, academics, civil liberties groups, teachers, students, security experts, including the ex-head of MI5, psychiatrists and even the United Nations.

With this backdrop and despite its rhetoric on engaging with extremists, Britons should not take the prime minister’s grandstanding on extremism seriously. She and her party are bedfellows with the vilest of regimes. This government, for instance, parades its close relationship and arms deals with Saudi Arabia and other autocrats whose records on extremism and human rights abuses are well documented.

And it appears to be reaching an arrangement with the DUP – a party whose views on individual liberty, climate change, gender equality and respect for other faiths would make many of its members “extremists” (albeit not Muslim) by the government’s own definition.

It is possible that a Conservative party can emerge that realises the fallacy of appealing to the far right; it is possible that the party could return to Theresa May’s vision: one that is hopeful, not fearful, and in line with the conservative roots of the party; and it is possible that the Conservatives could, one day, be the party of choice for Muslim entrepreneurs and aspiring families, championing “fairness not favours”.

It won’t happen overnight, and it won’t happen through superficial platitudes such as visiting mosques (although that would help). But change can happen. For the good of the country, I hope it does.