/* ============================================================
   MINIMAL CSS – CROSS-BROWSER (PRODUCTION READY)
   ============================================================ */

/* ========================================
   1. ROOT VARIABLES (Design System)
   ======================================== */
:root {
    /* --- Colors: Accents --- */
    --accent-primary: #9f0404; /* Updated based on cascade */
    --accent-active: #d70909;
    --accent-hover: #ff0000;
    --accent-danger: #dc3545;
    --accent-success: #198754;
    --accent-warning: #cb5f04;
    --accent-purple: #6f42c1;
    --accent-teal: #03887c;
    --accent-yellow: #c2940b;
    --accent-info: #1e7fe8;
    
    /* --- Colors: Backgrounds --- */
    --bg-body: #ffffff;
    --bg-surface: #ffffff;
    --bg-dark: #0b0b66;
    --bg-light-gray: #f8f9fa;
    --bg-dropdown: rgba(61, 55, 54, 0.57);
    --bg-overlay: rgba(0, 0, 0, 0.75);
    
    /* --- Colors: Text --- */
    --text-main: #212529;
    --text-muted: #6c757d;
    --text-light: #ffffff;
    --text-light-dim: rgba(255, 255, 255, 0.7);
    --text-light-dimmer: rgba(255, 255, 255, 0.6);
    --text-light-subtle: rgba(255, 255, 255, 0.85);

    /* --- Colors: Links & Borders --- */
    --link-color: #1919c9;
    --link-accent: #1b78e3;
    --border-color: #e9ecef;
    --border-light: rgba(255, 255, 255, 0.05);
    --border-lighter: rgba(255, 255, 255, 0.1);
    --border-lightest: rgba(255, 255, 255, 0.2);

    /* --- Typography: Font Families --- */
    --font-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Nirmala UI", "Noto Sans Devanagari", sans-serif;
    
    /* --- Typography: Font Sizes --- */
    --text-xs: 13px;
    --text-sm: 14px;
    --text-base: 15px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 22px;
    --text-2xl: 26px;
    --text-3xl: 28px;
    --text-4xl: 32px;
    --text-hero: 42px;

    /* --- Typography: Font Weights --- */
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-black: 900;

    /* --- Spacing System (Margins & Paddings) --- */
    --space-2xs: 4px;
    --space-xss: 6px;
    --space-xs: 8px;
    --space-sm: 10px;
    --space-md: 15px;
    --space-lg: 20px;
    --space-xl: 25px;
    --space-2xl: 30px;
    --space-3xl: 40px;
    --space-4xl: 50px;

    /* --- Layout & Border Radius --- */
    --container-max: 1200px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 50px;

    /* --- Shadows --- */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-focus: 0 0 0 4px rgba(220, 53, 69, 0.1);
    
    /* --- Transitions & Z-Index --- */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --z-nav: 1000;
    --z-popup: 9999;
}


/* ========================================
   2. RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    font-family: var(--font-base);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-body);
}

a { 
    color: var(--link-color); 
    text-decoration: none; 
    -webkit-transition: color var(--transition-base);
    transition: color var(--transition-base);
}

a:hover { 
    color: var(--accent-hover); 
}

img { 
    max-width: 100%; 
    height: auto; 
}


/* ========================================
   3. LAYOUT & COMPONENTS
   ======================================== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
    width: 100%;
}

.btn { 
    display: inline-block; 
    padding: var(--space-lg) var(--space-2xl); 
    border-radius: var(--radius-pill); 
    font-weight: var(--weight-semibold); 
    border: none; 
    cursor: pointer; 
    -webkit-transition: background var(--transition-fast); 
    transition: background var(--transition-fast); 
}

.btn-primary { 
    background: var(--accent-primary); 
    color: var(--text-light); 
}

.btn-primary:hover { 
    background: var(--accent-hover); 
}

.btn-secondary { 
    background: var(--border-lighter); 
    color: var(--text-light); 
    border: 2px solid var(--border-lightest); 
}

.btn-secondary:hover { 
    background: var(--border-lightest); 
}

.btn-view-more {
    color: var(--text-light);
    background: var(--link-accent);
    padding: 2px var(--space-xs);
    border-radius: var(--radius-pill);
    display: flex;
    gap: var(--space-2xs);
    align-items: center;
}

.btn-view-more:hover {
    background: var(--link-color);
}


/* ========================================
   4. ICONS
   ======================================== */
