@@ -72,52 +72,101 @@ body, p {
72
72
display : flex;
73
73
justify-content : space-between;
74
74
align-items : center;
75
- padding : 60px ;
75
+ padding : 60px 40 px ;
76
76
gap : 40px ;
77
+ background-color : # 1f2937 ;
78
+ flex-wrap : wrap;
77
79
}
78
- .hero {
79
- flex : 1 ;
80
- max-width : 50% ;
80
+
81
+ .hero-container > div {
82
+ flex : 2 ;
83
+ max-width : 500px ;
84
+ text-align : left;
85
+ flex-basis : auto;
86
+ min-width : 280px ;
81
87
}
82
88
83
- .hero h1 {
89
+ /* Heading */
90
+ .hero {
84
91
font-size : 48px ;
85
92
font-weight : 800 ;
93
+ color : # f9faf8 ;
86
94
margin-bottom : 10px ;
87
- padding-bottom : 30px ;
88
95
}
89
96
90
- .hero p {
97
+ /* Paragraph */
98
+ .hero-p {
91
99
font-size : 18px ;
92
100
color : # e5e7eb ;
93
101
margin-bottom : 30px ;
94
102
}
95
103
96
- .hero button {
104
+ /* Button */
105
+ .hero-button {
97
106
padding : 10px 20px ;
98
107
background-color : # 3882f6 ;
99
108
color : # e5e7eb ;
100
109
font-weight : bold;
101
110
border : none;
102
111
border-radius : 5px ;
103
112
cursor : pointer;
113
+ text-decoration : none;
104
114
}
105
115
106
- .hero button : hover {
116
+ .hero- button : hover {
107
117
background-color : darkblue;
108
118
}
109
119
120
+ /* Image */
110
121
.hero-image {
111
- flex : 1 ;
122
+ flex : 1 1 350px ;
123
+ /* Default flex-basis for larger screens */
124
+ max-width : 500px ;
125
+ /* MOST IMPORTANT: Ensures the image never overflows its allocated space */
126
+ height : auto;
127
+ /* Crucial: Maintains aspect ratio */
128
+ object-fit : cover;
129
+ border-radius : 5px ;
130
+ /* object-position: center; You can try 'top', 'bottom', 'left', 'right' if central cropping is bad */
131
+ padding-right : 30px ;
112
132
}
113
133
114
- .hero-image img {
115
- width : 400px ;
116
- height : 300px ;
117
- display : flex;
118
- align-items : center;
119
- justify-content : center;
134
+ /* Responsive Layout */
135
+ @media (max-width : 768px ) {
136
+ .hero-container {
137
+ flex-direction : column;
138
+ /* Stacks items vertically on mobile */
139
+ text-align : center;
140
+ /* Centers text content */
141
+ padding : 40px 20px ;
142
+ /* Adjust padding for smaller screens */
143
+ gap : 20px ;
144
+ /* Adjust gap for smaller screens */
145
+ }
146
+
147
+ /* Adjustments for the text content block on small screens */
148
+ .hero-container > div {
149
+ flex : 1 1 auto;
150
+ /* Allow text block to take full width of container */
151
+ max-width : 100% ;
152
+ /* Ensure it doesn't try to be too wide */
153
+ min-width : unset;
154
+ /* Remove min-width to allow more flexibility if needed */
155
+ text-align : center;
156
+ }
157
+
158
+ /* Adjustments for the image on small screens */
159
+ .hero-image {
160
+ flex : 1 1 auto;
161
+ /* Allow image to take full width available for a single item */
162
+ max-width : 100% ;
163
+ /* Already set above, but good to reinforce */
164
+ max-height : 300px ;
165
+ width : 100% ;
166
+ /* Ensure it takes full available width when stacked */
167
+ }
120
168
}
169
+
121
170
/*Books Section*/
122
171
h2 {
123
172
font-size : 36px ;
@@ -398,4 +447,4 @@ footer {
398
447
.footer-text {
399
448
text-align : center;
400
449
padding-bottom : 30px ;
401
- }
450
+ }
0 commit comments