Madrid doesn't look like a capital that grew by itself. It has no coast, a small river and no medieval skyline, and it's the capital mostly because Spain's kings settled their court here in the 16th century and never left. What they built, and what later generations added, is a city of grand avenues, one of the great art districts of Europe and an unusual amount of public life: the Paseo del Prado and the Retiro park became a joint UNESCO World Heritage Site in 2021, and the best of the city still happens in its bars.
It's an easy place to like and a tiring one to rush. Lunch is at 2 pm, dinner after 9, and a night out starts when other cities are going to bed. The museums alone could fill five days, but the plan below keeps them to one heavy day: a royal Madrid day, a day in Toledo, a day of paintings, a day in Segovia and a Sunday built around El Rastro. Five days is also long enough to feel the rhythm, which is the real reason to come.
Each city day stays in one part of town and the two day trips are about 30 minutes each by fast train. Start on a Wednesday: the Reina Sofía is closed on Tuesdays, Toledo's cathedral doesn't open until the afternoon on Sundays, the Rastro market only runs on Sundays and the Debod temple is closed on Mondays, and a Wednesday start puts each of those on a day where it works. Trips alternate with city days so no day is heavy twice in a row. If you plan a longer Spain trip, Seville, Granada and Valencia are the natural next stops by train, and Spain as a whole is far more varied than the capital suggests.