GQ 681 then IB 834 at Athens
Sofia → Athens → Madrid
Timetable, Athens time
21:55GQ 681 from Sofia at the gate
15:50IB 834 to Madrid leaves the gate
17 h 55 apart on the timetable, overnight
IB 834 leaves 17 h 55 after GQ 681 arrives on the timetable: more than half a day, so not a connection we count.