Simples really EASA now says above a layer is OK, fog is just a layer usually attached to the ground. (see above for technical discussion on distance from layer etc).
As an aside in the old days the CAA said no, VFR was in sight of surface, the rest of Europe said yes, and that is where some confusion originates.
Air law aside, flying above fog is fine until / if / when the engine fails. You will do very well to land in fog without a lot of damage (or be very lucky because it will be mostly down to luck). So you have only to decide whether the very small risk is worth it, because after all around one engine failure in every 1,000 hours is about the mark, but with a good maintenance regime you will beat those stats. considerably.