Interlayer coupling through a dimensionality-induced magnetic state