I am currently trying to understand the difference between は and が in Japanese. As far as I have learnt, が and は can both be used after subjects, but は can shed a spotlight on the topic of the conversation. For practice, I constructed a few sentences of my own.
'ジョンくんはあまい食べ物が大好きです。一番好きなあまい食べ物がりんごです。'
In the second sentence, I still intend for the topic to be John, so I used が after 食べ物. However, I am unsure about whether this is correct because usually when I see sentences in this format, は is used instead of が.
Is my example correct or is there any language nuances that I have overlooked? Any help is deeply appreciated.