The same applies.
I can be walking down the road and on the other side a pretty girl might be walking the other way. I might think to myself, instinctively, “ooh, I wouldn’t mind sex with her” or even simply “phwoar”. But then I’d catch myself, realise it would be totally disrespectful to continue on towards entertaining myself with that thought and I let it go. If I ‘said’ it to myself, even if I moved my lips and said it out loud to thin air, it’s the same thing.
People can ‘talk to themselves’ spontaneously in the same way that they ‘think to themselves’. Neither one is objectively sinful if you catch yourself and stop yourself… (Although, if you talk to yourself aloud you do run the risk of other people hearing you, but you’ve said you didn’t say it out loud, so that doesn’t apply here).
It’s really not that possible for a random thought that lasts only a couple of seconds and then goes away and is forgotten to affect you. You haven’t actually DONE anything.
Scruples are a terrible thing.
You cannot live your life terrified of the possibility of certain types of thoughts. To do that gives them a power over you far in excess of the influence they actually have when they happen. You must simply forget them. They come. They go. You clearly want to live according to how Our Lord wants you to. Your intentions are good, true and honourable. You do not, apparently, have the inclination or desire to deliberately sin, even if you, like the rest of us, fail from time to time. In fact I’d say you’re probably better than many in this respect. Some people aren’t so concerned. But there is a point where you become TOO concerned and you stop letting yourself live the life God gave you.
I have read nothing whatsoever from you that suggests to me you’ve actually committed any mortal sin. Nothing at all.
By all means, make an appointment with a priest and discuss it with him. It’s what he’s there for: it’s the service to the world he signed on for in order to provide. But I’m as certain as I can be that he won’t tell you any different to what I have.
You’re a good lad. Ok?