/* ===== Frontend CSS ===== */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg-light: #f8fafc;
}

* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); line-height: 1.7; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

/* Navbar */
.site-navbar { box-shadow: 0 1px 0 var(--border); }
.navbar-brand { font-weight: 700; font-size: 1.2rem; color: var(--primary) !important; }
.nav-link { font-size: .9rem; }

/* Hero */
.hero { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color: #fff; padding: 80px 0; }
.hero h1 { font-weight: 800; }

/* Article card */
.article-card { transition: transform .2s, box-shadow .2s; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.article-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.article-card .card-img-top { height: 200px; object-fit: cover; }
.article-card .card-body { padding: 20px; }
.article-meta { font-size: .8rem; color: var(--text-muted); }
.article-card .card-title a { color: var(--text); text-decoration: none; font-weight: 700; }
.article-card .card-title a:hover { color: var(--primary); }
.article-card .card-text { font-size: .875rem; color: var(--text-muted); }

/* Category badge */
.badge-category { background: #ede9fe; color: #5b21b6; font-size: .72rem; font-weight: 600; padding: 3px 8px; border-radius: 4px; text-decoration: none; }
.badge-category:hover { background: #5b21b6; color: #fff; }

/* Article content */
.article-content { font-size: 1.05rem; line-height: 1.8; }
.article-content h1, .article-content h2, .article-content h3 { margin-top: 2rem; margin-bottom: 1rem; font-weight: 700; }
.article-content p { margin-bottom: 1.2rem; }
.article-content img { border-radius: 8px; margin: 1rem 0; }
.article-content blockquote { border-left: 4px solid var(--primary); padding-left: 1.5rem; color: var(--text-muted); font-style: italic; margin: 1.5rem 0; }
.article-content pre, .article-content code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-family: 'Consolas', monospace; font-size: .9em; }
.article-content pre { padding: 16px; overflow-x: auto; }
.article-content ul, .article-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }

/* Tags */
.tag-link { display: inline-block; background: var(--bg-light); color: var(--text-muted); font-size: .78rem; padding: 3px 10px; border-radius: 20px; text-decoration: none; border: 1px solid var(--border); transition: all .15s; }
.tag-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Sidebar widget */
.widget { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.widget-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 14px; }

/* Search */
.search-form .form-control:focus { box-shadow: none; border-color: var(--primary); }
.search-form .btn { background: var(--primary); border-color: var(--primary); }

/* Pagination */
.page-link { color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* Footer */
.site-footer { background: var(--text); color: rgba(255,255,255,.7); padding: 40px 0 20px; }
.site-footer a { color: rgba(255,255,255,.7); }
.site-footer a:hover { color: #fff; }
.site-footer .footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 24px; padding-top: 16px; font-size: .85rem; }

/* Featured image */
.featured-image { width: 100%; max-height: 480px; object-fit: cover; border-radius: 12px; margin-bottom: 2rem; }

/* No-image placeholder */
.img-placeholder { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); display: flex; align-items: center; justify-content: center; color: #6366f1; }

/* Breadcrumb */
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* 404 */
.error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* Responsive */
@media (max-width: 768px) {
  .hero { padding: 50px 0; }
  .hero h1 { font-size: 1.8rem; }
}
