AT 970 then A3 1777 at Madrid
Casablanca → Madrid → Lisbon
Timetable, Madrid time
18:05AT 970 from Casablanca at the gate
18:00A3 1777 to Lisbon leaves the gate
23 h 55 apart on the timetable, overnight
A3 1777 leaves 23 h 55 after AT 970 arrives on the timetable: more than half a day, so not a connection we count.