The village of Tadmamet is just an hour’s drive south from the bustling city of Marrakech in Morocco. But it’s a world apart.
Nestled in the High Atlas mountains, its 400 inhabitants here are 40km (25 miles) away from the nearest village and live a simple, rural lifestyle.
Crops like barley, potatoes and apples are the main source of income. Most people don’t have cars. There are no smartphones to be seen and no internet connections. Even access to electricity can be a struggle, especially during the harsh winter.
But there may be a new way to meet their energy needs. And it’s from an unlikely source: the village’s place of worship, the mosque.
Last year, Tadmamet made news: it became home to the first solar-powered mosque in the country built from scratch. The roof is covered in photovolaic solar panels, which produce so much energy, it doesn't just power the mosque – and the house of the imam next door – but also parts of the greater village.
“It’s the first positive energy mosque in the country,” says Jan-Christoph Kuntze of the German Corporation for International Cooperation (GIZ), a German government agency that provided support for the undertaking.
The Tadmamet mosque is unique, and it's paving the way for other mosques of its kind. It’s part of the ‘green mosque’ project, an initiative launched by the Moroccan government three years ago, which aims to reduce the energy use of public buildings – starting with the country’s 51,000 mosques.
In mosques, lighting consumes the most energy, followed by power required for smaller daily tasks, like sound equipment used at prayer time and vacuum cleaning.
"The energy consumption of mosques isn't as complex as other buildings, so it’s a good place to start," says Kuntze.
Morocco is a Muslim country, so mosques play a central role in the society.
In Tadmamet, the mosque is also the only public building in the village. It’s being used as a teaching space to replace the tiny schoolhouse which is in need of repair.
“The children can now come here to study at any time because there are lights,” says Brahim Idbdslaam, the leader of the village association. “The school didn’t have lights.”
Taouli Kebira, a woman who lives in the village and whose family donated the land on which the new mosque was built, still remembers the days when people prayed by candlelight.
"If there was wind the candle would be extinguished and they would continue in the darkness," she says.
The mosque also powers streetlights at night. Previously, the village sat in darkness after sunset. And plans are afoot to use the extra electricity to pump water from the well for irrigation – something currently done manually.
The Tadmamet mosque is equipped with a solar water heater that fits snugly in a corner of the roof, providing hot water for ritual washing before prayers. And energy-efficient LED lights have been installed inside.
"Private households don't have hot water," says Kuntze. "Now, people from the village can take a hot shower in the washing room next to the mosque."
Electricity is expensive - so Kebira says that the other villagers would like to use solar in their homes. And although the price tags of PV panels and solar water heaters are dropping, in low income areas like Tadmamet, the cost is still prohibitive for personal use.
Still, the project is helping spread awareness and approval of green energy, and some are willing to make the purchase. And the cost benefits of solar energy could be more apparent in the long run: the mosque’s cheaper solar power has trickled down to the rest of the village.
“The energy bill of the old mosque used to be divided among members of the community, but now we don’t pay anything," says Idbdslaam.
Untold World is a special series from BBC Future that covers technology’s global impact, far beyond Silicon Valley. Discover more stories about how technology is profoundly changing underreported communities the world over.
It’s all part of a larger goal to produce 34% fewer emissions in Morocco by 2030 to support the Paris climate agreement. Last year, 100 mosques were renovated as part of the green mosque pilot project, including the two largest mosques in Marrakech.
The country currently relies on fossil fuels to meet its surging energy needs. In the past 10 years, the demand for electricity has doubled, partly due to new infrastructure projects. And about 97% of the oil, gas and coal it requires is imported.
Yet with more than 3,000 hours of sunlight per year, and ideal conditions for generating energy from wind and hydro power in several regions, Morocco is aiming to produce 52% of its energy from renewables by 2030.
The benefits of green mosques are a lot more than just powering a village. Climate change is being felt by Tadmamet locals first hand.
Droughts are frequent and there is a lack of water to irrigate their crops. "We used to water our crops once a week but now it is usually once a month," says Idbdslaam. "Our crop yields have declined."
He fears the situation will get worse, but the new technologies installed at the mosque have given him hope. "Using sustainable energy will help," he says.
One of the goals of the green mosque project is to educate the public about their benefits. The programme offers workshops and disseminates information on the radio to explain how green energy works. Imams and clerics explain how energy efficiency and green technologies can go hand-in-hand with values of respect, restraint and moderation encouraged in the practice of Islam.
"It's important to make the population aware of renewable energy technologies and to get people to start using them in their homes," says Kuntze.
Going green should also create new job opportunities. People working on the green mosque project are taught how to run energy audits and how to install and maintain the technologies being used.
In Tadmamet, villagers also gained additional skills since the mosque was constructed from scratch.
Since there were already plans to build a new mosque, it was put forward as a test subject. "Our project partners suggested to build an energy-efficient mosque that adheres to modern standards," says Kuntze.
Most houses in the village are made from stone and concrete. But to better resist the area’s scorching summers and freezing winters, the building is made from mud bricks was designed to retain an optimal temperature year-round, calling upon traditional building approaches.
Resident Ouaoufdi, who helped build the mosque, had heard of the techniques before but had never had the chance to implement them. And although he had building experience, he had typically used intuition to guide his work in the past. Now he has learned professional skills like project management and safety.
“Many young people were involved in building the mosque and now they have certification,” says Idbdslaam. “It will be good for their CVs when they apply for other jobs.
"We are very proud of our mosque," he says. "It’s a dream come true."
Mosque photos credit GIZ GmbH