Electromagnetic scattering by a strip grating with nonplanar illumination