For discussion purposes just "WiFi" isn't doing much. I doubt typical AP<->phone 802.11ac on 5GHz can achieve >1km let alone 802.11ax/be on 6Ghz carrier, even 802.11n can only reach a few hundred meters with line-of-sight, sunny day, and no interference
Long range WiFi is a "solved" problem with 802.11ah with sub-Ghz carrier and can reach more than a km depending on bandwidth requirements
All that assuming tx power is within regulation, no enterprise grade antenna, and all with commercially available parts
I've been running a 1.1km 5Ghz 802.11ac wifi link between two highly directional antennas for three years now. They have line-of-sight, albeit just barely. The kit I got cost $100 at the time. It was quite easy to setup even and supposedly can go much further than I'm using them for.
https://www.amazon.com/dp/B083JRFQ24