/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --accent: #10b981;
  --accent-hover: #059669;
  --border: #e5e7eb;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --max-width: 1200px;
  --content-width: 720px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* === Header === */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo { text-decoration: none; color: var(--text); }
.logo-text { font-size: 1.25rem; letter-spacing: -0.02em; }
.logo-text strong { color: var(--accent); }

.site-nav ul { display: flex; gap: 2rem; list-style: none; }
.site-nav a { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.site-nav a:hover { color: var(--accent); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; transition: 0.2s; }

/* === Hero === */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2rem; letter-spacing: -0.03em; margin-bottom: 0.75rem; }
.hero p { color: var(--text-muted); max-width: 600px; margin: 0 auto; font-size: 1.05rem; }

/* === Article Grid === */
.articles-section { padding: 3rem 0; }
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* === Article Card === */
.article-card a { display: block; color: inherit; text-decoration: none; border-radius: var(--radius); overflow: hidden; background: var(--bg); border: 1px solid var(--border); transition: box-shadow 0.2s, transform 0.2s; }
.article-card a:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-image { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-alt); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-content { padding: 1.25rem; }
.card-category { display: inline-block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin-bottom: 0.5rem; }
.card-title { font-size: 1.15rem; line-height: 1.4; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.card-excerpt { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 0.75rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); }

/* === Featured Article === */
.featured-article a {
  display: grid;
  grid-template-columns: 1fr 1fr;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.featured-article a:hover { box-shadow: var(--shadow-lg); }
.featured-image { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-alt); }
.featured-image img { width: 100%; height: 100%; object-fit: cover; }
.featured-content { padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.featured-content h2 { font-size: 1.5rem; line-height: 1.3; margin-bottom: 0.75rem; }
.featured-content p { color: var(--text-muted); margin-bottom: 1rem; }

/* === Single Article === */
.article-single { padding: 3rem 0; }
.article-container { max-width: var(--content-width); }
.article-header { margin-bottom: 2rem; }
.article-header h1 { font-size: 2.2rem; line-height: 1.25; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.article-subtitle { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 1rem; }
.article-meta { display: flex; gap: 1rem; color: var(--text-muted); font-size: 0.9rem; }
.article-hero-image { margin-bottom: 2rem; border-radius: var(--radius); overflow: hidden; }
.article-hero-image figcaption { font-size: 0.8rem; color: var(--text-muted); padding: 0.5rem 0; text-align: center; }

/* Article body typography */
.article-body h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; letter-spacing: -0.02em; }
.article-body h3 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.article-body p { margin-bottom: 1.25rem; }
.article-body ul, .article-body ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body blockquote { border-left: 3px solid var(--accent); margin: 1.5rem 0; padding: 0.75rem 1.25rem; color: var(--text-muted); background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0; }
.article-body code { background: var(--bg-alt); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; }
.article-body pre { background: #1a1a2e; color: #e5e7eb; padding: 1.25rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1.25rem; }
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body img { border-radius: var(--radius); margin: 1.5rem 0; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }

.article-tags { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag { display: inline-block; padding: 0.3rem 0.75rem; background: var(--bg-alt); border-radius: 20px; font-size: 0.8rem; color: var(--text-muted); border: 1px solid var(--border); }
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* === Related Articles === */
.related-articles { padding: 3rem 0; background: var(--bg-alt); border-top: 1px solid var(--border); }
.related-articles h2 { font-size: 1.3rem; margin-bottom: 1rem; }

/* === List/Category Pages === */
.list-section { padding: 3rem 0; }
.list-header { margin-bottom: 2rem; }
.list-header h1 { font-size: 1.8rem; }
.list-header p { color: var(--text-muted); margin-top: 0.5rem; }

.terms-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.term-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-size: 0.9rem; }
.term-item:hover { border-color: var(--accent); color: var(--accent); }
.term-count { font-size: 0.75rem; background: var(--bg-alt); padding: 0.15rem 0.5rem; border-radius: 10px; color: var(--text-muted); }

/* === Pagination === */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.btn { padding: 0.5rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; color: var(--text); }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.page-info { font-size: 0.85rem; color: var(--text-muted); }

/* === Footer === */
.site-footer { background: var(--text); color: #e5e7eb; padding: 3rem 0 1.5rem; margin-top: 4rem; }
.footer-content { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; margin-bottom: 2rem; }
.footer-about .logo-text { color: #fff; }
.footer-about .logo-text strong { color: #34d399; }
.footer-about p { color: #9ca3af; margin-top: 0.75rem; font-size: 0.9rem; }
.footer-links h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; color: #9ca3af; }
.footer-links ul { list-style: none; }
.footer-links a { color: #d1d5db; font-size: 0.9rem; line-height: 2; }
.footer-links a:hover { color: #fff; }
.footer-bottom { padding-top: 1.5rem; border-top: 1px solid #374151; font-size: 0.8rem; color: #6b7280; }

/* === Empty State === */
.empty-state { text-align: center; padding: 4rem 0; color: var(--text-muted); }
.empty-state h2 { color: var(--text); margin-bottom: 0.5rem; }

/* === Mobile === */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.5rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .featured-article a { grid-template-columns: 1fr; }
  .featured-content { padding: 1.25rem; }
  .featured-content h2 { font-size: 1.25rem; }
  .article-grid { grid-template-columns: 1fr; }
  .article-header h1 { font-size: 1.6rem; }
  .footer-content { grid-template-columns: 1fr; gap: 2rem; }

  .nav-toggle { display: block; }
  .site-nav ul { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 1rem 1.5rem; gap: 0; }
  .site-nav.open ul { display: flex; }
  .site-nav ul li a { display: block; padding: 0.5rem 0; }
}
