Court legalizes same-sex marriage in New Brunswick