Landmark ruling backs gay couples' right to marry