Ab initio and crystal structure analysis of like-charged ion pairs