I wrote a simple static page which includes an image inside a <nav> element. It was originally designed in Bootstrap Studio, but I add a little piece of style and asset swap for certain images. Here's how it's written
<nav class="navbar navbar-light navbar-expand-md fixed-top navbar-shrink py-3" id="mainNav">
<div class="container">
<a class="navbar-brand d-flex align-items-center" href="/">
<!-- This is the problematic image -->
<img id="mainLogo" src="assets/img/logo.png">
</a>
<button data-bs-toggle="collapse" class="navbar-toggler" data-bs-target="#navcol-1"><span class="visually-hidden">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navcol-1">
<ul class="navbar-nav mx-auto">
<li class="nav-item"><a class="nav-link active" href="index.html">Home</a></li>
<li class="nav-item"></li>
<li class="nav-item"><a class="nav-link" href="pricing.html">Pricing</a></li>
<li class="nav-item"><a class="nav-link" href="contacts.html">Contact us</a></li>
<li class="nav-item"><a class="nav-link" href="features.html">Features</a></li>
</ul><a class="btn btn-primary shadow" role="button" href="/login">Log in</a>
</div>
</div>
</nav>
And here's the stylesheet
#mainLogo {
height: 40px;
}
@media screen and (min-width: 768px) {
#mainLogo {
height: 50px;
}
}
In most other browsers—mobile or desktop, simulated or real—the image works as intended. In iOS Safari, however, the image would just ignore the CSS and goes to be 100vw.

This is reported by one of the users and I don't have any Apple device. Is there any workaround?