Dynamic menu item highlighting while being on child page

Hello There,
I have a header.php with the following code:

<ul>
    <?php foreach ($site->children()->listed() as $item): ?>
        <li>
            <?= $item->title()->link() ?>
        </li>
    <?php endforeach ?>
</ul>

On the first level the nav-item of the current page is colored green with a[aria-current] {color: green}
When I am on a child page I want the nav-item of the parent element (which is still the same) to be green as well.
Thanks for your help in advance.

isOpen() is what you need here, and then add a class, see menu examples: https://getkirby.com/docs/cookbook/templating/menus#nested-menu

Yes, I have no idea why I wasn’t able to find that one. Thank you! Your Support is awesome! (You should change that URL to .com btw)

Oops, yes, was working with my local copy.