With grid, it is fine to use, but is designed for 2 dimensional layouts. As you are only laying things out in one direction - row / column, flexbox is actually simpler.
I just had a play in devtools, which I recommend you doing to understand the different options available to you:
.card {
/* display: grid; */
/* grid-template-columns: repeat(2, 500px); */
display: flex;
grid-template-columns: repeat(2, 1fr);
max-width: 60rem;
}
.image__tint {
/* opacity: 0.5; */
opacity: 0.8;
mix-blend-mode: multiply;
}
@media screen and (max-width: 800px) {
.card {
/* margin-top: 2rem; */
/* margin-bottom: 2rem; */
/* grid-template-columns: 300px; */
/* grid-template-rows: repeat(2, max-content); */
/* height: max-content; */
flex-direction: column-reverse;
max-width: 30rem;
}
.text {
/* padding: 1rem; */
padding: 2rem;
}
.card * {
/* width: 100%; */
}
.image {
/* height: 200px; */
/* grid-column: 1/2; */
/* grid-row: 1/2; */
min-height: 200px;
}
}
.main__paragraph {
/* width: 90%; */
/* line-height: 1.5rem; */ // no need for unit on line-height
line-height: 1.7;
}
.image {
/* grid-column: 2/3; */
/* grid-row: 1/2; */
/* height: 100%; */
flex: 1 1 50%;
background-position: center right;
}
.text {
/* align-self: center; */
/* grid-column: 1/2; */
/* grid-row: 1/2; */
/* padding: 4rem; */
padding: 3rem;
flex: 1 1 50%;
}
:root {
/* --font-size-bc: 15px; */
--font-size-bc: 0.9375rem;
}
main {
padding: 2rem;
}
html {
/* font-size: 15px; */
font-size: 0.9375rem;
}
Note, I changed the media query to 800px - The reason is because there is room for the layout to switch at that point. You're not forcing small desktops to use a mobile layout
@nilanshu96
Posted
@grace-snow Thanks a lot! This is really helpful. You gave a really quality feedback. It might seem less but I got to learn a lot from this.