Local electronic structure and nanolevel hierarchical organization of bone tissue: theory and NEXAFS study