from the BBC
Advanced learners often automatically invert the subject and auxiliary verb after a WH word clause, as if it were a question.
'It' is a third person singular pronoun, why does 'were' follows 'it'? Also, 'it' refers to a 'WH word clause' which is singular, isn't it?
I checked with Grammarly Premium and it says it's OK with 'were'.