Built Right into the Rock
In the top right you can see how part of the castle wall uses the mountain's rock as part of its foundation. The soft sandstone below the castle has been carved into caves over many centuries of use. There are literally miles of underground tunnels.