/* ===================================================
   Killexams Blog – blog.css
   =================================================== */
:root{
  --brand:#2563eb;--brand-dark:#1d4ed8;--brand-light:#eff6ff;
  --text:#1e293b;--muted:#64748b;--border:#e2e8f0;
  --bg:#f8fafc;--white:#fff;--radius:12px;
  --shadow:0 4px 24px rgba(15,23,42,.07);
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
     background:var(--bg);color:var(--text);line-height:1.7;font-size:16px}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;height:auto;display:block}

/* ── Top bar ── */
.blog-topbar{background:#1f2937;color:#cbd5e1;font-size:13px;padding:7px 0}
.blog-topbar .inner{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px}
.blog-topbar a{color:#cbd5e1}
.blog-topbar a:hover{color:#fff;text-decoration:none}

/* ── Header / nav ── */
.blog-header{background:var(--white);border-bottom:1px solid var(--border);
             box-shadow:0 2px 8px rgba(0,0,0,.04);position:sticky;top:0;z-index:200}
.blog-header .inner{display:flex;align-items:center;justify-content:space-between;
                     padding:14px 0;gap:20px;flex-wrap:wrap}
.blog-logo{display:flex;align-items:center;gap:10px;font-weight:800;font-size:1.25em;color:var(--text)}
.blog-logo img{height:40px}
.blog-logo span{color:var(--brand)}
.blog-nav{display:flex;gap:22px;align-items:center;list-style:none;flex-wrap:wrap}
.blog-nav a{font-weight:600;font-size:.9em;color:var(--text)}
.blog-nav a:hover,.blog-nav a.active{color:var(--brand);text-decoration:none}
.blog-search-form{display:flex;gap:6px}
.blog-search-form input{padding:7px 14px;border:1px solid var(--border);border-radius:8px;
                         font-size:.9em;width:200px;background:var(--bg)}
.blog-search-form button{padding:7px 16px;background:var(--brand);color:#fff;
                           border:none;border-radius:8px;cursor:pointer;font-weight:600}

/* ── Layout ── */
.container{max-width:1240px;margin:0 auto;padding:0 20px}
.blog-layout{display:grid;grid-template-columns:1fr 340px;gap:40px;padding:40px 0}
@media(max-width:900px){.blog-layout{grid-template-columns:1fr}}

/* ── Hero (index page) ── */
.blog-hero{background:linear-gradient(135deg,#1e3a8a,#2563eb,#4f46e5);
           color:#fff;padding:60px 0;text-align:center}
.blog-hero h1{font-size:2.4em;font-weight:800;margin-bottom:12px}
.blog-hero p{font-size:1.1em;opacity:.88;max-width:580px;margin:0 auto}

/* ── Post card ── */
.post-card{background:var(--white);border:1px solid var(--border);border-radius:var(--radius);
           overflow:hidden;box-shadow:var(--shadow);transition:transform .2s,box-shadow .2s}
.post-card:hover{transform:translateY(-4px);box-shadow:0 12px 32px rgba(15,23,42,.12)}
.post-card-img{width:100%;height:200px;object-fit:cover;background:var(--bg)}
.post-card-img-placeholder{width:100%;height:200px;background:linear-gradient(135deg,#dbeafe,#ede9fe);
                             display:flex;align-items:center;justify-content:center;
                             font-size:2.5em;color:var(--brand)}
.post-card-body{padding:22px}
.post-card-meta{display:flex;gap:12px;align-items:center;font-size:.78em;
                color:var(--muted);margin-bottom:10px;flex-wrap:wrap}
.post-card-cat{background:var(--brand-light);color:var(--brand);
               padding:3px 10px;border-radius:999px;font-weight:700;font-size:.9em}
.post-card h2{font-size:1.1em;font-weight:700;margin-bottom:8px;line-height:1.4}
.post-card h2 a{color:var(--text)}
.post-card h2 a:hover{color:var(--brand);text-decoration:none}
.post-card-excerpt{color:var(--muted);font-size:.9em;margin-bottom:14px;line-height:1.6}
.read-more{display:inline-flex;align-items:center;gap:6px;font-weight:700;
           font-size:.85em;color:var(--brand)}
.read-more:hover{text-decoration:none;gap:10px}

/* ── Posts grid ── */
.posts-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:24px}

/* ── Featured post ── */
.featured-post{background:var(--white);border:1px solid var(--border);border-radius:var(--radius);
               overflow:hidden;box-shadow:var(--shadow);margin-bottom:32px;
               display:grid;grid-template-columns:1fr 1fr}
@media(max-width:700px){.featured-post{grid-template-columns:1fr}}
.featured-post-img{min-height:280px;background:linear-gradient(135deg,#1e3a8a,#4f46e5);
                   display:flex;align-items:center;justify-content:center;font-size:4em}
.featured-post-body{padding:32px}
.featured-label{background:var(--brand);color:#fff;font-size:.75em;font-weight:700;
                padding:4px 12px;border-radius:999px;display:inline-block;margin-bottom:14px}
.featured-post-body h2{font-size:1.5em;font-weight:800;margin-bottom:12px;line-height:1.3}
.featured-post-body h2 a{color:var(--text)}
.featured-post-body h2 a:hover{color:var(--brand);text-decoration:none}
.featured-post-body p{color:var(--muted);margin-bottom:20px}

/* ── Sidebar ── */
.sidebar-widget{background:var(--white);border:1px solid var(--border);border-radius:var(--radius);
                padding:24px;margin-bottom:28px;box-shadow:var(--shadow)}
.sidebar-widget h3{font-size:1em;font-weight:800;margin-bottom:16px;
                    padding-bottom:10px;border-bottom:2px solid var(--brand);color:var(--text)}
.sidebar-cats li{list-style:none;border-bottom:1px solid var(--border);padding:8px 0;
                  display:flex;justify-content:space-between;align-items:center}
.sidebar-cats li:last-child{border:none}
.sidebar-cats a{font-weight:600;font-size:.9em;color:var(--text)}
.sidebar-cats a:hover{color:var(--brand);text-decoration:none}
.sidebar-cats .cnt{background:var(--brand-light);color:var(--brand);
                    padding:2px 8px;border-radius:999px;font-size:.75em;font-weight:700}
.sidebar-recent li{list-style:none;padding:10px 0;border-bottom:1px solid var(--border)}
.sidebar-recent li:last-child{border:none}
.sidebar-recent a{font-weight:600;font-size:.88em;color:var(--text);line-height:1.4}
.sidebar-recent a:hover{color:var(--brand);text-decoration:none}
.sidebar-recent .date{font-size:.75em;color:var(--muted);margin-top:3px}
.tag-cloud{display:flex;flex-wrap:wrap;gap:8px}
.tag-cloud a{background:var(--bg);border:1px solid var(--border);border-radius:999px;
             padding:5px 13px;font-size:.8em;font-weight:600;color:var(--text)}
.tag-cloud a:hover{background:var(--brand);color:#fff;border-color:var(--brand);text-decoration:none}

/* Newsletter widget */
.newsletter-widget{background:linear-gradient(135deg,#1e3a8a,#4f46e5);
                   color:#fff;border-radius:var(--radius);padding:24px;margin-bottom:28px}
.newsletter-widget h3{font-size:1.05em;font-weight:800;margin-bottom:8px}
.newsletter-widget p{font-size:.85em;opacity:.88;margin-bottom:14px}
.newsletter-widget input{width:100%;padding:10px 14px;border:none;border-radius:8px;
                          font-size:.9em;margin-bottom:8px}
.newsletter-widget button{width:100%;padding:10px;background:#f59e0b;color:#000;
                            border:none;border-radius:8px;font-weight:700;
                            font-size:.9em;cursor:pointer}
.newsletter-widget button:hover{background:#fbbf24}

/* ── Article page ── */
.article-header{padding:40px 0 0}
.article-breadcrumb{font-size:.82em;color:var(--muted);margin-bottom:16px}
.article-breadcrumb a{color:var(--muted)}
.article-breadcrumb a:hover{color:var(--brand);text-decoration:none}
.article-cat-badge{background:var(--brand-light);color:var(--brand);
                   padding:4px 14px;border-radius:999px;font-size:.8em;
                   font-weight:700;display:inline-block;margin-bottom:14px}
.article-title{font-size:2.2em;font-weight:800;line-height:1.25;margin-bottom:16px}
@media(max-width:700px){.article-title{font-size:1.6em}}
.article-meta{display:flex;gap:18px;align-items:center;flex-wrap:wrap;
              font-size:.85em;color:var(--muted);padding-bottom:24px;
              border-bottom:1px solid var(--border);margin-bottom:28px}
.article-meta img{width:36px;height:36px;border-radius:50%;object-fit:cover}
.article-meta strong{color:var(--text)}
.article-featured-img{width:100%;max-height:440px;object-fit:cover;
                       border-radius:var(--radius);margin-bottom:32px}

/* Article body typography */
.article-body{font-size:1.05em;line-height:1.85;color:#1e293b}
.article-body h2{font-size:1.4em;font-weight:800;margin:32px 0 12px;color:var(--text)}
.article-body h3{font-size:1.15em;font-weight:700;margin:24px 0 10px}
.article-body p{margin-bottom:18px}
.article-body ul,.article-body ol{margin:0 0 18px 28px}
.article-body li{margin-bottom:6px}
.article-body strong{color:var(--text)}
.article-body a{color:var(--brand);text-decoration:underline}
.article-body blockquote{border-left:4px solid var(--brand);background:var(--brand-light);
                          padding:16px 20px;border-radius:0 8px 8px 0;margin:24px 0;
                          font-style:italic;color:var(--muted)}
.article-body table{width:100%;border-collapse:collapse;margin:20px 0;font-size:.9em}
.article-body th,.article-body td{border:1px solid var(--border);padding:10px 14px;text-align:left}
.article-body th{background:var(--brand-light);font-weight:700}

/* ── Tags ── */
.article-tags{margin:28px 0;padding:20px 0;border-top:1px solid var(--border)}
.article-tags span{font-weight:700;margin-right:8px}
.article-tags a{background:var(--bg);border:1px solid var(--border);border-radius:999px;
                padding:5px 13px;font-size:.82em;font-weight:600;margin:3px;
                display:inline-block;color:var(--text)}
.article-tags a:hover{background:var(--brand);color:#fff;border-color:var(--brand);text-decoration:none}

/* ── Share buttons ── */
.share-bar{background:var(--white);border:1px solid var(--border);border-radius:var(--radius);
           padding:20px 24px;margin:28px 0;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.share-bar span{font-weight:700;font-size:.9em}
.share-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 18px;
           border-radius:8px;font-size:.85em;font-weight:700;text-decoration:none;color:#fff}
.share-btn:hover{opacity:.88;text-decoration:none}
.share-btn.twitter{background:#1da1f2}
.share-btn.linkedin{background:#0077b5}
.share-btn.facebook{background:#1877f2}
.share-btn.whatsapp{background:#25d366}
.share-btn.copy{background:var(--muted);cursor:pointer;border:none;font-family:inherit}

/* ── Related posts ── */
.related-posts{margin:40px 0}
.related-posts h3{font-size:1.2em;font-weight:800;margin-bottom:20px;
                   padding-bottom:10px;border-bottom:2px solid var(--brand)}
.related-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:20px}

/* ── Comments ── */
.comments-section{margin:40px 0}
.comments-section h3{font-size:1.2em;font-weight:800;margin-bottom:20px;
                       padding-bottom:10px;border-bottom:2px solid var(--brand)}
.comment-item{background:var(--white);border:1px solid var(--border);border-radius:var(--radius);
              padding:20px;margin-bottom:16px}
.comment-meta{display:flex;gap:12px;align-items:center;margin-bottom:10px}
.comment-avatar{width:40px;height:40px;border-radius:50%;background:linear-gradient(135deg,#3b82f6,#8b5cf6);
                display:flex;align-items:center;justify-content:center;
                color:#fff;font-weight:700;font-size:1em;flex-shrink:0}
.comment-author{font-weight:700;font-size:.9em}
.comment-date{font-size:.78em;color:var(--muted)}
.comment-body{color:#334155;font-size:.92em;line-height:1.7}
.comment-form{background:var(--white);border:1px solid var(--border);border-radius:var(--radius);padding:24px;margin-top:28px}
.comment-form h4{font-size:1em;font-weight:800;margin-bottom:16px}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px}
@media(max-width:600px){.form-row{grid-template-columns:1fr}}
.form-field{display:flex;flex-direction:column;gap:5px;margin-bottom:14px}
.form-field label{font-size:.85em;font-weight:600;color:var(--muted)}
.form-field input,.form-field textarea{padding:10px 14px;border:1px solid var(--border);
   border-radius:8px;font-size:.9em;font-family:inherit;background:var(--bg)}
.form-field input:focus,.form-field textarea:focus{outline:none;border-color:var(--brand)}
.form-field textarea{min-height:110px;resize:vertical}
.btn{padding:11px 26px;border:none;border-radius:8px;font-weight:700;
     font-size:.9em;cursor:pointer;transition:opacity .2s;display:inline-block}
.btn:hover{opacity:.88}
.btn-primary{background:linear-gradient(135deg,var(--brand),#4f46e5);color:#fff}
.btn-sm{padding:7px 16px;font-size:.8em}
.btn-danger{background:#ef4444;color:#fff}
.btn-secondary{background:var(--muted);color:#fff}
.btn-success{background:#16a34a;color:#fff}

/* ── Pagination ── */
.pagination{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;margin:32px 0}
.pagination a,.pagination span{padding:8px 15px;border:1px solid var(--border);
                                border-radius:8px;font-weight:600;font-size:.88em;
                                background:var(--white);color:var(--text)}
.pagination a:hover{background:var(--brand);color:#fff;border-color:var(--brand);text-decoration:none}
.pagination .current{background:linear-gradient(135deg,var(--brand),#4f46e5);
                      color:#fff;border-color:transparent}

/* ── Page heading ── */
.page-heading{padding:36px 0 28px;border-bottom:1px solid var(--border);margin-bottom:32px}
.page-heading h1{font-size:1.8em;font-weight:800;margin-bottom:6px}
.page-heading p{color:var(--muted)}

/* ── Search results ── */
.search-bar{background:var(--white);border:1px solid var(--border);border-radius:var(--radius);
            padding:20px 24px;margin-bottom:28px}
.search-bar form{display:flex;gap:10px}
.search-bar input{flex:1;padding:11px 16px;border:1px solid var(--border);border-radius:8px;font-size:1em}
.search-bar button{padding:11px 24px;background:var(--brand);color:#fff;border:none;
                    border-radius:8px;font-weight:700;cursor:pointer}

/* ── Author card ── */
.author-card{background:var(--white);border:1px solid var(--border);border-radius:var(--radius);
             padding:28px;display:flex;gap:20px;align-items:flex-start;margin-bottom:32px}
.author-avatar-lg{width:80px;height:80px;border-radius:50%;background:linear-gradient(135deg,#3b82f6,#8b5cf6);
                   display:flex;align-items:center;justify-content:center;
                   color:#fff;font-size:2em;font-weight:700;flex-shrink:0}
.author-name{font-size:1.3em;font-weight:800;margin-bottom:6px}
.author-bio{color:var(--muted);font-size:.9em}
@media(max-width:600px){.author-card{flex-direction:column}}

/* ── Footer ── */
.blog-footer{background:#1f2937;color:#94a3b8;padding:40px 0;margin-top:60px;font-size:.85em}
.blog-footer .inner{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:32px}
.blog-footer h4{color:#fff;font-weight:700;margin-bottom:12px}
.blog-footer ul{list-style:none}
.blog-footer ul li{margin-bottom:7px}
.blog-footer ul a{color:#94a3b8}
.blog-footer ul a:hover{color:#fff;text-decoration:none}
.blog-footer-bottom{border-top:1px solid #334155;padding-top:20px;margin-top:28px;
                     text-align:center;color:#64748b}

/* ── Alerts ── */
.alert{padding:12px 18px;border-radius:8px;font-size:.9em;margin-bottom:16px}
.alert-success{background:#dcfce7;color:#166534;border:1px solid #86efac}
.alert-error{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}
.alert-info{background:var(--brand-light);color:#1e40af;border:1px solid #93c5fd}

/* ── Admin ── */
.admin-layout{display:grid;grid-template-columns:220px 1fr;min-height:100vh}
.admin-sidebar{background:#1e293b;color:#e2e8f0;padding:0}
.admin-sidebar-logo{padding:20px 18px;font-weight:800;font-size:1.1em;
                     color:#fff;border-bottom:1px solid #334155}
.admin-sidebar-logo span{color:#38bdf8}
.admin-nav{list-style:none;padding:12px 0}
.admin-nav a{display:flex;align-items:center;gap:10px;padding:11px 18px;
             color:#94a3b8;font-size:.9em;font-weight:600}
.admin-nav a:hover,.admin-nav a.active{background:#0f172a;color:#fff;text-decoration:none}
.admin-main{background:#f1f5f9;padding:30px}
.admin-topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}
.admin-topbar h1{font-size:1.4em;font-weight:800}
.admin-card{background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:24px;margin-bottom:20px}
.admin-card h3{font-size:1em;font-weight:700;margin-bottom:16px;color:#475569}
.admin-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:16px;margin-bottom:24px}
.admin-stat{background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:20px;text-align:center}
.admin-stat .n{font-size:2em;font-weight:800;color:#2563eb;display:block}
.admin-stat .l{font-size:.75em;color:#64748b;text-transform:uppercase;letter-spacing:.05em}
.admin-table{width:100%;border-collapse:collapse;font-size:.88em}
.admin-table th{background:#f8fafc;padding:10px 14px;text-align:left;font-weight:700;
                border-bottom:2px solid #e2e8f0;color:#475569}
.admin-table td{padding:10px 14px;border-bottom:1px solid #e2e8f0;vertical-align:middle}
.admin-table tr:hover td{background:#f8fafc}
.badge{padding:3px 10px;border-radius:999px;font-size:.75em;font-weight:700}
.badge-green{background:#dcfce7;color:#166534}
.badge-yellow{background:#fef9c3;color:#854d0e}
.badge-red{background:#fee2e2;color:#991b1b}
@media(max-width:800px){
  .admin-layout{grid-template-columns:1fr}
  .admin-sidebar{display:none}
}
