/*
 Theme Name:     ATI Editorial Theme
 Theme URI:      https://affairstodayindia.com
 Description:    Child theme to unify the custom header, footer, and premium digital journalism layout across all news categories.
 Author:         AffairsTodayIndia.com
 Template:       generatepress
 Version:        1.0.0
*/

:root {
    /* Synced perfectly with Affairs Today India News UI */
    --brand: #2563eb;        
    --brand-dark: #1e3a8a;  
    --accent: #f59e0b;      
    --dark: #0f172a; 
    --text: #334155; 
    --bg: #f8fafc; 
    --border: #e2e8f0;
}

/* ================= HEADER STYLES ================= */
.er-site-header { position: sticky; top: 0; z-index: 1000; background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); font-family: 'Plus Jakarta Sans', -apple-system, sans-serif; }
.er-header-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 75px; display: flex; justify-content: space-between; align-items: center; }
.er-logo { display: flex; align-items: center; gap: 8px; font-size: 1.5rem; font-weight: 800; color: var(--dark); transition: transform 0.2s; text-decoration: none; }
.er-logo:hover { transform: scale(1.02); }
.er-nav-links { display: flex; gap: 20px; }
.er-nav-links a { font-weight: 600; color: #475569; font-size: 0.95rem; padding: 8px 16px; border-radius: 6px; transition: 0.2s; text-decoration: none; }
.er-nav-links a:hover { background: #eff6ff; color: var(--brand); }

/* ================= MENU & DROPDOWN STYLES ================= */
.er-hamburger { display: none; background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--dark); padding: 0; margin-left: 10px; }
.er-nav-list { list-style: none; padding: 0; margin: 0; display: flex; gap: 15px; align-items: center; }
.er-nav-list li { position: relative; }
.er-nav-list > li > a { font-weight: 700 !important; color: #334155 !important; font-size: 0.95rem !important; padding: 10px 8px !important; transition: all 0.2s ease !important; display: block !important; white-space: nowrap !important; background-color: transparent !important; }
.er-nav-list > li:hover > a { color: var(--brand) !important; }

/* Submenu Dropdown Container */
.er-nav-list ul.sub-menu { 
    visibility: hidden; opacity: 0; transform: translateY(15px) scale(0.98); 
    pointer-events: none; position: absolute; top: 100%; left: 0; margin-top: 10px; 
    background: #ffffff !important; 
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.05) !important; 
    border-radius: 8px; padding: 10px !important; width: 240px !important; 
    display: block !important; list-style: none; z-index: 1000; 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.er-nav-list li:hover > ul.sub-menu { visibility: visible; opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.er-nav-list ul.sub-menu li { width: 100%; display: block; margin-bottom: 2px; }
.er-nav-list ul.sub-menu a { position: relative !important; padding: 8px 12px !important; border-radius: 6px !important; font-weight: 600 !important; font-size: 0.85rem !important; line-height: 1.4 !important; color: #475569 !important; transition: all 0.2s ease !important; display: flex !important; align-items: center !important; background: transparent !important; }
.er-nav-list ul.sub-menu a:hover { background: #f8fafc !important; color: var(--brand) !important; padding-left: 18px !important; }

/* Mega Menu Support */
body .er-site-header .er-nav-list ul.sub-menu, body .er-site-header .er-nav-list li.ati-mega-menu > ul.sub-menu { display: block !important; column-count: 1 !important; width: 260px !important; padding: 10px !important; white-space: normal !important; }
body .er-site-header .er-nav-list ul.sub-menu > li, body .er-site-header .er-nav-list li.ati-mega-menu > ul.sub-menu > li { display: block !important; width: 100% !important; margin-bottom: 4px !important; }
body .er-site-header .er-nav-list li:hover > ul.sub-menu { pointer-events: auto !important; z-index: 99999 !important; }
body .er-site-header .er-nav-list ul.sub-menu::before { content: ''; position: absolute; top: -25px !important; left: 0; width: 100%; height: 30px !important; background: transparent; }

/* Hide Default Featured Image */
body.single .featured-image, body.single .page-header-image-single { display: none !important; }

/* ================= DIGITAL JOURNALISM POST TYPOGRAPHY ================= */
body.single h1.entry-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; color: var(--dark); line-height: 1.2; margin-bottom: 15px; letter-spacing: -0.02em; text-align: left; margin-top: 20px; font-family: 'Plus Jakarta Sans', sans-serif;}
body.single .entry-meta { font-size: 0.95rem; color: #64748b; margin-bottom: 40px; padding-bottom: 20px; border-bottom: 1px solid var(--border); text-align: left; }
body.single .entry-content h2, .ati-heading-2 { font-size: 1.8rem; font-weight: 800; color: var(--dark); margin-top: 50px; margin-bottom: 25px; padding-bottom: 12px; border-bottom: 2px solid var(--border); position: relative; text-align: left; font-family: 'Plus Jakarta Sans', sans-serif;}
body.single .entry-content h3, .ati-heading-3 { font-size: 1.4rem; font-weight: 700; color: var(--brand-dark); margin-top: 40px; margin-bottom: 20px; text-align: left; font-family: 'Plus Jakarta Sans', sans-serif;}
body.single .entry-content p, body.single .entry-content li { font-size: 1.1rem; line-height: 1.8; color: var(--text); margin-bottom: 20px; }
body.single .site-main, body.single .inside-article { max-width: 850px !important; margin: 0 auto !important; }
body.single .entry-content img { max-width: 100%; height: auto; display: block; margin: 30px auto; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }

/* ================= BACK TO TOP BUTTON ================= */
.er-back-to-top { position: fixed; bottom: 30px; right: 30px; z-index: 999; width: 48px; height: 48px; background-color: var(--brand); color: white; border: none; border-radius: 50%; font-size: 20px; font-weight: bold; cursor: pointer; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3); opacity: 0; visibility: hidden; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; }
.er-back-to-top.show { opacity: 1; visibility: visible; }
.er-back-to-top:hover { background-color: var(--brand-dark); transform: translateY(-4px); box-shadow: 0 6px 14px rgba(37, 99, 235, 0.45); }

/* ================= ATI HOMEPAGE UI ================= */
body.er-standalone-ui { margin: 0; padding: 0; background: #f8fafc; font-family: 'Plus Jakarta Sans', sans-serif; color: #334155; line-height: 1.6; overflow-x: hidden; }
body.er-standalone-ui * { box-sizing: border-box; }
body.er-standalone-ui a { text-decoration: none; }

.er-hero-section { position: relative; color: white; padding: 60px 0 80px; text-align: center; }
.er-hero-grid { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; }
.er-hero-section.slim { padding: 40px 0 60px; }
.er-hero-content { padding-top: 30px; }
.er-single-title, .er-cat-title, .er-archive-title { font-size: 2.5rem; margin-bottom: 10px; line-height: 1.2; font-weight: 800; }
.er-cat-meta { font-size: 1.1rem; color: #e0e7ff; max-width: 700px; margin: 0 auto 15px; }
.er-pill { display: inline-block; padding: 6px 16px; border-radius: 50px; font-size: 0.85rem; font-weight: 700; margin-bottom: 15px; letter-spacing: 0.05em; text-transform: uppercase; }
.er-hero-text h1 { font-size: 3.2rem; font-weight: 800; margin: 0 0 15px; line-height: 1.2; letter-spacing: -0.03em; }
.er-hero-wave { position: absolute; bottom: -1px; left: 0; width: 100%; line-height: 0; }
.er-hero-wave svg { display: block; width: calc(100% + 1.3px); height: 40px; }

.er-container { max-width: 1300px; margin: 0 auto; padding: 0 20px; }
.er-main-body { padding-top: 40px; }
.er-single-main-container { padding-top: 40px; padding-bottom: 60px; }
.er-group { margin-bottom: 60px; }
.er-bg-soft { background: white; padding: 40px 30px; border-radius: 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid var(--border); }
.er-single-content { font-size: 1.1rem; line-height: 1.8; color: #334155; }
.er-section-header { text-align: center; margin-bottom: 30px; }
.er-section-header h2 { font-size: 2rem; font-weight: 800; color: var(--dark); margin: 0 0 10px; letter-spacing: -0.02em; }
.er-section-header p { font-size: 1.1rem; color: var(--text); margin: 0; }

.er-core-exams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.er-core-card { display: flex; flex-direction: row; align-items: center; text-align: left; background: white; border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: all 0.3s ease; box-shadow: 0 2px 4px -1px rgba(0,0,0,0.05); position: relative; overflow: hidden; z-index: 1; text-decoration: none !important; }
.er-core-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 10px 15px -3px rgba(37,99,235,0.1); }
.er-core-icon { font-size: 1.8rem; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; flex-shrink: 0; transition: transform 0.3s ease; margin-right: 16px; color: var(--brand); }
.er-core-card:hover .er-core-icon { transform: scale(1.1); background: #eff6ff; border-color: #bfdbfe; }
.er-core-content { flex: 1; min-width: 0; }
.er-core-content h3 { font-size: 1.1rem; font-weight: 800; color: var(--dark); margin: 0 0 6px 0; line-height: 1.2; letter-spacing: -0.01em; }
.er-core-content p { font-size: 0.9rem; color: var(--text); margin: 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.er-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.er-btn-primary { display: inline-block; background: var(--brand); color: white; padding: 14px 32px; border-radius: 8px; font-weight: 700; font-size: 1.05rem; transition: 0.3s; border: none; cursor: pointer; }
.er-btn-primary:hover { background: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3); }

/* FAQ Styles */
.er-faq-wrapper { background: white; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); overflow: hidden; }
.er-faq-item { border-bottom: 1px solid var(--border); margin: 0; }
.er-faq-item:last-child { border-bottom: none; }
.er-faq-question { padding: 18px 45px 18px 20px; font-weight: 700; cursor: pointer; position: relative; color: var(--dark); font-size: 1.05rem; list-style: none; transition: background 0.2s; outline: none; }
.er-faq-question:hover { background: #eff6ff; color: var(--brand); }
.er-faq-question::-webkit-details-marker { display: none; }
.er-faq-question::after { content: '+'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--brand); font-size: 24px; font-weight: 300; transition: transform 0.3s; }
.er-faq-item[open] .er-faq-question { background: #eff6ff; color: var(--brand-dark); border-bottom: 1px solid var(--border); }
.er-faq-item[open] .er-faq-question::after { content: '−'; transform: translateY(-50%) rotate(180deg); }
.er-faq-answer { padding: 20px; color: var(--text); line-height: 1.7; font-size: 1rem; background: white; }

.er-pagination { text-align: center; margin-top: 40px; }
.er-pagination ul { list-style: none; padding: 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.er-pagination a, .er-pagination span { padding: 12px 18px; background: white; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; color: var(--dark); transition: 0.2s; font-size: 0.95rem; }
.er-pagination a:hover { background: #eff6ff; border-color: var(--brand); color: var(--brand); }
.er-pagination .current { background: var(--brand); color: white; border-color: var(--brand); box-shadow: 0 4px 6px -1px rgba(37,99,235,0.2); }

/* ================= HERO SEARCH ================= */
.er-hero-search { display: flex; align-items: center; max-width: 700px; margin: 0 auto 25px; background: white; border-radius: 10px; padding: 6px; box-shadow: 0 15px 30px rgba(0,0,0,0.3); }
.er-search-icon { opacity: 0.5; padding-left: 15px; font-size: 1.2rem; color: var(--dark); }
.er-hero-search input { flex: 1; border: none; outline: none; padding: 12px 15px; font-size: 1.05rem; font-family: 'Plus Jakarta Sans', sans-serif; color: var(--dark); font-weight: 500; background: transparent; }
.er-hero-search button { background: var(--brand); color: white; border: none; padding: 12px 32px; border-radius: 8px; font-weight: 800; cursor: pointer; transition: all 0.2s ease; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1rem; white-space: nowrap; }
.er-hero-search button:hover { background: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.er-hero-stats { display: flex; justify-content: center; gap: 25px; flex-wrap: wrap; font-size: 0.95rem; font-weight: 600; color: #cbd5e1; }

/* ================= FOOTER DESKTOP GRID ================= */
.er-site-footer { background: #0f172a; color: #cbd5e1; padding: 60px 0 20px; margin-top: 60px; border-top: 4px solid var(--brand); font-family: 'Plus Jakarta Sans', sans-serif; }
.er-footer-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.er-footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 60px; text-align: left; }
.er-footer-brand h3 { color: white; font-size: 1.8rem; margin: 0 0 15px; font-weight: 800; }
.er-footer-brand p { font-size: 0.95rem; line-height: 1.6; margin: 0 0 20px; color: #94a3b8; max-width: 500px; }
.er-social-icons { display: flex; gap: 15px; margin-top: 15px; }
.er-social-icons a { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: 6px; color: white; font-size: 0.9rem; font-weight: bold; transition: 0.2s; text-decoration: none; }
.er-social-icons a.telegram { background: #24A1DE; }
.er-social-icons a.telegram:hover { background: #1d8abf; transform: translateY(-2px); }
.er-social-icons a.youtube { background: #ef4444; }
.er-social-icons a.youtube:hover { background: #dc2626; transform: translateY(-2px); }
.er-footer-links-col h4 { color: white; margin-bottom: 20px; font-size: 1.2rem; font-weight: 700; margin-top: 0;}
.er-footer-links-col nav { display: flex; flex-direction: column; gap: 12px; }
.er-footer-links-col a { display: block; color: #94a3b8; transition: 0.2s; text-decoration: none; font-size: 0.95rem; }
.er-footer-links-col a:hover { color: white; padding-left: 5px; }
.er-footer-bottom { text-align: center; border-top: 1px solid #1e293b; padding-top: 25px; margin-top: 50px; font-size: 0.85rem; color: #64748b; }

/* ================= FLOATING SOCIAL DOCK ================= */
.er-social-dock { position: fixed !important; left: 30px !important; bottom: 30px !important; z-index: 999999 !important; display: flex !important; flex-direction: column !important; gap: 12px !important; opacity: 0 !important; visibility: hidden !important; transform: translateX(-40px) !important; pointer-events: none !important; transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important; }
.er-social-dock.show-dock { opacity: 1 !important; visibility: visible !important; transform: translateX(0) !important; pointer-events: auto !important; }
.er-social-dock a { width: 48px !important; height: 48px !important; border-radius: 50% !important; display: flex !important; align-items: center !important; justify-content: center !important; color: white !important; box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; text-decoration: none !important; }
.er-social-dock a:hover { transform: translateY(-4px) scale(1.05) !important; box-shadow: 0 6px 14px rgba(0,0,0,0.25) !important; }
.er-social-dock svg { width: 26px !important; height: 26px !important; fill: #ffffff !important; display: block !important; }

/* ==========================================================================
   UNIFIED & OPTIMIZED MOBILE ENGINE (ALL PREVIOUS FIXES MERGED)
   ========================================================================== */

/* 1. TABLET BREAKPOINT */
@media screen and (max-width: 1024px) {
    .er-header-container, .er-container, .er-footer-container { max-width: 100% !important; padding-left: 20px !important; padding-right: 20px !important; }
    .er-card-grid, .er-core-exams-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 20px !important; }
}

/* 2. CORE SMARTPHONE BREAKPOINT */
@media screen and (max-width: 768px) {
    
    /* Global Overrides */
    html, body { max-width: 100vw !important; overflow-x: hidden !important; box-sizing: border-box !important; -webkit-text-size-adjust: 100%; }
    *, *:before, *:after { box-sizing: inherit !important; }

    /* Fluid Typography */
    h1, .er-single-title, .er-hero-text h1 { font-size: 1.8rem !important; line-height: 1.3 !important; margin-bottom: 15px !important; letter-spacing: -0.02em !important; }
    h2 { font-size: 1.4rem !important; line-height: 1.3 !important; }
    h3, .er-row-title { font-size: 1.15rem !important; }
    h4 { font-size: 1.05rem !important; }
    p, li { font-size: 1rem !important; line-height: 1.65 !important; }

    /* Header & Hamburger */
    .er-site-header { padding: 10px 0 !important; }
    .er-site-header .er-header-container { display: flex !important; flex-wrap: wrap !important; padding: 12px 15px !important; align-items: center !important; }
    .er-logo { flex: 1 !important; display: flex !important; align-items: center !important; gap: 8px !important; }
    .er-logo-text { font-size: 1.15rem !important; }
    .er-logo-icon { width: 24px !important; height: 24px !important; }
    
    .er-hamburger { display: flex !important; align-items: center; justify-content: center; width: 44px; height: 44px; font-size: 24px !important; color: #0f172a !important; background: transparent !important; border: none !important; cursor: pointer; order: 2 !important; margin-left: auto !important; }
    
    /* Navigation Dropdown */
    .er-nav-links { display: none !important; width: 100% !important; order: 3 !important; margin-top: 15px !important; border-top: 1px solid #e2e8f0 !important; padding-top: 15px !important; }
    .er-nav-links.active { display: block !important; }
    .er-nav-list { display: flex !important; flex-direction: column !important; gap: 10px !important; }
    .er-nav-list a { display: block !important; background: #f8fafc !important; padding: 12px 16px !important; border-radius: 8px !important; text-align: left !important; min-height: 44px; font-size: 0.95rem !important; border: 1px solid #e2e8f0 !important;}
    
    /* Submenus on Mobile */
    .er-nav-list ul.sub-menu { position: static; visibility: visible; opacity: 1; pointer-events: auto; transform: none; display: none !important; box-shadow: none !important; border: none !important; padding: 5px 0 5px 15px !important; border-left: 2px solid var(--brand) !important; border-radius: 0; margin-top: 5px; width: 100% !important; background: transparent !important;}
    .er-nav-list li:hover > ul.sub-menu { display: block !important; } 
    .er-nav-list ul.sub-menu a { background: transparent !important; border: none !important; }

    /* Hero & Search */
    .er-hero-section { padding: 30px 15px 40px !important; }
    .er-hero-text .er-pill { font-size: 0.75rem !important; padding: 5px 10px !important; margin-bottom: 12px !important; }
    .er-hero-search { display: flex !important; flex-direction: column !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; gap: 10px !important; }
    .er-search-icon { display: none !important; }
    .er-hero-search input { width: 100% !important; padding: 14px 16px !important; border-radius: 8px !important; border: 1px solid #cbd5e1 !important; font-size: 16px !important; background: #fff !important; }
    .er-hero-search button { width: 100% !important; padding: 14px !important; border-radius: 8px !important; min-height: 48px !important; font-size: 1rem !important;}
    .er-hero-stats { display: flex !important; flex-direction: column !important; gap: 10px !important; text-align: center !important; margin-top: 15px !important;}
    .er-hero-wave svg { width: 100vw !important; display: block !important; }

    /* Force Grid Stacking */
    .er-core-exams-grid, .er-card-grid, .er-footer-grid { display: flex !important; flex-direction: column !important; gap: 20px !important; }
    .er-row { width: 100% !important; border-radius: 10px !important; }
    .er-core-card { padding: 14px 16px !important; border-radius: 10px !important; }

    /* Single Posts & Blocks */
    .er-bg-soft { padding: 20px 15px 25px 15px !important; border-radius: 12px !important; }
    .er-single-hero { padding: 25px 0 20px !important; }
    .er-single-main-container { padding-left: 16px !important; padding-right: 16px !important; margin-top: 20px !important; }
    .er-single-content blockquote { margin: 20px 0 !important; padding: 14px 18px !important; border-left: 4px solid var(--brand) !important; background: #f8fafc !important; font-size: 0.98rem !important; }
    .er-seo-block { padding: 25px 18px !important; border-radius: 10px !important; }

    /* Floating UI */
    .er-social-dock, #ati-social-dock { left: 15px !important; bottom: 20px !important; gap: 8px !important; }
    .er-social-dock a, #ati-social-dock a { width: 40px !important; height: 40px !important; }
    .er-social-dock svg { width: 22px !important; height: 22px !important; }
    .er-back-to-top, #er-scroll-top { bottom: 20px !important; right: 15px !important; width: 42px !important; height: 42px !important; font-size: 18px !important; }

    /* Responsive Data Tables */
    .ati-responsive-html-table, table { display: block !important; width: 100% !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; border-collapse: collapse !important; margin: 20px 0 !important; }
    .ati-responsive-html-table th, .ati-responsive-html-table td, table th, table td { padding: 10px 12px !important; font-size: 0.85rem !important; white-space: nowrap !important; }

    /* Contact Forms */
    .modern-contact-form { padding: 20px 16px !important; margin: 25px 0 !important; border-radius: 10px !important; }
    .form-control, input, select, textarea { font-size: 16px !important; padding: 12px 14px !important; }
    .btn-submit { padding: 14px !important; font-size: 1rem !important; }

    /* Footer Alignment */
    .er-site-footer { padding: 40px 15px 20px !important; margin-top: 40px !important;}
    .er-footer-brand h3, .er-footer-brand p { text-align: center !important; margin-left: auto !important; margin-right: auto !important; }
    .er-social-hub, .er-social-icons { display: flex !important; justify-content: center !important; }
    .er-footer-links-col h4 { text-align: center !important; }
    .er-footer-links-col nav { align-items: center !important; }
    .er-footer-bottom { margin-top: 35px !important; padding-top: 20px !important; font-size: 0.78rem !important; }
}

/* 3. ULTRA-COMPACT SMARTPHONES (iPhone SE, etc.) */
@media screen and (max-width: 380px) {
    h1, .er-single-title { font-size: 1.5rem !important; }
    .er-logo-text { font-size: 1rem !important; letter-spacing: -0.02em !important; }
    .er-hero-section { padding: 25px 12px 30px !important; }
}

/* ==========================================================================
   MOBILE UI PATCH (PILL, STATS, & CARD ALIGNMENT FIXES)
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* 1. Fix the Top Pill (Force single line, shrink slightly to fit) */
    .er-hero-text .er-pill {
        font-size: 0.7rem !important;
        white-space: nowrap !important; 
        padding: 6px 12px !important;
    }

    /* 2. Fix the Hero Stats (Wrap in a centered row instead of stacking) */
    .er-hero-stats {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px 15px !important;
    }

    /* 3. Fix the News Cards Bottom Meta (Stack vertically so they don't crush) */
    .er-row-bot {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        padding: 14px 16px !important;
    }
    
    .badge-q {
        display: inline-block !important;
    }

    .er-bot-lower {
        font-size: 0.75rem !important;
        width: 100% !important;
        padding-top: 5px !important;
        border-top: 1px solid #f1f5f9 !important;
    }
}

/* Extra safety for ultra-narrow phones (like iPhone SE) */
@media screen and (max-width: 380px) {
    .er-hero-text .er-pill {
        font-size: 0.62rem !important;
        padding: 5px 8px !important;
    }
}