In a madrassa in the Afghan capital, rows of teenage girls rock back and forth reciting verses of the Koran under the watchful eye of a religious scholar.
The number of Islamic schools has grown across Afghanistan since the Taliban returned to power in August 2021, with teenage girls increasingly attending classes after they were banned from secondary schools.
"We were depressed because we were denied an education," said 16-year-old Farah, a veil covering her face and hair.
"It's then that my family decided I should at least come here. The only open place for us now is a madrassa."
Instead of maths and literature, the girls focus on rote-learning the Koran in Arabic -- a language most of them don't understand.
Those who want to learn the meaning of the verses study separately, where a teacher translates and explains the text in their local language.
AFP visited three madrassas in Kabul and in the southern city of Kandahar, where scholars said the numbers of girl students have doubled since last year.
For Farah, her ambition of becoming a lawyer was dashed when Taliban authorities blocked girls from secondary school -- and months later banned women from attending university.
"Everyone's dreams are lost," she said.
Still, Farah -- whose real name has been changed to protect her identity like other students AFP interviewed for this story -- counts herself lucky in that her parents allowed her to attend classes at all.
- Education deadlock -
The Taliban government adheres to an austere interpretation of Islam.
Rulings are passed down by the reclusive supreme leader Hibatullah Akhundzada and his inner circle of religious advisers, who are against education for girls and women, some officials say.
Akhundzada has ordered hundreds of new madrassas to be built as he establishes his Islamic Emirate based on sharia.
Authorities in Kabul have given several excuses for the closure of girls' schools -- including the need for segregated classrooms and Islamic uniforms, which were largely already in place.
The government insists schools will eventually reopen.
Education is the main sticking point behind a deadlock with the international community, which has condemned the stripping away of freedoms for women and girls.
No country has recognised the Taliban government, which is battling to keep afloat an economy where more than half the population face starvation, according to aid agencies.
Hosna, a former university student studying medicine, now teaches at a madrassa in Kandahar, reading verses of the Koran to a class of more than 30 girls who repeat the words back to her.
"Studying in universities helps to build a future, makes us aware of our rights," she said.
"But there is no future in madrassas. They are studying here because they are helpless."
The madrassa, located in an old building, has small classrooms with no electricity.
Despite the financial constraints faced by the management of the school, dozens of students attend classes for free.
- Friendship and distraction -
The educational value of madrassas is subject to fierce debate, with experts saying they do not provide the necessary skills for gainful employment as adults.
"Given the present conditions, the need for modern education is a priority," said Abdul Bari Madani, a scholar who frequently appears on local TV to discuss religious affairs.
"Efforts need to be taken so that the Islamic world is not left behind... letting go of modern education is like betraying the nation."
Around the world, some madrassas have been associated with militancy.
Many of the Taliban's leaders were educated at the Darul Uloom Haqqania madrassa in Pakistan, which earned the nickname "University of Jihad".
Niamatullah Ulfat, head of Islamic Studies at Kandahar province's education department, said the government is "thinking day and night on how to increase madrassas".
"The idea is that we can bring the new generation of this country into the world with good training, good teachings and good ethics," he told AFP.
Yalda, whose father is an engineer and mother was a teacher under the ousted US-backed regime, was top of her class at her old school, but still shines at the madrassa and has memorised the Koran within 15 months.
"A madrassa cannot help me in becoming a doctor... But it's still good. It's good for expanding our religious knowledge," the 16-year-old said.
The madrassa, on the outskirts of Kabul, is divided into two blocks -- one for girls and the other for boys.
Still, classes are held at different times to ensure there is no interaction at all between the two sexes.
Several girls told AFP that attending a madrassa does provide some stimulation -- and the chance to be with friends.
"I tell myself that some day the schools might open and my education will resume," said Sara.
If not, she is determined to learn one way or the other.
"Now that there are smartphones and the internet... schools are not the only way to get an education," she added.