Average distance from surface

GROMACS version: 2021.3
GROMACS modification: No

I am modelling sorption of molecules on a surface and would like to see which atoms remain close to the surface.

I calculated rdf (gmx rdf) over relevant frames. I also calculated min/max distances from surface (gmx pairdist). Is it possible to calculate the average distance from the surface, too to complement min/max results? I looked into gmx distance but that calculates average distance between com/cog of the molecules, not surfaces. Given the large dimensions of the surface (>10 nm), com/cog based results will be misleading.

Appreciate any insights and help into this.