Mazda really gets maximum value out of the CX-5 SUV platform. There’s the CX-5 itself, then the Mazda2 which is built on a shortened version and the CX-3 SUV that’s derived from the Mazda2.
Meanwhile, down Mexico way, Toyota Yaris & Mazda2 vehicles were/are manufactured from the same platform.
The Mazda2 case is a bit odd compared to the previous version. It’s longer and wider but less roomy in the passenger area. There headroom front & rear is reduced and there’s less front legroom.
My Mazda2 is the previous version. Rear headroom is barely adequate even then. The front headroom is quite generous & I don’t use all the legroom that’s available.