Mexico City legalises gay marriages