@@ -7,6 +7,10 @@ export const CardWrapper = styled.div`
7
7
background-Color:${ props => props . theme . grey212121ToWhite } ;
8
8
box-shadow: 0px 2px 6px 0px ${ props => props . theme . green00D3A9ToBlackTwo } ;
9
9
transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
10
+ /* Fix: Ensure the card doesn't overflow its container */
11
+ overflow: hidden;
12
+ display: flex;
13
+ flex-direction: column;
10
14
11
15
&:hover{
12
16
box-shadow: 0px 2px 15px 4px ${ props => props . theme . whiteNineToBlackOne } ;
@@ -40,6 +44,8 @@ export const CardWrapper = styled.div`
40
44
height: 11.5rem;
41
45
border-top-right-radius: 0.5rem;
42
46
border-top-left-radius: 0.5rem;
47
+ /* Fix: Prevent shrinking on mobile */
48
+ flex-shrink: 0;
43
49
44
50
.gatsby-image-wrapper, .old-gatsby-image-wrapper{
45
51
height:100%;
@@ -52,6 +58,9 @@ export const CardWrapper = styled.div`
52
58
display: block;
53
59
text-align: center;
54
60
margin: auto;
61
+ /* Fix: Ensure images don't overflow */
62
+ width: 100%;
63
+ object-fit: cover;
55
64
}
56
65
57
66
}
@@ -60,70 +69,142 @@ export const CardWrapper = styled.div`
60
69
.post-content-block{
61
70
padding: 1rem 2rem;
62
71
height: 8rem;
72
+ /* Fix: Allow content to grow and add proper overflow handling */
73
+ flex: 1;
74
+ display: flex;
75
+ flex-direction: column;
76
+ min-height: 8rem;
77
+
78
+ /* Fix: Ensure padding works on all screen sizes */
79
+ @media screen and (max-width: 480px) {
80
+ padding: 1rem 1rem;
81
+ min-height: 9rem;
82
+ }
83
+
84
+ @media screen and (max-width: 320px) {
85
+ padding: 0.75rem;
86
+ min-height: 10rem;
87
+ }
63
88
}
64
89
65
90
@media screen and (max-width: 1200px) and (min-width: 992px){
66
91
.post-thumb-block{
67
92
height: 12rem;
68
-
69
93
}
70
94
71
95
.post-content-block{
72
- height: 10rem;
96
+ min- height: 10rem;
73
97
}
74
-
75
-
76
98
}
77
99
78
-
79
100
@media screen and (max-width: 670px) and (min-width: 560px){
80
101
.post-content-block{
81
- height: 10rem;
82
-
102
+ min-height: 10rem;
83
103
}
84
104
}
85
105
86
106
@media screen and (max-width: 350px){
87
107
.post-content-block{
88
- height: 10rem;
108
+ min- height: 10rem;
89
109
}
90
110
}
91
111
92
112
.post-title{
93
113
font-size: 1.4rem;
94
114
font-weight: 400;
95
- white-space: nowrap;
115
+ /* Fix: Replace single-line truncation with multi-line for better mobile experience */
116
+ display: -webkit-box;
117
+ -webkit-line-clamp: 2;
118
+ -webkit-box-orient: vertical;
96
119
overflow: hidden;
97
- text-overflow: ellipsis;
120
+ line-height: 1.3;
121
+ margin-bottom: 0.5rem;
122
+
123
+ /* Fix: Responsive font sizing */
124
+ @media screen and (max-width: 768px) {
125
+ font-size: 1.2rem;
126
+ -webkit-line-clamp: 3;
127
+ }
128
+
129
+ @media screen and (max-width: 480px) {
130
+ font-size: 1.1rem;
131
+ }
132
+
133
+ @media screen and (max-width: 320px) {
134
+ font-size: 1rem;
135
+ }
98
136
}
99
137
100
138
.post-meta-block{
101
139
height: auto;
102
140
display: flex;
103
- margin-buttom: 0.5rem;
141
+ margin-bottom: 0.5rem;
142
+ /* Fix: Better responsive behavior for meta information */
143
+ flex-wrap: wrap;
144
+ gap: 0.5rem;
104
145
146
+ /* Fix: Stack on very small screens */
147
+ @media screen and (max-width: 400px) {
148
+ flex-direction: column;
149
+ gap: 0.25rem;
150
+ }
105
151
106
152
.author{
107
153
text-align: end;
154
+ /* Fix: Don't force text-align on small screens */
155
+ @media screen and (max-width: 400px) {
156
+ text-align: left;
157
+ }
108
158
}
109
159
.author, p{
110
160
color: ${ props => props . theme . whiteSixToBlackSix } ;
111
161
font-size: 0.9rem;
112
162
font-weight: 400;
113
163
flex: auto;
114
164
transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
165
+ /* Fix: Prevent text overflow */
166
+ word-break: break-word;
167
+
168
+ @media screen and (max-width: 480px) {
169
+ font-size: 0.85rem;
170
+ }
171
+
172
+ @media screen and (max-width: 320px) {
173
+ font-size: 0.8rem;
174
+ }
115
175
}
116
176
.type{
117
177
text-align: end;
118
178
font-size: 1rem;
119
179
font-weight: 400;
180
+ /* Fix: Responsive type sizing */
181
+ @media screen and (max-width: 480px) {
182
+ font-size: 0.9rem;
183
+ }
184
+
185
+ @media screen and (max-width: 400px) {
186
+ text-align: left;
187
+ }
188
+
189
+ @media screen and (max-width: 320px) {
190
+ font-size: 0.85rem;
191
+ }
120
192
}
121
193
}
122
194
123
195
.readmore-btn-wrapper{
124
- display:flex;
196
+ display: flex;
125
197
justify-content: flex-start;
198
+ /* Fix: Add margin-top auto to push buttons to bottom */
199
+ margin-top: auto;
200
+ /* Fix: Better responsive spacing */
201
+ gap: 0.5rem;
202
+ align-items: center;
126
203
204
+ /* Fix: Stack buttons on very small screens if needed */
205
+ @media screen and (max-width: 320px) {
206
+ flex-wrap: wrap;
207
+ }
127
208
}
128
209
129
210
.readmore-btn::after{
@@ -135,26 +216,54 @@ export const CardWrapper = styled.div`
135
216
right: 0;
136
217
bottom: 0;
137
218
}
219
+
138
220
.readmore-btn, .external-link-btn{
139
221
color: ${ props => props . theme . whiteFourToBlackFour } ;
140
222
display: flex;
141
223
flex: auto;
142
224
align-items: center;
143
225
transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
226
+ /* Fix: Prevent text overflow in buttons */
227
+ white-space: nowrap;
228
+ min-width: 0; /* Allow flexbox to shrink */
144
229
230
+ /* Fix: Better touch targets on mobile */
231
+ @media screen and (max-width: 768px) {
232
+ min-height: 44px;
233
+ padding: 0.5rem;
234
+ }
145
235
146
236
svg{
147
237
font-size: 1.5rem;
148
238
transition: all 0.3s;
239
+ /* Fix: Prevent icon from shrinking */
240
+ flex-shrink: 0;
241
+
242
+ @media screen and (max-width: 480px) {
243
+ font-size: 1.3rem;
244
+ }
149
245
}
150
246
}
151
247
152
248
.external-link-btn{
153
249
justify-content: flex-end;
250
+ /* Fix: Limit width so it doesn't take too much space */
251
+ flex: 0 0 auto;
252
+ max-width: 60px;
253
+
154
254
svg{
155
255
font-size: 2rem;
156
256
padding: 0.25rem;
157
257
position: relative;
258
+
259
+ @media screen and (max-width: 480px) {
260
+ font-size: 1.8rem;
261
+ padding: 0.2rem;
262
+ }
263
+
264
+ @media screen and (max-width: 320px) {
265
+ font-size: 1.6rem;
266
+ }
158
267
}
159
268
160
269
&:hover{
@@ -164,4 +273,27 @@ export const CardWrapper = styled.div`
164
273
}
165
274
}
166
275
}
167
- ` ;
276
+
277
+ /* Fix: Additional mobile-specific improvements */
278
+ @media screen and (max-width: 768px) {
279
+ .post-block {
280
+ margin-bottom: 1.5rem;
281
+ }
282
+ }
283
+
284
+ @media screen and (max-width: 480px) {
285
+ .post-block {
286
+ margin-bottom: 1rem;
287
+ }
288
+
289
+ .post-thumb-block {
290
+ height: 10rem;
291
+ }
292
+ }
293
+
294
+ @media screen and (max-width: 320px) {
295
+ .post-thumb-block {
296
+ height: 9rem;
297
+ }
298
+ }
299
+ ` ;
0 commit comments