I've been moving away from media queries for my component libraries lately. Using @container instead of @media makes it so much easier to drop a card into a narrow sidebar without the layout breaking. It doesn't care about the whole viewport, just how much room its parent actually gives it. I usually set the container type to inline-size on the wrapper.
.card-wrapper {container-type: inline-size;}It makes
reusable components actually work the way they should in a complex grid. If you stick to media queries, you end up writing a dozen different classes for every single placement scenario.