:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-bg: #eff6ff;
  --text: #1f2937;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --muted: #6b7280;
  --border: #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

header { background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); color: white; padding: 2rem 0; margin-bottom: 2rem; }
header .container { text-align: center; }
header .header-inner { display: flex; align-items: center; justify-content: space-between; text-align: left; }
header h1 { font-size: 1.75rem; margin: 0; color: white; font-weight: 600; }
header.compact { padding: 0.75rem 0; }
header.compact h1 { font-size: 1.25rem; }
header .site-name { color: white; text-decoration: none; font-size: 1.25rem; font-weight: 600; }
header .site-name:hover { opacity: 0.9; }

main { padding-bottom: 3rem; min-height: 60vh; }

/* Article single page */
.article-single { background: var(--card-bg); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid var(--border); }
.article-single .featured-image { width: 100%; max-height: 400px; object-fit: cover; }
.article-single .article-header { padding: 2rem 2rem 1rem; border-bottom: 1px solid var(--border); }
.article-single .article-header h1 { font-size: 2rem; margin-bottom: 0.75rem; color: var(--text); }
.article-single .article-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.article-single .article-meta time { color: var(--primary-light); font-size: 0.875rem; font-weight: 500; }
.article-single .article-meta .author { color: var(--muted); font-size: 0.875rem; }
.article-single .article-body { padding: 2rem; }
.article-single .article-body h2 { margin-top: 1.5rem; margin-bottom: 0.75rem; color: var(--primary); font-size: 1.5rem; }
.article-single .article-body h3 { margin-top: 1.25rem; margin-bottom: 0.5rem; color: var(--text); font-size: 1.25rem; }
.article-single .article-body p { margin-bottom: 1rem; line-height: 1.8; }
.article-single .article-body ul, .article-single .article-body ol { margin-bottom: 1rem; padding-left: 2rem; }
.article-single .article-body li { margin-bottom: 0.5rem; }
.article-single .article-body a { color: var(--primary); }
.article-single .article-body a:hover { color: var(--primary-light); }
.article-single .article-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 1rem 0; }
.article-single .article-body blockquote { border-left: 4px solid var(--primary-light); padding-left: 1rem; margin: 1rem 0; color: var(--muted); font-style: italic; }
.article-single .article-body pre { background: #1f2937; color: #e5e7eb; padding: 1rem; border-radius: 8px; overflow-x: auto; margin: 1rem 0; }
.article-single .article-body code { background: var(--primary-bg); padding: 0.2rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
.article-single .article-body pre code { background: none; padding: 0; }

/* Search box in header */
.search-box { position: relative; width: 280px; }
.search-input { width: 100%; padding: 0.5rem 1rem 0.5rem 2.5rem; border: 1px solid rgba(255,255,255,0.3); border-radius: 6px; font-size: 0.875rem; background: rgba(255,255,255,0.15); color: white; transition: background 0.2s, border-color 0.2s; }
.search-input:focus { outline: none; background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); }
.search-input::placeholder { color: rgba(255,255,255,0.7); }
.search-input:disabled { cursor: not-allowed; }
.search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: rgba(255,255,255,0.7); pointer-events: none; }

/* Article list on homepage */
.article-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.article-list li { background: var(--card-bg); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid var(--border); transition: all 0.2s; }
.article-list li:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(30,64,175,0.12); border-color: var(--primary-light); }
.article-list a { text-decoration: none; color: inherit; display: block; }
.article-list img { width: 100%; height: 200px; object-fit: cover; }
.article-list .no-image { width: 100%; height: 200px; background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); }
.article-list .article-content { padding: 1.25rem; }
.article-list h2 { color: var(--text); font-size: 1.1rem; margin-bottom: 0.5rem; line-height: 1.4; transition: color 0.2s; }
.article-list a:hover h2 { color: var(--primary); }
.article-list p { color: var(--muted); font-size: 0.875rem; margin-bottom: 0.75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-list time { color: var(--primary-light); font-size: 0.75rem; font-weight: 500; }

.empty-message { text-align: center; padding: 3rem; color: var(--muted); }

footer { background: var(--primary-bg); margin-top: 4rem; padding: 1.5rem 0; color: var(--muted); font-size: 0.875rem; text-align: center; border-top: 1px solid var(--border); }