/* DraftSpring Design System */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-deep: #0A0F1E;
  --bg-card: #111827;
  --text-primary: #F8FAFC;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --blue: #3B82F6;
  --violet: #8B5CF6;
  --cyan: #06B6D4;
  --green: #10B981;
  --orange: #F97316;
  --red: #EF4444;
  --gradient: linear-gradient(135deg, #3B82F6, #8B5CF6, #06B6D4);
  --gradient-h: linear-gradient(90deg, #3B82F6, #8B5CF6, #06B6D4);
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: var(--blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--cyan); }

img { max-width: 100%; height: auto; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* Article / Post styles */
.post-template .site-main,
.page-template .site-main {
  max-width: 740px;
  margin: 0 auto;
  padding: 120px 24px 80px;
}

.post-header {
  margin-bottom: 48px;
  text-align: center;
}

.post-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.post-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.post-meta {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.post-meta-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-meta-author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.post-feature-image {
  margin: 0 -24px 48px;
  border-radius: 16px;
  overflow: hidden;
}

.post-feature-image img {
  width: 100%;
  display: block;
}

/* Content styling */
.post-content {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.post-content h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 48px 0 16px;
  letter-spacing: -0.02em;
}

.post-content h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 36px 0 12px;
  letter-spacing: -0.01em;
}

.post-content p {
  margin-bottom: 24px;
}

.post-content blockquote {
  border-left: 3px solid var(--violet);
  padding-left: 20px;
  margin: 32px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-content ul, .post-content ol {
  margin: 16px 0 24px 24px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content code {
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'JetBrains Mono', monospace;
}

.post-content pre {
  background: rgba(17,24,39,0.8);
  border: 1px solid rgba(148,163,184,0.08);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  overflow-x: auto;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content figure {
  margin: 32px 0;
}

.post-content figcaption {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

.post-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, rgba(59,130,246,0) 0%, rgba(59,130,246,0.4) 20%, rgba(139,92,246,0.55) 50%, rgba(6,182,212,0.4) 80%, rgba(6,182,212,0) 100%);
  margin: 48px 0;
}

/* Ghost-specific content cards */
.post-content .kg-card { margin: 32px 0; }
.post-content .kg-image-card img { border-radius: 12px; }
.post-content .kg-width-wide { margin-left: -80px; margin-right: -80px; }
.post-content .kg-width-full { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); }
.post-content .kg-bookmark-card {
  background: var(--bg-card);
  border: 1px solid rgba(148,163,184,0.08);
  border-radius: 12px;
  overflow: hidden;
}
.post-content .kg-bookmark-container { display: flex; text-decoration: none; color: inherit; }
.post-content .kg-bookmark-content { padding: 20px; flex: 1; }
.post-content .kg-bookmark-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.post-content .kg-bookmark-description { font-size: 14px; color: var(--text-muted); }
.post-content .kg-bookmark-thumbnail { width: 200px; }
.post-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* Blog listing */
.blog-listing {
  max-width: 800px;
  margin: 0 auto;
  padding: 120px 24px 80px;
}

.blog-listing-header {
  text-align: center;
  margin-bottom: 64px;
}

.blog-listing-header h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.blog-listing-header p {
  font-size: 18px;
  color: var(--text-secondary);
}

.post-card {
  display: block;
  padding: 32px;
  background: rgba(17,24,39,0.5);
  border: 1px solid rgba(148,163,184,0.07);
  border-radius: 20px;
  margin-bottom: 24px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59,130,246,0.2);
  box-shadow: 0 16px 40px rgba(2,6,23,0.3);
  color: inherit;
}

.post-card-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--violet);
  margin-bottom: 12px;
}

.post-card-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.post-card-excerpt {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.post-card-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  font-size: 14px;
  color: var(--text-muted);
}

.pagination a {
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-primary);
  font-weight: 600;
  transition: all 0.2s;
}

.pagination a:hover {
  border-color: rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.06);
}

/* Nav (shared) */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  background: rgba(10,15,30,0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(148,163,184,0.08);
}

.site-nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav-wordmark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav-links a:hover { color: var(--text-primary); }

/* Footer (shared) */
.site-footer {
  padding: 40px 24px;
  border-top: 1px solid rgba(148,163,184,0.06);
}

.site-footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer-wordmark {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-muted);
}

.site-footer-links {
  display: flex;
  gap: 24px;
}

.site-footer-links a {
  font-size: 14px;
  color: var(--text-muted);
}

.site-footer-links a:hover { color: var(--text-primary); }

.site-footer-copy {
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0.6;
}

/* Error pages */
.error-template .site-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.error-code {
  font-size: 120px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 16px;
}

.error-message {
  font-size: 20px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 640px) {
  .site-nav-links { display: none; }
  .blog-listing { padding: 80px 16px 60px; }
  .post-template .site-main,
  .page-template .site-main { padding: 80px 16px 60px; }
  .post-title { font-size: 28px; }
  .post-content { font-size: 16px; }
  .post-card { padding: 24px; }
  .post-card-title { font-size: 20px; }
  .site-footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .post-content .kg-width-wide { margin-left: 0; margin-right: 0; }
}
