Intermolecular bonding of hemin in solution and in solid state probed by N K-edge X-ray spectroscopies