when the outer layers of a star like the sun expand, and it becomes a giant, which way does it move on the h-r diagram?