Dominating the city skyline from its perch atop an ancient volcanic rock, Edinburgh Castle has served as a royal residen