New Mexico legalizes same-sex marriage