“So if sunlight is what primarily drives ocean temperature, it stands to reason that the sun is responsible for the long-term variations that we’re seeing.”
This is wrong.
Of course solar input is pretty damn critical in driving the temperature because otherwise we’d be at 3K equilibrium with the cosmic background radiation, and we’d have liquid helium lakes.
What matters is whether fluctuations in the solar output is responsible for the long-term variations and current unambiguous a-historical warming trend that we’ve observed.
Of course there are solar fluctuations (primarily sunspot cycle) which are observed and they do result in climate changes. But over the recent few decades of instrumental recordings the solar output has oscillated and shows no sufficiently explanatory trend, yet temperature does, and the temperature rise per year itself is increasing wtih time.
There is some signficant uncertainty in past paleoclimate solar output, and no denial of the obvious influence that the solar insolation must have on climate.
Nevertheless the existence of solar input and fluctuations does nothing to negate the known physics of the greenhouse effect.
From the ground and ocean’s point of view, both are inputs of electromagnetic radiation. If you believe in the warming power of one, you have to believe in the warming power of the other, and both have been measured experimentally. One of them has a secular trend over contemporary civilization and there is very good reason to believe it will accelerate, and the other does not, and there is no reason to believe it will do anything differently. If the Sun suddenly decides to get hotter unexpectedly this means that the risks of human greenhouse gas emissions are even greater than supposed!
There is no controversy that there is a natural greenhouse effect, because otherwise the Earth would be a frozen snowball at this radius from the Sun.
Consider that the surface temperature of Venus is hotter than that of Mercury despite the fact that it’s farther away and hence the solar flux is lower.