On the role of solar and geomagnetic activity in long-term trends in the atmosphere–ionosphere system