Image copyright Diego Chaves / O Imparcial

Last summer the mayor of a forgotten corner of Brazil went on the run, accused of skimming millions from public funds. Lidiane Leite bragged about how much money she had on Instagram and directed staff back at the office via social media. Known as the WhatsApp mayor, she became an emblem of Brazilian corruption.

For years, Turi do Augusto has been promised a new school. This small village of nearly 60 families in the municipality of Bom Jardim lies deep in the heart of one of Brazil's poorest regions.

Jonas da Silva unlocks the rough wooden door to the building that currently serves as the school, and reveals classrooms in shocking need of repair. The dirt floor is potholed, the mud walls crumbling, and the water fountain broken.

"It's like a place to keep your pigs," says da Silva, the caretaker.

During term time 50 children study here. And in a poor community like this one, with no running water, many families rely on school to provide a meal for their children.

"When Lidiane was mayor they never had food at school," he says.

It was the absence of school meals across Bom Jardim - reported by parents - that triggered the investigation into the mayor and her associates. The authorities looked at Lidiane Leite's social media feeds:

"Before I became mayor, I was poor. I had a Land Rover, now I drive a [Toyota] SW4," she wrote on Instagram. "Maybe I should buy a more luxurious car, because - thank you God - I have enough money to do it.

"I can buy whatever I want," she boasted. "I'm going to spend money on what I want and I don't care what people say about me."

Alarm bells rang. Now, after months of looking into the affairs of small, sleepy Bom Jardim, with its mango trees and cattle, prosecutors believe $4m (£2.7m) may have been embezzled from the public coffers.

Image caption Lidiane Leite's Instagram page reads: The best place in the world is inside a hug! GOD IS MY LIFE, I LOVE YOU LORD / Joao Emanoel, mummy's son. Bom Jardim - MA.

So how did it all go so wrong in a community of 40,000 people?

Lidiane Leite, who is 25, used to sell milk door-to-door. In 2012, her boyfriend, Beto Rocha (also under investigation), was prevented from standing in the mayoral elections under Brazil's so-called clean slate law, which bars people from running for political office if they have been accused of corruption.

Leite stepped into her lover's shoes. Once she was elected, she appointed Beto Rocha her secretary of political affairs, and it seems he became responsible for the day-to-day running of Bom Jardim.

Meanwhile, Leite spent much of her time in the capital of the state of Maranhao, Sao Luis, a four-hour drive away. In the city, she drank champagne at parties, went to the gym and did a lot of shopping. She talked about her lifestyle on social media but as mayor of Bom Jardim she still had to attend to administrative matters. Enter WhatsApp. Setting up a WhatsApp group called "Task Force", Leite communicated with her secretaries back home.

But the state and federal authorities were beginning to investigate the missing millions. And when a warrant was issued for Leite's arrest, like a storyline from a Brazilian soap opera, she went on the run.

While she was a fugitive she continued sending WhatsApp messages back to Bom Jardim, warning her secretaries not to collaborate with prosecutors, and insisting she was still mayor.

Image caption Life in Bom Jardim is a far cry from the world Leite described on social media

Find out more

Listen to Linda Pressly's report from Bom Jardim on Crossing Continents on BBC Radio 4 on Thursday 7 January at 11:00 or catch up later online.

Fabio Santos de Oliviera, the state prosecutor, shakes his head in disbelief - more than 10 people under investigation, money pilfered from every part of the budget, but especially health and education.

"In one case, she contracted fake companies to rebuild three schools in Bom Jardim, that way she could steal money from the budget," he claims.

In the prosecutor's stack of thick manila files there is a photo of a small store, its shelves lined with oil, sugar - basic household goods.

"How could this shop win a contract of more than $150,000 (£100,000) to rebuild schools? That's what happened here."

And so far none of the cash has been returned.

"We blocked the bank accounts of all of the accused, but we didn't find any money. However, we have confiscated houses and cars," he says.

Thirty-nine days after she fled, Lidiane Leite turned herself in. Now she is living in Sao Luis, and has to wear an electronic tag while the investigation continues. Her lawyer has stressed her youth and inexperience - and her innocence. A court order bans her from visiting Bom Jardim.

In Bom Jardim, people are reluctant to talk about the case - instinctively they steer clear of commenting on vested political interests that have dominated Maranhao for generations. But they also feel ashamed and angry - they struggle to understand how it could have come to this.

What happened here reflects a much broader problem in Brazil. At the national level there is incredulity in the face of a multi-billion dollar corruption scandal playing out at Petrobras, the state oil company. "Lava Jato" or Operation Car Wash has so far yielded more than 100 arrests, sucking in heavy-weight politicians and industrialists.

Brazilians gasp at the immense scale of it - the shrink-wrapped bricks of bank notes strapped beneath the clothing of a dedicated money mule, the cash stolen and splashed out on art and jewellery. With Brazil's currency fragile after losing more than a third of its value in 2015, its economy shrinking and President Dilma Rousseff threatened with impeachment accused of budget irregularities, events at Petrobras only compound the national crisis.

"Our laws are too weak to tackle this," says Francisca Maria Mimora, a teacher at the tumble-down school in Turi do Augusto. "We've been promised a new school here in Turi, but no one believes it will be built. And it isn't just because of what happened with Lidiane. Corruption has been happening here for a long time - no one can do anything about it."

Image caption Francisca Maria Mimora (left) doesn't believe her pupils will get a new school any time soon

When Lidiane Leite was removed from her post, the vice-mayor of Bom Jardim took over.

"It's difficult to improve our school buildings and buy food for the children because of the hole in the budget," says Malrinete Gralhada. "But we are committed to doing something good for our kids, and to rescuing Bom Jardim from a dark place."

Image caption Malrinete Gralhada is now in charge

And, she says, the municipality has begun the process to get a new school built in Turi do Augusto.

But why was it that people like her - in positions of power - did not blow the whistle?

"I was Lidiane's vice-mayor, but I was prohibited from attending the meetings. It was like a dictatorship at the council."

Polls suggest that across Brazil there is little confidence in politicians. Prosecutors, however, are riding a wave of popularity - everyone wants a selfie with Sergio Moro, the federal judge overseeing the Petrobras investigation. Demonstrators carry cardboard cut-outs of him, and in restaurants, diners spontaneously applaud when he enters.

In Maranhao, the state prosecutor, Fabio Santos de Oliviera, is determined to get justice for Bom Jardim.

"Corruption is a national problem - the worst sickness we have in Brazil. But I don't think it's worse than before. It's more visible nowadays because we have more investigations - we know more about what's happening in the country."

Leite is waiting for her case to come to court. Some see her as a victim - a young woman who made the wrong choices and kept bad company. Others believe she was old enough to know better. Either way, with her catastrophically misjudged social media presence, Lidiane Leite finds herself an unfortunate poster child for sleaze in Brazil.

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.