Use hidden="until-found" for collapsible content so that browser find-in-page, assistive tech, and search engines can still reach the text and auto-expand it.
CSS Containment Module Level 2 — Using content-visibility: hidden
Chrome for Developers — hidden=until-found and the beforematch event