A defendant may raise unpleaded affirmative defenses in opposition to the plaintiff’s summary judgment motion so long as the plaintiff is given adequate notice and an opportunity to respond.  See Cruey v. Gannett Co. (1998) 64 Cal.App.4th 356, 367; Wang v. Nibbelink (2016) 4 Cal.App.5th 1, 11.  The court may consider unpleaded affirmative defenses, if the complaint alleges facts supporting the defenses, and the defenses are fairly raised and met in the summary judgment papers.