Oh your other questions, the AVE from Barcelona to Madrid you can do from 90 days in advance to look for best rates. the same of Madrid to paris both dear cities to me althought with Airlines you can even buy before that. IN Europe i usually book for long term trips a month in advance but if you are from abroad the 90 days should do it.
As to staying well for me Madrid to heaven and a hole in the sky to look down on it everyday. so take at least a week. Then on to Paris, the movable feast should be the same as minimum. I will be next week in Paris part of my regular trips there.