/* ============================================================
   ZeusAPI Blog — Design System
   Inspired by modern SaaS blogs (Vercel, Supabase, Linear style)
   Brand: Plus Jakarta Sans, blue #2563eb accent, clean cards
   ============================================================ */

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

:root {
  --font-sans: 'Plus Jakarta Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  --blue:        #2563eb;
  --blue-light:  #3b82f6;
  --blue-dark:   #1d4ed8;
  --blue-bg:     #eff6ff;
  --blue-border: #bfdbfe;

  --purple:      #7c3aed;
  --purple-bg:   #f5f3ff;
  --purple-border:#ddd6fe;

  --amber:       #d97706;
  --amber-bg:    #fffbeb;
  --amber-border:#fde68a;

  --green:       #059669;
  --green-bg:    #ecfdf5;
  --green-border:#a7f3d0;

  --text:        #0f172a;
  --text-secondary: #475569;
  --text-tertiary:  #94a3b8;
  --bg:          #f8fafc;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --border-light:#f1f5f9;
  --shadow-sm:   0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow:      0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --shadow-md:   0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg:   0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --radius:      12px;
  --radius-sm:   8px;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
}
.nav-brand { letter-spacing: -0.3px; }
.nav-blog-label {
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: 15px;
}
.nav-cta {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-cta:hover { background: var(--border-light); color: var(--text); }

/* ---- Hero ---- */
.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 48px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-bg);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
  border: 1px solid var(--blue-border);
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto;
}

/* ---- Container ---- */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* ---- Card Grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ---- Card ---- */
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}
.card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card-body { padding: 24px; }

/* Featured card */
.card-featured {
  grid-column: 1 / -1;
  border: 1.5px solid var(--blue-border);
  background: linear-gradient(135deg, #ffffff 60%, var(--blue-bg) 100%);
  margin-bottom: 28px;
  position: relative;
}
.card-featured:hover { border-color: var(--blue-light); }
.card-featured-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-bg);
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

/* Card meta row */
.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-date, .card-read {
  font-size: 13px;
  color: var(--text-tertiary);
}
.card-read::before { content: "·"; margin-right: 12px; }

/* Tags */
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 6px;
  line-height: 1.4;
}
.tag-blue   { color: var(--blue);   background: var(--blue-bg);   }
.tag-purple { color: var(--purple); background: var(--purple-bg); }
.tag-amber  { color: var(--amber);  background: var(--amber-bg);  }
.tag-green  { color: var(--green);  background: var(--green-bg);  }

/* Card title & excerpt */
.card-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title-lg { font-size: 24px; }
.card-excerpt {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Newsletter CTA ---- */
.newsletter {
  margin-top: 64px;
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.newsletter-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.newsletter-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.newsletter-cta {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.newsletter-cta:hover { background: var(--blue-dark); }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 16px;
}
.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-tertiary);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }

/* ============================================================
   Article Post Styles
   ============================================================ */
.article-container {
  max-width: 740px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Article back link */
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.15s;
}
.article-back:hover { color: var(--text); }

/* Article header */
.article-header { margin-bottom: 40px; }
.article-header .tag { margin-bottom: 16px; display: inline-block; }
.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 16px;
}
.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-tertiary);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.article-byline span + span::before { content: "·"; margin-right: 12px; }

/* Article body typography */
.article-body {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
}

.article-body h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-light);
  color: var(--text);
  letter-spacing: -0.2px;
}

.article-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 36px 0 12px;
  color: var(--text);
}

.article-body p {
  margin-bottom: 20px;
  color: #334155;
}

.article-body a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid var(--blue-border);
  transition: border-color 0.15s;
}
.article-body a:hover { border-bottom-color: var(--blue); }

.article-body strong { color: var(--text); font-weight: 600; }

.article-body ul, .article-body ol {
  margin: 12px 0 24px 24px;
}
.article-body li {
  margin-bottom: 10px;
  color: #334155;
  padding-left: 4px;
}
.article-body li::marker { color: var(--text-tertiary); }

.article-body blockquote {
  border-left: 3px solid var(--blue);
  padding: 16px 20px;
  margin: 28px 0;
  background: var(--blue-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #475569;
  font-style: italic;
}
.article-body blockquote p { margin-bottom: 8px; }
.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body code {
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: #e11d48;
}

.article-body pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.87rem;
  line-height: 1.65;
  margin: 16px 0 28px;
}
.article-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 32px;
  font-size: 0.93rem;
}
.article-body th {
  background: #f8fafc;
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}
.article-body td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  color: #334155;
}
.article-body tr:last-child td { border-bottom: none; }

/* Article footer */
.article-footer {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.article-footer a {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
}
.article-footer a:hover { text-decoration: underline; }

/* ---- Key Takeaways Box ---- */
.key-takeaways {
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 32px 0;
}
.key-takeaways h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue);
  margin-bottom: 14px;
}
.key-takeaways ul { margin: 0; list-style: none; }
.key-takeaways li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
}
.key-takeaways li:last-child { margin-bottom: 0; }
.key-takeaways li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero { padding: 40px 20px 36px; }
  .hero-title { font-size: 1.8rem; }
  .grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px 48px; }
  .card-body { padding: 20px; }
  .card-title { font-size: 17px; }
  .card-title-lg { font-size: 20px; }
  .card-featured-badge { top: 12px; right: 12px; font-size: 10px; }
  .article-container { padding: 32px 16px 60px; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 480px) {
  .card-meta { gap: 8px; }
  .card-read::before { margin-right: 8px; }
}

/* ---- Dark Mode ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --text:        #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary:  #64748b;
    --bg:          #0f172a;
    --surface:     #1e293b;
    --border:      #334155;
    --border-light:#1e293b;
    --blue-bg:     rgba(37,99,235,0.15);
    --blue-border: rgba(37,99,235,0.3);
    --purple-bg:   rgba(124,58,237,0.15);
    --amber-bg:    rgba(217,119,6,0.15);
    --green-bg:    rgba(5,150,105,0.15);
  }
  .nav { background: rgba(15,23,42,0.82); }
  .nav-cta:hover { background: rgba(255,255,255,0.06); }
  .card:hover { border-color: #475569; }
  .card-featured { background: linear-gradient(135deg, #1e293b 60%, rgba(37,99,235,0.08) 100%); }
  .article-body { color: #e2e8f0; }
  .article-body p, .article-body li { color: #cbd5e1; }
  .article-body strong { color: #f1f5f9; }
  .article-body code { background: #334155; color: #fda4af; }
  .article-body blockquote { background: rgba(37,99,235,0.08); color: #94a3b8; }
  .article-body th { background: #1e293b; }
  .article-body td { color: #cbd5e1; }
}
