Simple, common but functional: biocompatible and luminescent rare-earth doped magnesium and calcium hydroxides from miniemulsion