1) Is this still true if the marriage contract clearly forbids it?
2) And if done so when clearly against the marriage contract is it grounds for divorce?
3) Is this the same if the person is married? Also is this the same if committed by a woman?

1- Yes if she put this as a condition in the marriage contract (that he doesn’t emotionally invest in another woman) then he is not allowed to pursue it.
2- Yes it’s the same for a married person. As for a woman, she cannot have an emotional affair with other than her husband because she is not lawful to any man besides her husband.
3- No it is not. It’s a sinful violation and he must repent. Yes, if she stipulated in the marriage contract that if he does so, then she is authorized to initiate divorce on his behalf, then she can have the divorce done even if he does not consent. Otherwise, he must issue the divorce for it to be valid.