FYI, current versions of Pages, Numbers, and Keynote require Sonoma or later. For 27" iMacs, that means that only the ones released in 2019 and 2020 would be able to download these applications "from scratch". Apple once sold iWork on optical discs, so for a Mac running a really old version of Mac OS X, scrounging up a used original copy of iWork from some place like eBay might be an option for a new owner.
Be aware that unless that iMac can be upgraded at least as far as Catalina, a new owner may have difficulty finding much usable software for it. If that Mac is old enough that you can only upgrade it as far as High Sierra, it might be a great machine for running old 32-bit games that won't work on current Macs and versions of macOS – but it may not be the best idea to give the machine to someone who does not know exactly what they're getting into.
The current version of LibreOffice will run on Catalina, although when the first 26.* ("2026") release comes out, the requirement will change to Big Sur or later. There is a download archive of older, unsupported versions that will run on older operating systems, and a documentation/system requirements page with links to them is here.
With regards to Web browsers, Firefox is probably the best at supporting old versions of macOS. Its current version will run on Catalina and later. An older ESR version that runs on Sierra, High Sierra, and Mojave is still eligible to get "critical security updates" from Mozilla, although they may stop providing those soon. Most other major third-party browsers require Monterey or later.