Fluid migration and coal-rank development in foreland basins