Local structure of liquid and solid silver halides probed by XAFS