.svg-icon {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    vertical-align: middle;
}

.nav-icon { width: var(--text-md); height: var(--text-md); margin-right: 6px; display: inline-block; vertical-align: middle; }
.icon-sm { width: var(--text-sm); height: var(--text-sm); display: inline-block; vertical-align: middle; }
.nav-icon svg, .icon-sm svg { stroke: currentColor; fill: none; }
.menu-icon, .close-icon { width: 24px; height: 24px; display: inline-block; }
.menu-icon svg, .close-icon svg { stroke: currentColor; fill: none; }

.close-icon { display: none; }
.mobile-toggle.active .menu-icon { display: none; }
.mobile-toggle.active .close-icon { display: block; }


/* ========================================
   5. HEADER & NAVIGATION
   ======================================== */
header {
    background: var(--accent-active);
    padding: var(--space-md) 0;
    -webkit-box-shadow: var(--shadow-sm);
    box-shadow: var(--shadow-sm);
}

.logo { text-align: center; }

.logo h1 {
    font-size: var(--text-4xl);
    font-weight: var(--weight-bold);
    color: var(--text-light);
    margin: 0;
}

.logo .site-description {
    display: block;
    font-size: var(--text-lg);
    font-weight: var(--weight-medium);
    color: var(--text-light);
}

.logo img { 
    max-height: 60px; 
    width: auto; 
}

.main-nav {
    background: var(--bg-dark);
    top: 0;
    z-index: var(--z-nav);
    -webkit-box-shadow: var(--shadow-md);
    box-shadow: var(--shadow-md);
}

.main-nav .container {
    gap: var(--space-xs);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    padding: 0 var(--space-md);
    position: relative;
}

.mobile-toggle {
    display: none; 
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm) var(--space-xs);
    color: var(--text-light);
    -webkit-box-ordinal-group: 2;
    -ms-flex-order: 1;
    order: 1;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center; 
    gap: 6px; 
}

.nav-menu {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    -webkit-box-ordinal-group: 3;
    -ms-flex-order: 2;
    order: 2;
    z-index:1;
}

.nav-menu > li { position: relative; }

.nav-menu > li > a {
    display: flex;    
    align-items: center;
    padding: 9px;
    color: var(--text-light-subtle);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.3px;
    -webkit-transition: all var(--transition-base);
    transition: all var(--transition-base);
}

.nav-menu > li > a:hover {
    background: var(--accent-primary);
}

.nav-menu > li > a.active {
    color: var(--text-light);
    background: var(--border-light);
}

.search-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm) var(--space-xs);
    color: var(--text-light-dim);
    -webkit-box-ordinal-group: 4;
    -ms-flex-order: 3;
    order: 3;
    -webkit-transition: color var(--transition-fast);
    transition: color var(--transition-fast);
}

.search-toggle:hover { color: var(--text-light); }
.search-toggle svg { stroke: currentColor; fill: none; width: var(--text-xl); height: var(--text-xl); }

/* --- DESKTOP DROPDOWN (Hover based) --- */
@media screen and (min-width: 769px) {
    .nav-menu .dropdown .dropdown-toggle {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        gap: 6px;
    }
    .nav-menu .dropdown .dropdown-toggle .icon-sm {
        -webkit-transition: -webkit-transform var(--transition-base);
        transition: transform var(--transition-base);
    }
    .nav-menu .dropdown:hover .dropdown-toggle .icon-sm {
        -webkit-transform: rotate(180deg);
        transform: rotate(180deg);
    }
    .nav-menu .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 19vw;
        max-width: 200px;
        background: var(--bg-dropdown);
        border-radius: var(--radius-sm);
        -webkit-box-shadow: var(--shadow-xl);
        box-shadow: var(--shadow-xl);
        list-style: none;
        padding: var(--space-xs) 0;
        display: none;
    }
    .nav-menu .dropdown:hover .dropdown-menu { display: block; }
    .nav-menu .dropdown-menu li a {
        display: block;
        padding: var(--space-xs) var(--space-lg);
        color: var(--text-light);
        font-size: var(--text-sm);
        -webkit-transition: all var(--transition-fast);
        transition: all var(--transition-fast);
    }
    .nav-menu .dropdown-menu li a:hover {
        background: var(--accent-primary);
    }
}


