If you were to design a building that would be particularly vulnerable to a spectacular fire, you would need to look no further than Notre Dame Cathedral in Paris.
The iconic building, initially constructed in the 12th and 13th centuries, was built with heavy stone exterior walls, a wooden roof made of old oak and, below that, a cavernous space, full of oxygen that feeds flames.
Notre Dame was intentionally designed this way. The roof was built of wood so that it could burn off if it caught fire, but the walls and other structures made of stone wouldn't burn down.
One big advantage of this architectural feature: The fire would be contained by the stone exterior and would not put the rest of the city at risk.
That appears to be what happened yesterday, the world watching in horror as flames shot through the 800-year-old structure.
While seriously damaged - the roof collapsed, its spire crumbled and parts of the wooden interior were charred - the fire appears to have done no harm to other buildings in the tightly packed Paris neighbourhood.
"I think what people should understand is the ingenious approach by medieval builders," said Kevin Murphy, a professor of art history at Vanderbilt University.
But some experts say cathedrals and other places of worship built centuries ago are hazardous to themselves, even if they were built with what passed in Medieval times as cutting-edge, fire-containing safety measures.
"Obviously, modern code was not written with cathedrals in mind," said James Shepherd, director of preservation and facilities at Washington National Cathedral.
A big question will now linger over any plans to rebuild Notre Dame: Should it be rebuilt exactly as before, even if it includes replicating the flammable oak roof? Or will government officials force modern fire regulations onto an iconic building?
"The technology of the building is not, of course, technology that we use anymore," Murphy said. "In some cases, the actual technology has been under debate for centuries. Trying to understand how it was built is not straightforward."
It'll be a process watched closely around the world. Throughout history, there have been a large number of fires at cathedrals and other buildings, from the Old St Paul's in London that burned during the Great Fire of 1666, to St Mel's Cathedral in Longford, Ireland, that was destroyed in a fire on Christmas 2009.
Kevin Fay, construction director at Gem Construction, which helped rebuild St Mel's, said some aspects of that blaze were similar to the Notre Dame firek.
"The fire got onto the roof space, which was all timber" in St Mel's, Fay said. The roof subsequently collapsed: "You ended up with a huge inferno inside the cathedral. The fire got to such high temperatures that the actual marble and stone crystallised."
Some of the damage at St Mels' came from the cold water sprayed over the site by fire services to put out the blaze, causing the masonry to rapidly contract. "You could hear the stonework cracking for days afterward," Fay said.
Shepherd, of Washington National Cathedral, said that historically, smaller churches had been most prone to fire as they were entirely made of wood. But the case of Notre Dame showed that the heavy wooden roof structures of some larger cathedrals were also a risk.
"The attic is out of site, out of mind," Shepherd said. "If something starts there it's harder to detect."
Modern tactics for containing fires - compartmentalising it into a small space where it can be contained - is hard to implement in a cathedral, which is by design an enormous open space.
The vast size of Notre Dame, as well as its symbolic value, will put pressure on those seeking to renovate it. The task of restoration is "hugely daunting because it's such a huge building. It can only be daunting," Murphy said.
Before restoration begins, there will need to be a survey of the damage. In the case of St Mels, the damage was so extreme that experts weren't allowed to return to the building for fear of problems with its structural integrity.
Instead, they entered the building through the now-removed roof, using mobile platforms and cranes.
Speaking today after the blaze was extinguished, French Junior Interior Minister Laurent Nunez told reporters that the overall structure of Notre Dame appears to be intact, but there were "some points of vulnerability," including in the vault.
Just a reminder of the power of rebuilding. Dresden's Frauenkirche in 1957 ... and today pic.twitter.com/BlpKUy2NSM
Gregory Bryda, a specialist in the architecture of medieval Europe at Barnard College, wrote in an email that the process of restoration will probably take years.
"The most significant hurdle going forward will be to shield not only the gaping holes in the cathedral's ceiling but also, frankly, the entire building, from the elements, since the roof functioned to siphon off the rain," Bryda wrote.
Once the rebuilding takes place, there will be major decisions to be made about whether the building is remade using traditional techniques or their more modern counterparts. In some cases, the decision may be made easier by the fact that many of the older techniques are difficult to reproduce in the 21st century.
The roof of St Mel's, for example, may look very similar to its original, but hidden within the timber roof structure are modern steel connective joints, according to Fay. Modern timber simply isn't as strong as the slow-grown timber that was used in construction years ago.
There will also have to be major decisions about what sort of modern fire systems to install, such as sprinklers that could put out a fire but potentially damage artwork and other valuable objects.
The challenge of rebuilding will be "immense," according to Jean Francois Bedard, an associate professor specialising in French architecture at Syracuse University. But in a certain sense, using exactly the same materials and restoring it to what it was before would be less in keeping with the history of the cathedral than innovating.
"It's not the first time" Notre Dame has been rebuilt, Bedard said. "Not to say that this is not catastrophic. But it's not the first time these buildings are being rebuilt."
The cathedral was restored in the 19th century by two architects - Jean-Baptiste Lassus and Eugene-Emmanuel Viollet-le-Duc. The spire that collapsed was designed then. Much of what is known today as Notre Dame was "Medieval visions of 19th century architects," Bedard said.
One thing isn't up for debate: Any restoration or repair will take money and a lot of time. The restoration of St Mel's took US$33 million and five years. Even with the vast sums of money already raised for Notre Dame, it's a far larger building at the heart of one of Europe's largest and most expensive cities.
"Put it this way," said Fay. "If you're walking back into Notre Dame Cathedral in 10 year's time, that's a major achievement."