Orientation of a key glutamine residue in the BLUF domain from AppA revealed by mutagenesis, spectroscopy, and quantum chemical calculations.