Repro
Opened the page at 390px width and confirmed cards overflowed horizontally.
Sample delivery
Problem: a three-card grid overflowed on phones because the layout never collapsed below 960px. Fix: add a mobile breakpoint and preserve desktop layout.
Patch
Only the grid behavior changed. Card styling and desktop spacing stayed untouched.
@@ styles.css
.cards {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 18px;
}
@media (max-width: 720px) {
.cards {
grid-template-columns: 1fr;
}
}
Opened the page at 390px width and confirmed cards overflowed horizontally.
Added a single breakpoint that stacks cards on narrow screens.
Retested at 390px and 1440px. Mobile stacks, desktop remains three columns.