Curved-space topological phases in photonic lattices