Battle of ideas at heart of fight against Islamic State
It is happening in the unlikeliest of places - but it is happening.
A counter-revolution against the ideas of so-called Islamic State (IS) is under way.
I have seen it for myself at first hand in a shabby-chic basement of a nightclub in Lebanon's capital, Beirut, and at an Islamic religious training centre in Rabat, where the elegant white stone walls are edged with the brilliant mosaics of Morocco.
Back in 2011, when the street protests of what we used to call the Arab Spring still appeared to represent an irresistible pulse of democratising energy, no-one foresaw that the violent Islamist extremist movements which had long been part of life in the Middle East would be among the main beneficiaries.
The response so far inside the Arab world has been patchy and uneven - but it is happening.
To get a sense of the multiple fronts on which this battle of ideas is being fought you only have to travel the length of the desert kingdom of Jordan.
In the southern town of Maan we attended a performance of a slapstick comedy called Terrorism At The Door, which is a play-with-a-purpose about a family dealing with the threat of extremist recruiters.
And further north in the capital, Amman, in the busy offices of the Iftaa - the body charged with issuing fatwas (Islamic legal rulings) for the kingdom's Muslims - we watched as scholars resplendent in tall red-and-white imaamah hats and long flowing robes issued pronouncements against the heresies of extremism on Facebook, Twitter and WhatsApp.
The rise of the dark and dangerous ideas behind IS cannot be traced to a single spring - that means that any answers too will have to draw on all sorts of different sources.
But in our conversations with young people themselves and with intelligence officers, writers, politicians and imams, we found ourselves returning again and again to the same theme.
The Middle East, they will all tell you, is a place where a generation of young men is growing up without jobs, without hope and without the power to change any of that through the ballot box.
All this in a cultural and religious atmosphere where distractions taken for granted elsewhere, like courtship, music and socialising in bars, are forbidden and you have an explosive cocktail.
The broadcaster and philosopher Ahmed Abbadi, who is chairman of the Council of Islamic Scholars in Morocco, says extremists have been good at analysing the pressures that have created a generation of angry young men across the Arab world and then glibly promising solutions.
"Put yourself in the skin of someone who's between 18 and 30 years old; jobless, wifeless and hopeless... knowing that there's wealth on the ground and that they don't see any of it.
"They [the extremist recruiters] would say: 'Look - if you feel worthless, I will marry you to the most beautiful and pious lady in the world. If you are jobless, I will make you head of intelligence. If you are semi-literate, I will make you the best scholar in Islam. If you want money, I have money and I will give it to you.'"
So the problem with analysing the state of the Arab world's fight-back against IS is that those are the kind of problems that take not months or years but decades to fix.
No quick cure
Developing better political structures, creating jobs and making cities more liveable are challenges that would tax the powers of the best-governed countries on Earth like the democracies of Europe and North America.
And in the Middle East, with its long history of colonialism and dictatorship, there is no home-grown tradition of good governance and no deeply-laid foundations of a civil society on which to build one.
So getting something done is going to be difficult - but that does not mean that nothing can be done.
The former Lebanese Finance Minister Jihad Azour, who is now a venture capitalist, makes the point that there was a time at the height of the Arab Spring when there was talk of establishing a kind of Marshall Plan for the Middle East - a new version of the American-funded reconstruction project which breathed new life into the battered continent of Europe after World War Two.
No-one is talking in those terms any more, but Mr Azour makes the point that it would be in the wider world's own interests to spend some money soon to start building more hopeful societies in which extremism would find it harder to flourish.
"It is," he told us, "always cheaper to fix than to reconstruct.
"Take Syria - if the fighting stopped today it would cost between 500 and 700 billion dollars to reconstruct the country.
"Fixing Syria's problems would have cost much less... And yes, we have to accept that it's going to take time, but that doesn't mean we need to wait to the end to see results - we'll start to see them gradually."
Still, even if the right things were done to cut off the supply of angry, disaffected young men who are ripe for recruitment by extremists, you could not realistically expect to see results for years.
But governments in the Middle East are also going to need to come up with a series of measures that will work much more quickly.
There is a military option of course - there always seems to be in the Middle East - but it is far from straightforward.
The countries of the Arab world lack both the political unity and the military capability to defeat IS on the battlefield without outside help.
The brutal truth is that there is a huge difference between spending large amounts on military equipment and having an effective war-fighting army.
Every intelligence official and military man I have spoken to agrees that IS could easily be defeated on the battlefield if the world powers could find a way to bring their combined force of arms to bear on the problem.
But in Syria it is clear that Russia, the United States, Turkey, Iran and Saudi Arabia all have different interests and objectives that make co-ordination difficult.
The former Jordanian Air Force Commander Maj Gen Mahmoud Irdaisat put it like this: "The problem is solvable militarily, but we'd need a joint effort from all the international parties - Russians, Americans, Turks and Saudis - and then we'd need boots on the ground, whoever those boots belonged to."
But then he added ominously: "Can anyone tell me that the Russians and the Turks can combine to fight Daesh [IS] while the Russians are supporting the Kurds and the Turks are fighting them?"
So in the absence of an easy military solution and in the face of a very long wait for economic answers, we have governments and a handful of courageous private individuals pushing back with a variety of religious, cultural and technical tools.
It may seem paradoxical that the underlying social, economic and cultural problems of the Middle East that appear to be driving young people into the arms of IS are being expressed through a form of religious extremism, but in the Middle East that makes a kind of sense.
Renad Mansour, an analyst with the Carnegie Endowment in Beirut, explained it like this.
"These are societies," he told us, "where the state blocks all forms of civil society, all forms of trades union and professional organisations. So one of the only places one can gather is the mosque. There's an element that the governments can't really monitor what goes on in those areas, and so you find religious leaders and clerics gaining ground.
"Now the reason why it's an extreme version of that religion is because people are dealing with immediate and harsh realities and they are looking for immediate change."
Muslims are adamant that critics of their faith who say the problem of violence is somehow inherent within it are simply wrong.
They regard the militants of IS as extremists who do not represent their faith any more than Christian extremists who firebomb family-planning clinics in the United States represent Christianity.
The most interesting front in that religious battle of ideas is in Amman, where scholars at the Iftaa do daily battle with extremism online.
It is an extraordinary place.
The scholars are deriving timeless lessons from an ancient religion but they are doing it on powerful computers dealing every day with contemporary questions from the faithful all over the world.
In the old days they were primarily social or ethical in nature - is it OK to smoke medical marijuana or put your parents in an old people's home?
But in recent years they have become darker.
When IS extremists murdered the captured Jordanian military pilot Moaz al-Kasasbeh last year, they contacted the Iftaa online, arguing that their actions were justified under Islamic law, or Sharia.
The imams of Amman are proud of the way in which they dismissed and corrected those arguments and warned that such killings are not permissible under Sharia.
If you are an outsider that might seem like an arcane argument conducted in grotesque circumstances - but in the Muslim world it is a powerful idea that the forces of mainstream Islam are pushing back into the online space that the extremists appear to have made their own.
And there are longer-term plans to counter the IS message too.
In the Moroccan capital, Rabat, King Mohammed VI has built a huge new centre for the training of imams in his country's peaceful interpretation of the faith.
The courtyards and corridors are teeming with students from Guinea, Mali and Nigeria.
There are women learning to be community leaders alongside the men training to be imams, and when they go home it will be to tackle extremists from Boko Haram and al-Qaeda.
The head of the institute, Abdessalem Lazaar, says the scale of the task is vast but that it can be summed up pretty simply.
"Morocco chose the true path of Islam and it will prevail," he told us. "I am talking about a moderate, positive, inclusive Islam."
"We're doing this to bring peace and to restore the true image of Islam, which was sadly distorted by a small minority of Muslims."
There is nothing new in that message of course, but there is something new in the way it is going to be transmitted - those West African imams are being trained intensively on how to use social media, and they all assured me they could not wait to go home and get started.
There is a widespread recognition that the extremists of IS are good at dominating the global conversation within Islam on subjects like Syria - partly because they were allowed to dominate that virtual space unopposed, just as they came to occupy large swathes of Iraq in the real world without facing any real opposition.
Belatedly, the forces of the mainstream Muslim world are attempting to start a kind of online counter-revolution.
The numbers are certainly on their side.
The Moroccan Islamic scholar Ahmed Abbadi obligingly did the sums for us.
"We have no less that 5 million religious officials on the payrolls of the various states within the region," he explained.
"If each of those officials displays just one Tweet a day then that's 5 million Tweets. Daesh are not very numerous and they've based themselves on the silence of the majority of Muslims."
Mr Abbadi's arithmetic certainly adds up, but you cannot help feeling that something in his perception of the internet itself does not.
The online world still has a counter-culture feel - it is a place the dark pornography of violence practised by the extremists flourishes and where you sense a more wholesome and well-meaning message from the middle-aged religious authorities may not do so well.
In this area too, though, there are signs that things may eventually change.
First - IS videos no longer have the power of novelty.
The world has grown accustomed to the savage butchering of defenceless prisoners and the grim enthusiasm of the suicide bombers in their final testimonies.
One young woman in Jordan - a Muslim in a headscarf, as it happens - told us those videos were designed as recruitment tools and that we should watch them as sceptically as we watch any other form of advertising.
She put it like this: "In the same way that advertisers exaggerate the qualities of their products, so Daesh by using people who understand technologies like video are able to scare us by exaggerating the things they do."
And it is not impossible to preach against violence in a way that seems cool too.
Power of ridicule
The theatrical performance in Jordan, Terrorism At The Door, had a message about how families can resist extremist recruiters.
The young audience loved it and almost everyone there appeared to be filming and photographing it. Every performance must generate thousands of Tweets and Facebook posts - all part of an attempt to win back that online space for moderation.
The same can be said of The Great Departed - a Lebanese band who can normally be found performing in the nightclub in Beirut.
They have a hit record that is a sarcastic prayer to Abu Bakr al-Baghdadi, the self-styled "caliph" of so-called Islamic State. You can find it on YouTube.
Suggest to the band that they are being very brave in antagonising him and they are dismissive; the real heroes, they will tell you, are fighting both the Syrian government and the Islamist extremists on the other side of the border.
But ridicule is a powerful weapon in the online world and a decent tune can act as what soldiers call a force-multiplier.
The extremists of the IS have established a dominant position in the online space of the Middle East in the last few years - but there at least some small reasons to believe that they may not dominate it forever.
Glimmers of hope
Our mission was to travel across the Middle East and to assess as far as we could the state of play in what has become a battle of ideas between the extremists of IS and authentic Islam.
We travelled at a time when it is clear that the various rivalries between the world powers who are intervening in Syria have created a set of circumstances in which overwhelming military power cannot or will not be brought to bear against the extremists.
In that depressing context you are left to look for other responses to the dark teachings of the violent fundamentalists.
The verdict? That mainstream Islamic authorities in some places at least are beginning to get their act together and that some sort of cultural push-back can be found too.
But depressingly, alongside those hopeful signs, we found a broad consensus that one of the main drivers in the rise of the cult of extremist violence was a failure of a string of governments across the region to deliver either decent lives for their people or the democratic mechanisms to change their systems.
It is a failure magnified by the long-term degrading of civil society in those places too.
The worry is that a problem that was long decades in the making might be many years too in the fixing.