/* ========================================
   6. SEARCH POPUP
   ======================================== */
.search-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: var(--z-popup);
    display: none;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.search-popup.active { display: -webkit-box; display: -ms-flexbox; display: flex; }
.search-popup-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-overlay); }

.search-popup-content {
    position: relative; 
    z-index: 1; 
    width: 90%; 
    max-width: 600px; 
    background: var(--bg-surface);
    border-radius: var(--radius-lg); 
    padding: var(--space-2xl) var(--space-xl);
    -webkit-box-shadow: var(--shadow-xl); 
    box-shadow: var(--shadow-xl);
}

.search-popup-close {
    position: absolute; top: var(--space-xs); right: var(--space-xs); background: none; border: none;
    cursor: pointer; color: var(--text-muted); padding: 5px;
    -webkit-transition: color var(--transition-fast); transition: color var(--transition-fast);
}

.search-popup-close:hover { color: var(--accent-primary); }
.search-popup-close svg { stroke: currentColor; fill: none; width: 24px; height: 24px; }

.search-input-wrapper {
    position: relative; display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    background: var(--bg-light-gray); border: 2px solid var(--border-color); border-radius: var(--radius-pill); overflow: hidden;
    -webkit-transition: border-color var(--transition-fast), -webkit-box-shadow var(--transition-fast);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    margin-top: var(--space-md);
}

.search-input-wrapper:focus-within { 
    border-color: var(--accent-primary); 
    -webkit-box-shadow: var(--shadow-focus); 
    box-shadow: var(--shadow-focus); 
}

.search-input-wrapper input {
    -webkit-box-flex: 1; -ms-flex: 1; flex: 1; padding: var(--space-sm) 60px var(--space-sm) var(--space-lg);
    border: none; outline: none; font-size: var(--text-md); background: transparent; width: 100%;
    color: var(--text-main);
}

.search-input-wrapper button {
    position: absolute; right: 5px; top: 50%; 
    -webkit-transform: translateY(-50%); transform: translateY(-50%);
    border: none; border-radius: var(--radius-pill); padding: var(--space-xs);
    cursor: pointer; display: -webkit-box; display: -ms-flexbox; display: flex; 
    -webkit-box-align: center; -ms-flex-align: center; align-items: center; 
    -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; 
    -webkit-transition: background var(--transition-fast); transition: background var(--transition-fast);
}

.search-input-wrapper button:hover { background: var(--accent-active);  color: var(--text-light);}
.search-input-wrapper button svg { stroke: currentColor; fill: none; width: var(--text-lg); height: var(--text-lg); display: block; }


/* ========================================
   7. HERO SECTION
   ======================================== */
.hero-section {
    background: var(--bg-body);
    padding: 690px 0 var(--space-4xl);
    text-align: center;
    color: var(--text-main);
}

.hero-section h1 { font-size: var(--text-hero); font-weight: var(--weight-black); }
.hero-section p { font-size: var(--text-lg); opacity: 0.8; }
.hero-text { max-width: 600px; margin: 0 auto var(--space-xl); opacity: 0.7; }

.hero-buttons { 
    display: -webkit-box; display: -ms-flexbox; display: flex; gap: var(--space-md); 
    -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; 
    -ms-flex-wrap: wrap; flex-wrap: wrap; 
}


/* ========================================
   8. IMPORTANT LINKS SECTION
   ======================================== */
