Source (German) here: https://blog.kulturbanause.de/2018/07/css-grid-auto-fill-responsive-layouts-ohne-media-queries/

.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}