Federal courts, state officials advance same-sex marriage