You have a lot to see and do. Do you prefer mountains or coast? Spain is bigger than most people think and lots of it (most) is mountain or semi-arid land. Madrid will keep you busy in caches for weeks on end and it is at altitude (highest capital city in Europe) so you have all kinds of terrain to work with.
Cheers, Rex.