This is an extract from Chinese Cinderella by Adeline Yen Mah.
Something in his manner caused me to hesitate. To be summoned by Second Brother out of the blue and be treated so royally was cause for suspicion.
After receiving the answers from a test paper, I found out that in this context it made the literary device of out of the blue to be a metaphor; not an idiom. I am confused as the sites that I came across either said a metaphorical idiom or simply an idiom.
Can anyone show me how metaphor is the correct literary device in the context and not idiom? And how to identify if it is a metaphor or an idiom in other contexts to prevent further mistakes?