Noob question bout ricers

Was having a doob with a mate n we had to pop the bonnet on his Mazda 323 vv

And the engine bay looks more or less like this vv

My question is: if the headers are at the front of the engine, how does the tailshaft hook up to the crankshaft??? Chain driven??
Whereas, on the Fords, the engine is inline with the tailshaft etc...
I have no idea how this engine setup could drive the wheels... Even if it's FWD...
Can anyone please shed light on this most likely simple engineering for a dumbass??? thanks
Chris

And the engine bay looks more or less like this vv

My question is: if the headers are at the front of the engine, how does the tailshaft hook up to the crankshaft??? Chain driven??

Whereas, on the Fords, the engine is inline with the tailshaft etc...
I have no idea how this engine setup could drive the wheels... Even if it's FWD...
Can anyone please shed light on this most likely simple engineering for a dumbass??? thanks
Chris