Template:IndexPage/styles.css: Difference between revisions
From AbhiprayaVedi
No edit summary |
No edit summary |
||
| Line 38: | Line 38: | ||
font-size: 0.95em; | font-size: 0.95em; | ||
color: #7f8c8d; | color: #7f8c8d; | ||
margin: | margin-top: auto; /* Push author to bottom if intro is short */ | ||
} | } | ||
| Line 46: | Line 46: | ||
grid-template-columns: 1fr 1fr; | grid-template-columns: 1fr 1fr; | ||
gap: 25px; | gap: 25px; | ||
align-items: stretch; /* Force both cards to equal height */ | |||
} | } | ||
| Line 53: | Line 54: | ||
overflow: hidden; | overflow: hidden; | ||
box-shadow: 0 4px 12px rgba(0,0,0,0.08); | box-shadow: 0 4px 12px rgba(0,0,0,0.08); | ||
display: flex; | |||
flex-direction: column; | |||
height: 100%; /* Fill the grid cell */ | |||
} | } | ||
| Line 61: | Line 64: | ||
.featured-image { | .featured-image { | ||
width: 100%; | |||
aspect-ratio: 16 / 9; /* uniform 16:9 box */ | |||
overflow: hidden; | overflow: hidden; | ||
} | } | ||
| Line 73: | Line 77: | ||
.featured-text { | .featured-text { | ||
padding: 20px; | padding: 20px; | ||
flex: 1; /* Take remaining vertical space */ | |||
display: flex; | |||
flex-direction: column; | |||
} | } | ||
| Line 95: | Line 102: | ||
color: #555; | color: #555; | ||
line-height: 1.6; | line-height: 1.6; | ||
margin-bottom: 10px; | |||
/* Let the intro be its natural height. | |||
The equal‑height grid will keep both cards aligned. */ | |||
} | } | ||
Revision as of 12:31, 2 May 2026
/* ===== Global ===== */
.index-container {
max-width: 1200px;
margin: 0 auto;
font-family: 'Noto Sans', 'Noto Sans Malayalam', sans-serif;
padding: 10px 15px 20px; /* top 10px, sides 15px, bottom 20px */
}
.section-title {
font-size: 1.8em;
margin: 20px 0 20px;
padding-bottom: 8px;
border-bottom: 3px solid #3498db;
color: #2c3e50;
}
/* Reset h3 margins in cards */
.index-card-text h3 {
margin: 0 0 8px;
font-size: 1.3em; /* slightly smaller overall */
line-height: 1.3;
}
/* Specific overrides for featured (larger cards) */
.featured-card .index-card-text h3 {
font-size: 1.5em;
}
/* Intro text */
.index-card-intro {
color: #555;
line-height: 1.6;
margin-bottom: 10px;
}
/* Author name */
.index-card-author {
font-size: 0.95em;
color: #7f8c8d;
margin-top: auto; /* Push author to bottom if intro is short */
}
/* ===== Featured Section ===== */
.featured-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 25px;
align-items: stretch; /* Force both cards to equal height */
}
.featured-card {
background: #fff;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
display: flex;
flex-direction: column;
height: 100%; /* Fill the grid cell */
}
.featured-card:hover {
transform: translateY(-3px);
}
.featured-image {
width: 100%;
aspect-ratio: 16 / 9; /* uniform 16:9 box */
overflow: hidden;
}
.featured-image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.featured-text {
padding: 20px;
flex: 1; /* Take remaining vertical space */
display: flex;
flex-direction: column;
}
.featured-text h3 {
margin: 0 0 8px;
font-size: 1.5em;
line-height: 1.3;
}
.featured-text h3 a {
color: #2c3e50;
text-decoration: none;
}
/*.featured-meta {
font-size: 0.9em;
color: #7f8c8d;
margin-bottom: 10px;
}*/
.featured-intro {
color: #555;
line-height: 1.6;
margin-bottom: 10px;
/* Let the intro be its natural height.
The equal‑height grid will keep both cards aligned. */
}
/* ===== Top Stories ===== */
.top-stories-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 25px;
}
.story-card {
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 3px 10px rgba(0,0,0,0.06);
transition: transform 0.2s;
}
.story-card:hover {
transform: translateY(-2px);
}
.story-image img {
width: 100%;
height: 180px;
object-fit: cover;
}
.story-card h4 {
margin: 15px 15px 5px;
font-size: 1.2em;
}
.story-card h4 a {
color: #2c3e50;
text-decoration: none;
}
.story-meta {
margin: 0 15px 15px;
font-size: 0.85em;
color: #7f8c8d;
}
.lang-badge {
display: inline-block;
background: #3498db;
color: #fff;
padding: 2px 6px;
border-radius: 4px;
font-size: 0.8em;
text-transform: uppercase;
}
/* ===== Recent Articles ===== */
.recent-list {
list-style: none;
padding: 0;
margin: 0;
}
.recent-item {
padding: 12px 0;
border-bottom: 1px solid #eee;
display: flex;
justify-content: space-between;
align-items: baseline;
flex-wrap: wrap;
}
.recent-title {
font-weight: bold;
}
.recent-title a {
color: #2c3e50;
text-decoration: none;
}
.recent-meta {
font-size: 0.85em;
color: #7f8c8d;
}
/* ===== Category Directory ===== */
.category-grid {
columns: 3;
column-gap: 30px;
margin-top: 15px;
}
.category-grid ul {
list-style: none;
padding: 0;
margin: 0;
}
.category-grid li {
break-inside: avoid;
margin-bottom: 8px;
}
.category-grid a {
text-decoration: none;
color: #2980b9;
}
/* ===== Responsive ===== */
@media (max-width: 768px) {
.featured-grid {
grid-template-columns: 1fr;
}
.top-stories-grid {
grid-template-columns: 1fr;
}
.category-grid {
columns: 2;
}
}