Bandgap opening in boron nitride confined armchair graphene nanoribbon