The Seventh Circuit explained: "We have often explained that district courts may not grant summary judgment on grounds not argued by the moving party, at least not without giving notice so that the non-moving party has a full opportunity to present relevant evidence and argument. E.g., Pactiv Corp. v. Rupert, 724 F.3d 999, 1001 (7th Cir. 2013); see generally Celotex Corp. v. Catrett, 477 U.S. 317, 326 (1986) (“district courts are widely acknowledged to possess the power to enter summary judgments sua sponte, so long as the losing party was on notice that she had to come forward with all of her evidence”). This general principle applies to matters of fact as well as to matters of law. Pactiv Corp., 724 F.3d at 1001, citing Fed. R. Civ. P. 56(f) (making explicit that a district court may “consider summary judgment on its own after identifying for the parties material facts that may not be genuinely in dispute” “after giving notice and a reasonable time to respond”). It is not appropriate to grant summary judgment based on facts the moving party did not rely on, at least without giving the losing party advance notice and an opportunity to be heard."
See the full opinion here.