It is evening in Piazza dell’Unità d’Italia and the stately palaces are the colour of the moon. On every elaborate façade stand carved figures of faces and lions or merchants’ names: Lloyds, Assicurazioni Generali. At cafés old women in fur coats and hats sit drinking Aperol spritzes. They come every day wearing the same hats and same furs, sit in the same chairs, and set their small, unruly dogs on their knees. On three sides of this square stand Habsburg-era buildings, large and imperial. On the fourth is the Adriatic sea.

I have come to Trieste every year for a decade and this is how I start my trip. Whether fresh off a bus, flight or the night-train from Rome, I drag my suitcase from the flaking central station, along the waterfront, past the canal and the statue of James Joyce, the opera house and the Greek Orthodox church where the courtyard always smells like incense, and into the piazza. I sit down in the 19th-century, mirror-walled Caffè degli Specchi and order a prosecco with a board of cheese and pršut: Slovenian ham in a Viennese café in an Austro-Hungarian square in Italy.

The architecture, food and drink of Trieste are all echoes of its hybrid history. This city of 205,000 people, just a few miles from Italy’s border with Slovenia, was once the great seaport of the Habsburg Empire and has been occupied variously since by Napoleon’s army and by Italy – with a brief, quixotic self-governing period in the 1950s – and later influenced by Yugoslavia.

All of this is visible in its public face: Serbian Orthodox and Catholic churches are reflected in the city’s Grand Canal, the waters of which now flow over the ruins of an old Jewish ghetto. The Roman amphitheatre abuts the Borgo Teresiano, named for the Habsburg Empress Maria Theresa who is venerated here with an intensity that other Italian towns reserve for the Madonna. It was under Maria Theresa’s rule in the mid-18th century that Trieste had its heyday, and she who transformed the medieval lattice of streets under the San Giusto Cathedral into a network of grand Mitteleuropean boulevards.

Most people in the city speak Italian, mingled with the Triestina dialect, which is full of loan-words from Croatian, Austrian-German and Greek. Most in the surrounding villages speak Slovene. A local dish is goulash. The favoured cocktail is the hugo, Italian prosecco flavoured with elderflowers from the Tyrol. It is named either for the sea-wind, or a bastardisation of “Yugoslavia” – like everything else in this city, there are plenty of conflicting stories, most of them false.

Yet the overpowering flavour of Trieste is nostalgia for the glories of its past. As Western countries start looking backwards for inspiration as well as for comfort, this singular city is capturing the mood of a new generation.

Molo Audace, a jetty into the Adriatic Looking towards Chiesa Parrocchiale di Sant’Antonio Taumaturgo

Outside Caffè degli Specchi Miramare Castle, on the Gulf of Trieste

Trieste has long been a city of expats and exiles, including Sir Richard Francis Burton, an explorer, and James Joyce, the writer who coined a phrase commonly cited by visitors: “triste Trieste”, an elegy to its lingering atmosphere of sadness. Jan Morris, a travel writer whose love affair with Trieste dates back to her time stationed there during the second world war, called it the ultimate “nowhere place”. It is greyer than other Italian cities and more sepulchral than most ports. The harshness of the bora wind, so strong that ropes are strung up to stop frailer nonnas from blowing away, affects the mood as much as it does the limestone cliffs of the surrounding Carso (karst) plateau. The carved gargoyles, titans and dragons are less alluring than the pastels of Venice, just two hours away. Yet something keeps luring me back.

Trieste is a place where people can be themselves. In the 1970s the municipal government opened up the mental institutions and let the inhabitants roam free. Eccentrics today do little to tone down their idiosyncracies. A prime example is Giorgio Deskovich Deschi, a courtly and impeccably dressed man in his 60s who carries around his grandfather’s first-world-war medals in an antique cigarette case. He is a proponent of Trieste’s nascent independence movement: across the city red-and-white flags wave in the windows of those who think Trieste, so culturally distinctive, should be its own Free Territory once again. Deschi has grand plans for the city, one day lobbying local lawmakers to extend the Grand Canal, the next to restore the Villa Obelisco, a 19th-century sanatorium where Richard Burton translated “A Thousand and One Nights”. Deschi hopes that funding might transform it into a kind of cultural centre for the new millennium. His ideas, he says, are all designed to restore Trieste to its rightful place as the “cool-weather Jerusalem” where cultures, religions and empires meet.