.important-links-section {
    padding: var(--space-lg) 0 var(--space-lg);
    background: var(--bg-body);
}

.important-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xss);
}

.important-link-box {
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    min-height: 70px;
    display: flex;
    align-items: center;
}


.important-link-box a {
    display: block;
    padding: 5px var(--space-lg);
    text-decoration: none;
    color: var(--text-light);
    width: 100%;
    transition: all var(--transition-base);
}

.important-link-box a:hover {
    text-decoration: none;
    opacity: 0.9;
}

.important-link-box .link-title {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    line-height: 1.4;
    display: block;
    color: var(--text-light);
}


/* ========================================
   9. CATEGORIES SECTION
   ======================================== */
.categories-section {
    padding: var(--space-xs) 0;
    background: var(--bg-surface);
}

.category-grid { 
    display: -ms-grid; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2xs); 
}

.category-block {
    background: var(--bg-surface);
    overflow: hidden;
    border: 1px solid var(--accent-active);
    box-shadow: var(--shadow-sm);
}

.category-header {
    padding: var(--space-2xs);
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: center;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    color: var(--text-light);
    background: var(--bg-dark);
}

.category-header h3 { 
    font-size: var(--text-lg); font-weight: var(--weight-bold); margin: 0; 
    display: -webkit-box; display: -ms-flexbox; display: flex; 
    -webkit-box-align: center; -ms-flex-align: center; align-items: center; 
}

.category-body { padding: var(--space-xs) var(--space-sm) var(--space-md) var(--space-md); }
#searchToggle:hover {
    background: var(--accent-primary);
}
.category-footer {
    display: flex;
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    flex-direction: row;
    margin-top: var(--space-sm);
    align-items: center;
    justify-content: flex-end;
}

.post-list {
    list-style: disc;
    padding-left: var(--space-lg);
    margin: 0;
}

.post-list li { padding: var(--space-2xs) 0; }

.post-list li a {
    color: var(--link-color);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

.post-list li a:hover { 
    color: var(--accent-primary); 
    text-decoration-line: underline;
    text-decoration-color: var(--accent-primary); 
}


/* ========================================
   10. LATEST POSTS & STATS
   ======================================== */
.latest-section { padding: var(--space-4xl) 0; background: var(--bg-surface); }
.latest-grid { display: -ms-grid; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }

.latest-item { 
    background: var(--bg-light-gray); 
    border-radius: var(--radius-md); 
    padding: 18px var(--space-lg); 
    border-left: 4px solid var(--accent-primary); 
}

.latest-item h4 { font-size: var(--text-base); font-weight: var(--weight-semibold); margin: 5px 0 var(--space-xs); }
.latest-item h4 a { color: var(--bg-dark); }
.latest-item h4 a:hover { color: var(--accent-primary); }

.stats-section { padding: var(--space-3xl) 0; background: var(--accent-primary); }
.stats-grid { display: -ms-grid; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2xl); text-align: center; color: var(--text-light); }


/* ========================================
   11. FOOTER
   ======================================== */
footer { 
    background: var(--bg-dark); 
    color: var(--text-light-dim); 
    padding: var(--space-4xl) 0 var(--space-lg); 
}

.footer-widgets { 
    display: -ms-grid; display: grid; grid-template-columns: repeat(4, 1fr); 
    gap: var(--space-2xl); margin-bottom: var(--space-2xl); 
}

.footer-widgets h3 { 
    color: var(--text-light); font-size: var(--text-lg); font-weight: var(--weight-bold); 
    margin-bottom: 18px; padding-bottom: var(--space-sm); border-bottom: 3px solid var(--accent-primary); 
}

.footer-widgets ul { list-style: none; padding: 0; margin: 0; }
.footer-widgets ul li { margin-bottom: var(--space-xs); }
.footer-widgets ul li a { color: var(--text-light-dimmer); font-size: var(--text-sm); -webkit-transition: all var(--transition-fast); transition: all var(--transition-fast); }
.footer-widgets ul li a:hover { color: var(--text-light); padding-left: 5px; }


