Obama shift on gay marriage tilts U.S. attitudes