Same-sex couples in Costa Rica will have the right to get married by mid-2020, the nation’s constitutional court has ruled, a first for socially conservative Central America.