Ibuprofen is considered safe in the first half of the pregnancy, significant risks start only after week 28 [1]. It's also considered safe when nursing.
[1]: https://www.embryotox.de/arzneimittel/details/ibuprofen/
[1]: https://www.embryotox.de/arzneimittel/details/ibuprofen/
Increased risks of heart attack and stroke, hypertension, kidney damage.