Template:IndexPage/styles.css: Difference between revisions

From AbhiprayaVedi
mNo edit summary
mNo edit summary
Line 1: Line 1:
/* ================ INDEX PAGE STYLES ================ */
/* ================ INDEX PAGE STYLES (OVERHAULED) ================ */


/* Hero Section Banner */
.main-hero {
.main-hero {
     background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
     background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
     color: white;
     color: white;
     padding: 70px 20px;
     padding: 60px 20px;
     text-align: center;
     text-align: center;
     border-radius: 12px;
     border-radius: 12px;
     margin-bottom: 45px;
     margin-bottom: 40px;
}
}


.main-hero h1 {
.main-hero h1 {
    font-family: 'Manjari', 'Meera', sans-serif !important;
     font-size: 2.8em;
     font-size: 2.8em;
     margin: 0 0 14px 0;
     margin: 0 0 14px 0;
Line 17: Line 19:


.main-hero p {
.main-hero p {
    font-family: 'Manjari', 'Meera', sans-serif !important;
     font-size: 1.25em;
     font-size: 1.25em;
     margin-bottom: 28px;
     margin-bottom: 28px;
Line 22: Line 25:
}
}


/* Grid Fixes - Force better distribution */
/* Modern Layout Grids - 100% Flex and Alignment Fix */
.featured-grid,
.featured-grid,
.top-stories-grid {
.top-stories-grid,
.recent-articles-grid {
     display: grid;
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
     grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
     gap: 28px;
     gap: 24px;
     margin-bottom: 50px;
     margin-bottom: 45px;
     width: 100%;
     width: 100%;
}
}


/* Card Styles */
/*  
.index-card {
* Force MediaWiki Parser output to stretch cards evenly inside the grid.
    background: white;
* This fixes the height mismatch visible in your screenshot.
    border-radius: 10px;
*/
    overflow: hidden;
.featured-grid > div,
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
.top-stories-grid > div,
    transition: all 0.25s;
.recent-articles-grid > div,
     height: 100%;
.article-card {
     display: flex;
     height: 100% !important;
     flex-direction: column;
     display: flex !important;
}
     flex-direction: column !important;
 
.index-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}
}


.index-card-image img {
/*
     width: 100%;
* Alignment Fix: This forces the metadata row (Author and Date)
     height: 210px;
* to always anchor at the absolute bottom of the card, regardless of intro length.
     object-fit: cover;
*/
.article-info {
     display: flex !important;
     flex-direction: column !important;
     flex-grow: 1 !important; /* Forces layout box to expand fully */
}
}


.index-card-text {
.article-meta-row {
     padding: 20px;
    margin-top: auto !important; /* Pushes author line to the base layout */
     flex-grow: 1;
     padding-top: 12px;
     border-top: 1px solid #edf2f7;
}
}


.index-card h3 {
/* Smooth hover effects on standard Article Cards */
    margin: 0 0 10px 0;
.article-card {
    font-size: 1.32em;
     background: #ffffff;
    line-height: 1.35;
     border: 1px solid #e2e8f0;
}
     border-radius: 10px;
 
.index-card-intro {
     color: #555;
     font-size: 0.97em;
     line-height: 1.55;
    margin-bottom: 12px;
    max-height: 4.8em;
     overflow: hidden;
     overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
}


.index-card-meta {
.article-card:hover {
     color: #666;
     transform: translateY(-4px);
     font-size: 0.92em;
     box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    margin-top: auto;
}
}


/* Responsive */
/* Responsive Overrides for Mobile Views */
@media (max-width: 768px) {
@media (max-width: 768px) {
     .featured-grid, .top-stories-grid {
     .featured-grid,  
    .top-stories-grid,
    .recent-articles-grid {
         grid-template-columns: 1fr;
         grid-template-columns: 1fr;
        gap: 16px;
    }
   
    .main-hero {
        padding: 40px 15px;
        margin-bottom: 25px;
    }
   
    .main-hero h1 {
        font-size: 2em;
     }
     }
}
}
/* Remove unwanted empty paragraphs that break grid layout */
 
.mw-parser-output .featured-grid > p:empty,
/* Strict Cleanup: Target MediaWiki's auto-generated empty paragraph tags */
.mw-parser-output .top-stories-grid > p:empty,
.mw-parser-output .featured-grid p:empty,
.mw-parser-output .featured-grid p:empty,
.mw-parser-output .top-stories-grid p:empty {
.mw-parser-output .top-stories-grid p:empty,
.mw-parser-output .recent-articles-grid p:empty,
.mw-parser-output .featured-grid br,
.mw-parser-output .top-stories-grid br {
     display: none !important;
     display: none !important;
     margin: 0 !important;
     margin: 0 !important;
     padding: 0 !important;
     padding: 0 !important;
     height: 0 !important;
     height: 0 !important;
    visibility: hidden;
}
/* Make sure cards stretch evenly */
.featured-grid .index-card,
.top-stories-grid .index-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}
}

Revision as of 20:31, 9 June 2026

/* ================ INDEX PAGE STYLES (OVERHAULED) ================ */

/* Hero Section Banner */
.main-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 40px;
}

.main-hero h1 {
    font-family: 'Manjari', 'Meera', sans-serif !important;
    font-size: 2.8em;
    margin: 0 0 14px 0;
    font-weight: 700;
}

.main-hero p {
    font-family: 'Manjari', 'Meera', sans-serif !important;
    font-size: 1.25em;
    margin-bottom: 28px;
    opacity: 0.95;
}

/* Modern Layout Grids - 100% Flex and Alignment Fix */
.featured-grid,
.top-stories-grid,
.recent-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 45px;
    width: 100%;
}

/* 
 * Force MediaWiki Parser output to stretch cards evenly inside the grid.
 * This fixes the height mismatch visible in your screenshot.
 */
.featured-grid > div,
.top-stories-grid > div,
.recent-articles-grid > div,
.article-card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 
 * Alignment Fix: This forces the metadata row (Author and Date) 
 * to always anchor at the absolute bottom of the card, regardless of intro length.
 */
.article-info {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important; /* Forces layout box to expand fully */
}

.article-meta-row {
    margin-top: auto !important; /* Pushes author line to the base layout */
    padding-top: 12px;
    border-top: 1px solid #edf2f7;
}

/* Smooth hover effects on standard Article Cards */
.article-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Responsive Overrides for Mobile Views */
@media (max-width: 768px) {
    .featured-grid, 
    .top-stories-grid,
    .recent-articles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .main-hero {
        padding: 40px 15px;
        margin-bottom: 25px;
    }
    
    .main-hero h1 {
        font-size: 2em;
    }
}

/* Strict Cleanup: Target MediaWiki's auto-generated empty paragraph tags */
.mw-parser-output .featured-grid p:empty,
.mw-parser-output .top-stories-grid p:empty,
.mw-parser-output .recent-articles-grid p:empty,
.mw-parser-output .featured-grid br,
.mw-parser-output .top-stories-grid br {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}