If the "hiding" is for valid UX/UI purposes, and the markup can be crawled/viewed in source, it is fair game. Google is able to render JS too. The more complicated/abstract the JS though, the more difficult it will be.
Your accordion is 100% fine.
Depending on the use case, you can also reference CSS selectors within structured data (JSON-LD in <head>
and Google will pick it up. See this example on paywalled content.
Moreover, hiding stuff was mostly problematic back when Google could be manipulated easily. It's immensely smarter now. I'd argue that even if you are doing css hide stuff, for example, if it's for valid UX purposes, as long as it's not black hat in nature Google won't punish you.
Overall, they're very experienced at this point understanding the difference between a legit site using workarounds and a spammy site trying to spoof the algo.
Hope this helps!