/* ============================================================
   Blog — Precious Nwaoha
   Matches the main site design system (dark-first neumorphic)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700;800&display=swap');

/* ---- Tokens ---- */
:root {
  --bg:        #1d1d1d;
  --bg-card:   #222222;
  --bg-code:   #141414;
  --fg:        #ffffff;
  --fg-2:      #e0e0e0;
  --fg-muted:  #bbbbbb;
  --fg-subtle: #777777;
  --skin:      #fb839e;
  --border:    #2a2a2a;
  --radius:    6px;
  --max-w:     720px;
  --font:      'Raleway', sans-serif;
  --mono:      'Courier New', Courier, monospace;
  --outer-shadow: 3px 3px 3px #111216, -3px -3px 3px #252525;
}

body.light {
  --bg:        #eff0f4;
  --bg-card:   #e4e5e9;
  --bg-code:   #f0f0f0;
  --fg:        #000000;
  --fg-2:      #222222;
  --fg-muted:  #555555;
  --fg-subtle: #888888;
  --border:    #d0d0d0;
  --outer-shadow: 3px 3px 3px #d0d0d0, -3px -3px 3px #f8f8f8;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--fg-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--skin); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }

/* ---- Site header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(29, 29, 29, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
body.light .site-header {
  background: rgba(239, 240, 244, 0.88);
}

.site-nav {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 20px;
}

.site-nav-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--skin);
  text-decoration: none;
  border: 2px solid var(--skin);
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
  background: rgba(29,29,29,0.5);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
body.light .site-nav-logo { background: rgba(239,240,244,0.5); }
.site-nav-logo:hover { text-decoration: none; opacity: 0.85; }

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

.site-nav-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  padding: 5px 12px;
  border-radius: 20px;
  transition: color 0.15s;
}
.site-nav-links a:hover { color: var(--fg); text-decoration: none; }
.site-nav-links a.active { color: var(--skin); }

/* Dark/light toggle */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  font-size: 15px;
  box-shadow: var(--outer-shadow);
  transition: color 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--fg); }

/* ---- Page container ---- */
.blog-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ---- Post header ---- */
.post-header {
  margin-bottom: 40px;
}

.post-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--skin);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.post-kicker::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.post-title {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--skin);
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--fg-subtle);
  margin-bottom: 14px;
}
.post-meta-sep { color: var(--border); }
.post-meta i { font-size: 12px; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--skin);
  background: rgba(251,131,158,0.1);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

/* ---- Cover image ---- */
.post-cover {
  margin: 0 0 36px;
  border-radius: var(--radius);
  overflow: hidden;
}
.post-cover img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ---- Video embed ---- */
.video-embed {
  margin: 32px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
}
.video-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ============================================================
   Post content typography
   ============================================================ */
.post-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--fg-2);
}

.post-content > * + * { margin-top: 1.4em; }

/* Headings */
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--fg);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2.2em;
  margin-bottom: 0.6em;
}
.post-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1rem; color: var(--fg-muted); }

/* Paragraphs */
.post-content p { margin: 0 0 1.2em; }
.post-content p:last-child { margin-bottom: 0; }

/* Strong / em */
.post-content strong { color: var(--fg); font-weight: 700; }
.post-content em { font-style: italic; color: var(--fg-muted); }

/* Links */
.post-content a {
  color: var(--skin);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.post-content a:hover { opacity: 0.8; }

/* Lists */
.post-content ul,
.post-content ol {
  padding-left: 1.6em;
  margin: 0 0 1.2em;
}
.post-content li { margin-bottom: 0.4em; }
.post-content li::marker { color: var(--skin); }
.post-content ol li::marker { font-weight: 700; }
.post-content ul li {
  list-style: none;
  position: relative;
  padding-left: 1em;
}
.post-content ul li::before {
  content: '→';
  position: absolute;
  left: -0.2em;
  color: var(--skin);
  font-weight: 700;
  font-size: 0.85em;
  top: 0.05em;
}
.post-content ol { list-style: decimal; }

/* Nested lists */
.post-content ul ul,
.post-content ol ol,
.post-content ul ol,
.post-content ol ul { margin: 0.3em 0 0.3em 1em; }

/* Blockquote */
.post-content blockquote {
  border-left: 3px solid var(--skin);
  margin: 1.6em 0;
  padding: 12px 20px;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--fg-muted);
  font-style: italic;
}
.post-content blockquote p { margin: 0; }
.post-content blockquote strong { color: var(--fg); }

/* Inline code */
.post-content code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-code);
  color: var(--skin);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Code blocks */
.post-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 1.6em 0;
  line-height: 1.6;
}
.post-content pre code {
  background: none;
  color: #e0e0e0;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 0.875rem;
}

/* Horizontal rule */
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.9rem;
}
.post-content th,
.post-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.post-content th {
  background: var(--bg-card);
  color: var(--fg);
  font-weight: 700;
}
.post-content tr:nth-child(even) { background: rgba(255,255,255,0.02); }

/* Images in content */
.post-content img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.4em auto;
}
body.light .post-content img { border-color: #d0d0d0; }

/* ---- Post footer ---- */
.post-footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.post-footer a {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
.post-footer a:hover { color: var(--skin); text-decoration: none; }
.post-footer-socials { display: flex; gap: 8px; }
.post-footer-socials a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--fg-muted);
  box-shadow: var(--outer-shadow);
  transition: color 0.15s;
}
.post-footer-socials a:hover { color: var(--skin); }

/* ---- Blog index ---- */
.blog-index {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.blog-intro { margin-bottom: 48px; }
.blog-intro h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 10px;
}
.blog-intro p { color: var(--fg-muted); font-size: 1rem; }

.post-grid { display: flex; flex-direction: column; gap: 0; }

.post-card {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.post-card:first-child { border-top: 1px solid var(--border); }

.card-cover { display: block; margin-bottom: 14px; border-radius: var(--radius); overflow: hidden; }
.card-cover img { width: 100%; height: 200px; object-fit: cover; transition: opacity 0.2s; }
.card-cover:hover img { opacity: 0.85; }

.post-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.post-card h2 a { color: var(--fg); transition: color 0.15s; }
.post-card h2 a:hover { color: var(--skin); text-decoration: none; }

.card-meta {
  font-size: 12px;
  color: var(--fg-subtle);
  margin-bottom: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.card-description { font-size: 0.9rem; color: var(--fg-muted); line-height: 1.6; }
.card-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }

/* ---- Empty state ---- */
.empty-state { color: var(--fg-muted); padding: 40px 0; text-align: center; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .blog-page, .blog-index { padding: 32px 16px 60px; }
  .post-title { font-size: 1.6rem; }
  .post-content pre { padding: 14px 16px; font-size: 0.8rem; }
  .site-nav-links a span { display: none; }
}
