Hi Rubi57mc,
The mortgage is not relevant when it comes to capital gains tax.
You would need to work out the gain from the disposal value, minus costs.
Costs can be the market value of the property at the time of inheritance, the cost of buying the land, selling costs, improvement costs, solicitors / estate agent fees etc.
Have a look at
Capital Gains Tax: what you pay it on, rates and allowances
Thank you.