DUBROVNIK, Croatia (Reuters) - Beneath the bell tower in Dubrovnik, behind the cold stone walls of the city's state archive, there is a map drawn by hand depicting an age of empires.
Of unknown date, its faded lines show the 'Republica di Ragusa', the city-state forerunner to Croatia's Dubrovnik, squeezed between the rival Venetian Republic on the coast and the vast Ottoman Empire in the hills to the east.
"Venice was Dubrovnik's sworn enemy," says Croatian historian Niko Kapetanic.
But the tiny maritime republic, its walled old town now a UNESCO world heritage site and a magnet for tourists, was far more adept at diplomacy than war. So in 1699, Dubrovnik agreed for the Ottomans to extend their reach to a 20-km (12-mile) strip of thinly-populated Adriatic coastline, creating a land buffer against the encroaching Venetians.
The deal would defend Dubrovnik until the city fell to Napoleon at the start of the 19th century, but it has come back to haunt Croatia as the country of four million people prepares to join the European Union next July.
The short stretch of coastline passed to modern-day Bosnia as the country's only outlet to the sea, growing into the drab resort of Neum and cutting Croatia in two at its southern tip.
From July, tourists and truckers will have to cross the external borders of the EU to go from one part of Croatia to another, negotiating long, costly queues and strict customs checks twice within the space of 20 km.
Diggers are eating into the hillside to upgrade the border crossings, but even then many trucks, particularly those carrying foodstuffs, face being routed via ferry from the mainland to the Peljesac peninsula and on to Dubrovnik to avoid leaving EU territory.
How to bridge Neum, perhaps literally, has become the focus of an acrimonious row, stirring nationalist passions and reviving controversy over where the border actually belongs.
It is a stark illustration of the complexities and bad blood the EU will import by continuing its expansion to the countries of ex-Yugoslavia two decades after their socialist federation imploded in war.
"It's a typical Balkan bar brawl," said Kapetanic.
Under pressure from the EU to find a solution, Croatia has revived a proposal to build a 2,400-metre bridge to Peljesac at an estimated cost of 250 million euros ($315.12 million), finally linking Dubrovnik to the rest of the country without having to go through Bosnia.
Construction would take several years. But Nikola Dobroslavic, the prefect of Dubrovnik county, says it is Croatia's "historic and national obligation".
Bosnia says the bridge threatens its access to open seas and would prefer a closed road corridor in the hinterland above Neum, an option Croatia is also exploring.
If it does insist on the bridge, Bosnia says, Croatia must first formally hand over control of two uninhabited islets, Veliki (Great) Skolj and Mali (Little) Skolj and the tiny tip of the Klek peninsula, that Sarajevo claims as its own.
"You can't build anything without first knowing who owns what," Bosnian Communications and Transport Minister Damir Hadzic told Reuters.
With over 1,000 islands and 10 million tourists visiting every year, and keen to resolve the issue and clinch EU funds for the bridge, Croatia has signaled it will agree to Bosnia's demand.
But Zagreb faces resistance from Dubrovnik.
"Those two islands belonged to the Dubrovnik Republic (Ragusa)," Dobroslavic, the county prefect, told Reuters. "It didn't give them to the Ottoman Empire, that's for sure."
Croatia's foreign minister, Vesna Pusic, dismissed such arguments.
"It is an issue that can and will be resolved," Pusic told Reuters.
"I think the bridge is the better and more rational solution, on condition we get money for its construction from the EU's structural funds. Croatia does not have that kind of money in its budget."
The EU will press for progress at talks with Croatian and Bosnian leaders in Brussels this month.
It is also looking for a deal between Croatia and its northern neighbor Slovenia, currently the only ex-Yugoslav republic in the EU. Slovenia is threatening to block Croatia's accession in a row over money owed to Croatian depositors when a Slovenian bank went bankrupt during the 1991 breakup of Yugoslavia.
Meanwhile, the Bosnian town of Neum is growing anxious.
Mayor Zivko Matusko, his office adorned with Croatian flags, said Neum had nothing to lose by Croatia's entry into the EU and eventually the visa-free Schengen zone.
But residents are concerned the bridge will effectively deprive the town of vital through-traffic.
"It can't be in Neum's interest for people to go around it," said Ivan Kuzman, 47, owner of the Kuzman hotel and supermarket in Neum.
Ironically, most of the town's 3,500 residents are Croats, one of the three ethnic groups that fought in Bosnia's 1991-95 war.
Many Bosnian Croats look to Croatia as their true homeland, a fact reflected in the failure to upgrade the winding, one-lane road that links Neum to the Bosnian interior.
Bosnia's development is still hostage to ethnic feuding over power and the past, leaving it languishing behind Montenegro, Serbia, Macedonia and Albania in the queue to join the EU.
Sarajevo has failed even to create a state-level agriculture ministry, meaning Bosnian dairy farmers will lose their main export market in Croatia as of next year.
A short drive up the coast from Neum, inside Croatia, a crane stands idle on the banks where Croatia's previous government began building the bridge, only to abort the project as funds dried up during the global crisis.
It got no further than a couple of supporting pillars.
Without the bridge, "Dubrovnik would have the status of an island," said Kapetanic, the historian. "It's not a problem for me or you to go by car, but not chickens and eggs."
($1 = 0.7933 euros)
Additional reporting by Zoran Radosavljevic in Zagreb and Daria Sito-Sucic in Sarajevo; Editing by Sonya Hepinstall