Totally geodesic fibrations