We can often obsess over sexual sins because they tend to be viewed as graver than other sins, as if it’s impossible to sin venially which leaves us feeling like we’re walking a tight rope and any false move can result in us tumbling to our deaths because there’s no net beneath us, only cement.
So there can be this temptation to say “Don’t walk the rope at all.” to avoid falling. But indeed, especially if you can’t just isolate yourself around friends you’re not sexually attracted to (which is how heterosexuals have tried to cope with the issue), indeed there is this temptation to feel morally obligated to cut yourself off from deep friendships and to live in relative social isolation.
Certainly, friendship (especially the BFF type) is going to come with some confusing feelings that can lead to sexual temptation. And the advice of just “Run away. Run away.” is not going to stop the sin as it MIGHT among heterosexuals. Afterall, social isolation can make you lonely and when you’re starving yourself, you might occasionally get fed up and gorge on junk food–or in the sexual case, gorge on one night stands and promiscuity until you finally have had it and retreat back into sexual shame and self-isolation.
My advice to you is to try to walk the rope and to recognize that indeed there is a net below you. Chastity is along an exacting work. It takes self-knowledge just as learning to walk that tight rope involves a period of falling quite frequently. So your close friendships may involve some level of unchastity not because you’re willing it but because you are learning how to be chaste. And in such cases, you need to rely on the sacraments.
And you need to recognize that there is a difference between a grave material matter and moral culpability. Full consent of the will is not binary. It’s not “I did it or I did not.” If you resisted and struggled and reasonably avoided near occasions of sin without going overboard and becoming scrupulous about it, you do NOT have full consent.
At the heart of the teaching is what St. Paul says. “Food is for the stomach. The stomach for food.” The man’s sexual pleasure naturally orients him to procreation. Thus unchastity is the pursuit of that pleasure isolated from it’s unitive and procreative purposes. Women’s pleasure is a bit more complicated because it’s not so directly tied to procreation. I wouldn’t go so far as to deny masturbation is sinful to a woman, but the Church’s theology tends to presume a male experience and there’s been a lot of presumptions about the nature of woman.
But my point is that avoiding sin is going to be not so much about finding a line to consider your limit, but rather just about balancing your need for friendship and intimacy with your sexual desires. Don’t lean too far one way to social isolation or too far the other way toward sexual temptation. You’ll fall off the wire either way. Strive for balance and try not to overcorrect. And when you do fall, recognize you are falling into the net of God’s mercy and grace. Go to confession, stay close to the sacraments and don’t fall into despair over your own salvation.