Reconstructing the evolution of gene function for a master regulator of flowering: LEAFY in the fern Ceratopteris richardii