Designed synthesis, structure, and 3-D topology of a supramolecular dimer and inorganic–organic cocrystal