“Everyone was leaving the village where I grew up, and it was all because of water,” says Jamila Bargach, whose village in rural Morocco has steadily emptied of people amid severe water stress.

As in most of rural Morocco, climate change and population pressures have led to more unpredictable rainfall patterns and the depletion of natural water sources, such as underground aquifers, in the area around the village of Taloust. Situated in the country’s south-west Sidi Ifni region, close to the coast, the area is extremely arid as it borders the northern Sahara desert. Average annual precipitation is less than 130mm.

In recent years, repeated cycles of intense drought followed by flash floods have led to deaths and the devastation of local infrastructure. Desertification, land degradation and the advance of the Sahara also affect the area.

However, the Sidi Ifni region does have one precious resource: fog. “We began to read about ‘fog harvesting’ projects around the world, and we wondered if we could repeat it here,” says Bargach. “Our observations started in 2006, and we saw that on average we have 143 days of fog a year.”

The fog is caused by a unique microclimate. Warm air driven by ocean currents makes landfall on Morocco’s Atlantic coast around the town of Sidi Ifni; as the humid air rises, it hits the natural barrier of Morocco’s Anti-Atlas mountains, which start just 35km east from the coast and rise to more than 2,500m. From there, the air turns into blankets of thick fog, particularly between December and June. For years, the community saw this as a bad thing: they believed the fog prevented rainfall, turned fields to mud and made people ill.

“Lots of people were reluctant – and even negative – at the beginning of the project. Some even thought that cloud water would not be safe to drink,” says Bargach, who is now director of non-profit organisation Dar Si Hmad. “We weren’t sure if it was going to deliver and we didn’t want to disappoint people. But slowly people began to be convinced, and now the local women call the nets their ‘wells’.”

Over the past 10 years, Dar Si Hmad has erected vast mesh nets to capture the moisture at an altitude of 1,225m on the slopes of Mount Boutmezguida – for what is now the largest fog-harvesting project in the world. About 600 square metres of mesh nets capture water particles from the fog, which then condense and drip into collection trays. Roughly 6,300 litres of water can be harvested daily. The water is then filtered and mixed with underground water. More than 8km of pipelines have been installed to share the water between about 400 people in five villages.

Once seen as a bad thing by villagers in Sidi Ifni, fog is now captured to provide water

The benefits are obvious: clean water that is both instant and free. “We used to spend at least four or five hours going to collect water every day from wells in neighbouring villages, or collecting the rain in tanks during the rainy season,” says Zeyna Hamou Ali, 20, a local woman who works as a coordinator for Dar Si Hmad. “This made it very difficult for us to go to school because it’s just accepted by everyone that it’s a woman’s job to go and get water.”

The population of these areas of south-west Morocco consists predominantly of rural Berber women, the indigenous inhabitants of north Africa who speak a dialect of the Tamazight language. Rates of illiteracy among rural communities in Morocco are surprisingly high: more than 40%, with women accounting for the lion’s share of that figure. Dar Si Hmad also provides training and educational opportunities to women from the villages.

Nets capture moisture, which is collected and filtered, and then mixed with underground water

The idea of harvesting fog was first developed in South America in the 1980s and there are other projects in Chile, Peru, Ghana, Eritrea, South Africa and California in the US. In 2017, Dar Si Hmad plans to start installing the next generation of bigger and better “cloudfisher” nets, developed in Germany. These larger nets will double the amount of water collected and connect another eight villages to the network.

In recognition of its contribution to finding innovative, community-led solutions to climate change, Dar Si Hmad was awarded the 2016 UN momentum for change award. Ali and the project’s directors travelled to collect the award at the COP22 climate change conference, which took place in Marrakech in November. “This is the first time I’ve left my village,” said the wide-eyed Ali at the glittering event. “You can see how much this project has changed my life.”