Modeling of magneto-optical properties of lamellar nanogratings