The Kasbah crowns the medina. Its walls enclosed a whole neighbourhood as well as the sultan’s palace; narrow streets still link the houses to gates overlooking the strait.