Longitudinal (curvature) couplings of an N -level qudit to a superconducting resonator at the adiabatic limit and beyond