a castle in the mountains built by the Moors