What is the ruling on attending gatherings where sometimes the men and women would see each other and might talk while being in the same area when they go to get food or any other reason?

Ustadh AbdulAziz al-Haqqan
U can go if they are segregated, if the talk is just salam and how r u this is allowed in sha'a Allah what is not allowed is laughter and joking and lack of boundaries etc