- Segovia would be a nice day trip, pretty impressive with the viaduct, a nice plaza in front of the cathedral, then a pretty decent castle tour with a great view at the top of the town. Tickets can be had at the Charmartin train station, for that many people though, either go to a counter, or use the Renfe app to book. Spain requires you provide passport and other info on each passenger, so the machines take too much time, on the app, you can set each person up as a traveler, making buying tickets easy. If the app gives you problems, then maybe go to Trainline.com
Madrid and kids? If they are soccer fans, you can tour the Real Madrid stadium. The bullfighting ring has a museum, but I suppose it might be a bit gory in places, but mostly regalia and history, with a chance to walk in a bullring. There are a number of parks and gardens, some with some activities. If they are a bit adventurous, there are lots of weird things to eat, expanding their palette might be worth some time.
For Barcelona, side trips that are popular are Figueres for the Salvador Dali museum and theater, they may not be art fans, but Dali is his own type of entertainment. The other is the Montserrat Monastery. In a pretty dramatic mountainside setting, likely cooler than the city, something I think the whale family would like.
For restaurants, unless it is a high profile place, you can usually get in by going early, which for Spain is like 8 or 9 in the evening. Any place that is open earlier, you can just usually walk right in, but realize that it is a bit tougher with 6. If there is a specific place you want to go, then best to make reservations. Many places have online systems.
As for where to eat, In Madrid, I usually just do Raciones, kind of like tapas but like a shared appetizer. Lots of variety, I could go on and on about my favorite places, but go to YouTube, look up a channel called Spain Revealed, James has loads of tapas recommendations and restaurant recs for Madrid, plus a few for Barcelona. Paella might be fun in Madrid, several good places, in barcelona, they may not refer to it as paella, but still good rice dishes. Of course in Madrid, and certainly Segovia, roast suckling pig is popular.