Over dinner of baccalà mantecato, a typically hearty Triestine antipasto of creamed stockfish on toast, he tells me about his latest grand project: a celebration for the 300th anniversary of Empress Maria Theresa’s death. He wants to take 100,000 roses to her grave at the Capuchin church in Vienna by sleeper-train, a celebration, he says, that will restore Trieste’s legacy as the former crown of the Austro-Hungarian Empire. He is meeting the mayor’s wife to discuss it. No train currently runs between Trieste and Vienna; cut roses do not live long. But Deschi has faith. “It’s Trieste,” he says.

Caffè San Marco The Teatro Lirico Giuseppe Verdi opera house

Dowagers and graduate students alike seem to share this nostalgia for Trieste’s former greatness (one recent student famously proclaimed that the only government he’d ever trust was that of the Austro-Hungarian Empire). At the gilded Teatro Verdi opera house, where tickets for “The Barber of Seville” sold out weeks in advance, most of the audience is over 60, wearing the definitive aesthetic of ageing Triestine style: fur coats with sequined silver capes. At cafés like Tommaseo, whole cabinets are devoted to memorabilia of writers who once frequented these tables. Even trendier joints, such as the new Antico Spazzacamino (The Old Chimney-Sweep), go for the vintage look: owner-designer Edy Supp has supplemented the old frescoes of harlequins with 1950s television sets, bicycles and frequent live jazz bands. This should be the natural habitat for a local devotee – Trieste is home of Illy, the coffee company, and each of the 50-plus ways to prepare coffee has a distinctively Triestine name. When I visit, Supp sighs as he prepares me a capo in B – a milk-laced espresso in a glass – and ponders the city’s future: “It really is triste Trieste, now,” he says. “But, you see, that’s what we’re trying to change.” Like Deschi he believes that Trieste can rise again.

The Serbian Orthodox Temple

Yet even when the bora rages, and the sky is white against the water, there is a strange sense of community in the collective melancholy. A whiff of fallen empire hangs in the haughty silence of Caffè San Marco, where local professors reserve tables, in the wintry Mitteleuropean heartiness of Buffet da Pepi, where gargantuan plates of pork and offal cost €9 a person, and among the unsmiling waitresses at Caffè degli Specchi. You can sense it, too, on the stark cliff-side walks between Duino and Miramare castles – the former where the poet Rainer Maria Rilke wrote his Duino Elegies, the latter where the Emperor Maximilian’s widow famously went mad.

One day, as I sit in chilly sunlight in the village of Duino, just outside the city, I encounter Paul Tout, a tour guide and wildlife specialist. He orders a capo in B and plunges into gossip as grand as its inhabitants’ many ambitions: the Argentine head waiter at the restaurant, he tells me, was once the butler to the late Prince of Duino Castle; land on the waterfront was sold off years ago to those who made their fortunes smuggling jeans over the border into what was then communist Yugoslavia, wearing seven or eight pairs at a time.

Tout drives me to the ruined San Giovanni in Tuba, a 15th-century church built on the ruins of a pagan temple to Speranza Augusta, a Roman goddess. It is beautifully preserved – and empty. Anywhere else in Italy, Tout says, these places would be thronged with visitors, but Trieste is far off the ordinary tourist route. What about locals, I ask? “Not even they know about it.”

Towards the end of my stay I accompany Deschi on a visit to Duja Kaucic Cramer, an elderly Catholic woman influential in the city’s political and ecclesiastical circles, who may help with his request for local funding to lay roses on Maria Theresa’s grave.

Cramer receives us with graciousness, wearing pearls and sitting in state among glass cabinets filled with her various collections (scores of Verdi operas; coins with Maria Theresa). As she offers us tea and macaroons, Deschi launches into one of his familiar elegies to the Habsburg Empire’s past: we must make Trieste great again; we must show our youth our legacy. He tells her about his plan for the roses.

She smiles. “Ché bel pensar,” she murmurs to herself, over and over. What a beautiful idea.

We all agree: ché bel pensar.

Where to stay

Trieste’s most luxurious hotel is the four-star Savoia Excelsior Palace (Riva del

Mandracchio, rooms from €120), just off the main square, with an elegant, minimalist aesthetic. For a slightly more off-beat feel, try the faded grandeur of the Duchi D’Aosta (Piazza Unità, rooms from €155). Where to eat

You can eat decent, traditional Italian food in Trieste, but more delicious is its Mitteleuropean-Venetian fusion cuisine, best sampled through the aperitivo hour. Try the offal-based meat platters at Buffet da Pepi (Via della Cassa di Risparmio) or the extravagant fish-based takes on Venetian chichetti, including the ubiquitous baccalà at SaluMare (Via di Cavana) along with typical Carso wines like red Teran or white Malvasia. For coffee – Trieste’s speciality – don’t miss the legendarily literary Caffè San Marco (Via Cesare Battisti), where you can eat sachertorte alongside your cappuccino.