/* ========================================
   12. MEDIA QUERIES (Responsive)
   ======================================== */

/* --- TABLET / SMALL DESKTOP (Max 992px) --- */
@media screen and (max-width: 992px) {
    .important-links-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-xss);}
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-widgets { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-section h1 { font-size: var(--text-4xl); }
}

/* --- MOBILE STYLES (Max 576px) --- */
@media screen and (max-width: 576px) {
    /* Mobile Toggle */
    .mobile-toggle { 
        display: -webkit-box !important; display: -ms-flexbox !important; display: flex !important; 
    }
    .mobile-toggle .menu-label { 
        display: inline-block; font-size: var(--text-sm); font-weight: var(--weight-semibold); 
        margin-left: 4px; vertical-align: middle; 
    }
    
    /* Navigation Menu */
    .nav-menu {
        display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-dark);
        -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column;
        padding: 2px var(--space-2xl); -webkit-box-shadow: var(--shadow-lg); box-shadow: var(--shadow-lg);
        max-height: 80vh; overflow-y: auto; -webkit-box-ordinal-group: 5; -ms-flex-order: 4; order: 4; width: 100%;
    }
    .nav-menu.open { display: -webkit-box; display: -ms-flexbox; display: flex; }
    .nav-menu > li { width: 100%; }
    .nav-menu > li > a { padding: 12px var(--space-lg); border-bottom: 1px solid var(--border-light); }

    /* Mobile Dropdown */
    .nav-menu .dropdown .dropdown-menu {
        position: static; -webkit-box-shadow: none; box-shadow: none;
        background: var(--bg-dropdown); border-top: none; display: none; padding: 0;
    }
    .nav-menu .dropdown.open .dropdown-menu { display: block; overflow: hidden; }
    .nav-menu .dropdown .dropdown-menu li a {
        color: var(--text-light); padding: 9px var(--space-lg); display: block;
        font-weight: var(--weight-semibold); font-size: var(--text-sm);
    }
    .nav-menu .dropdown .dropdown-menu li:hover { background: var(--accent-primary); }
    .dropdown.open > .dropdown-toggle { background: var(--accent-active); }
    
    .nav-menu .dropdown .dropdown-toggle {
        display: -webkit-box; display: -ms-flexbox; display: flex;
        -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between;
        -webkit-box-align: center; -ms-flex-align: center; align-items: center;
        width: 100%; cursor: pointer;
    }
    .nav-menu .dropdown .dropdown-toggle .icon-sm {
        -webkit-transition: -webkit-transform var(--transition-base); transition: transform var(--transition-base);
    }
    .nav-menu .dropdown.open .dropdown-toggle .icon-sm {
        -webkit-transform: rotate(180deg); transform: rotate(180deg);
    }

    /* Header adjustments */
    .search-toggle { -webkit-box-ordinal-group: 3; -ms-flex-order: 2; order: 2; }
    .main-nav .container { -ms-flex-wrap: wrap; flex-wrap: wrap; }
    
    /* Layout Adjustments */
    .important-links-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-xss); }
    .important-link-box { min-height: 60px; }
    .important-link-box a { padding: 14px 16px; }
    .important-link-box .link-title { font-size: var(--text-xs); }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .latest-grid { grid-template-columns: 1fr; }
    .footer-widgets { grid-template-columns: 1fr; text-align: center; }
    .footer-social { -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
    .stat-number { font-size: var(--text-3xl); }
    .hero-section { padding: var(--space-3xl) 0 var(--space-2xl); }
    .hero-section h1 { font-size: var(--text-2xl); }
}

/* --- SMALL MOBILE (Max 480px) --- */
@media screen and (max-width: 480px) {
    .container { padding: 0 8px; }
    .important-links-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-xss); }
    .important-link-box { min-height: 55px; }
    .important-link-box a { padding: 12px 16px; }
    .important-link-box .link-title { font-size: var(--text-sm); }
    .hero-section h1 { font-size: var(--text-xl); }
    .btn { padding: var(--space-sm) var(--space-lg); font-size: var(--text-xs); }
}