/* ============================================
   PortfolioShield Blog — main.css
   Design system matched to landing page
   ============================================ */

/* --- Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Variables (from landing page) --- */
:root {
  --bg-primary: #08090d;
  --bg-secondary: #0f1117;
  --bg-card: #14161e;
  --bg-card-hover: #1a1d28;
  --accent-green: #10b981;
  --accent-green-dim: rgba(16, 185, 129, 0.12);
  --accent-green-hover: #34d399;
  --accent-blue: #3b82f6;
  --accent-blue-dim: rgba(59, 130, 246, 0.1);
  --accent-purple: #7c3aed;
  --accent-cyan: #06b6d4;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --glow-green: 0 0 80px rgba(16, 185, 129, 0.08);

  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --max-width: 1200px;
  --content-width: 720px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: var(--accent-green); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-green-hover); }
img { max-width: 100%; height: auto; display: block; }

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(8, 9, 13, 0.8);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo { height: 56px; width: auto; }

.main-nav {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.nav-link.active { color: var(--accent-green); background: var(--accent-green-dim); }

.header-actions { flex-shrink: 0; }

.btn-app {
  display: inline-flex;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #000;
  background: var(--accent-green);
  padding: 10px 22px;
  border-radius: 10px;
  transition: all 0.2s;
}
.btn-app:hover {
  background: var(--accent-green-hover);
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  margin: 4px 0;
  border-radius: 2px;
}

/* --- Hero --- */
.blog-hero {
  padding: 80px 32px 60px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.03) 0%, transparent 100%);
}

.hero-inner { max-width: 640px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-green);
  margin-bottom: 16px;
}

.blog-hero h1 {
  font-family: var(--font-body);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Posts Grid --- */
.posts-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
}
.post-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.post-card-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card-body { padding: 24px; }

.post-type {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.post-type--research { background: rgba(59, 130, 246, 0.12); color: var(--accent-blue); }
.post-type--failure-mode { background: rgba(249, 115, 22, 0.12); color: #fb923c; }
.post-type--proprietary { background: var(--accent-green-dim); color: var(--accent-green); }
.post-type--methodology { background: rgba(124, 58, 237, 0.12); color: #a78bfa; }
.post-type--hype { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.post-type--reactive { background: rgba(239, 68, 68, 0.12); color: #f87171; }

.post-card-title {
  font-family: var(--font-body);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}
.post-card-title a { color: var(--text-primary); }
.post-card-title a:hover { color: var(--accent-green); }

.post-card-excerpt {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

/* --- Single Post --- */
.post-header {
  padding: 64px 32px 40px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.02) 0%, transparent 100%);
}

.post-header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.post-header h1 {
  font-family: var(--font-body);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin: 12px 0 16px;
}

.post-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dot { color: var(--text-muted); }
.series-link { color: var(--accent-green); font-weight: 500; }

.research-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 16px;
  background: var(--accent-blue-dim);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.research-badge em { color: var(--accent-blue); }

/* --- Post Content --- */
.post-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 32px 40px;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.post-content h2 {
  font-family: var(--font-body);
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 48px 0 16px;
  color: var(--text-primary);
}

.post-content h3 {
  font-family: var(--font-body);
  font-size: 1.1875rem;
  font-weight: 700;
  margin: 36px 0 12px;
  color: var(--text-primary);
}

.post-content p { margin-bottom: 20px; color: var(--text-primary); }

.post-content blockquote {
  margin: 28px 0;
  padding: 16px 24px;
  border-left: 3px solid var(--accent-green);
  background: var(--accent-green-dim);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-card-hover);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-green);
}

.post-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
}
.post-content pre code { background: none; padding: 0; color: var(--text-primary); }

.post-content strong { color: var(--text-primary); font-weight: 600; }

.post-content ul, .post-content ol {
  margin: 16px 0 24px;
  padding-left: 24px;
}
.post-content li { margin-bottom: 8px; }
.post-content li::marker { color: var(--accent-green); }

.post-content hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 40px 0;
}

.post-content a { color: var(--accent-green); text-decoration: underline; text-decoration-color: rgba(16, 185, 129, 0.3); text-underline-offset: 2px; }
.post-content a:hover { color: var(--accent-green-hover); text-decoration-color: var(--accent-green-hover); }

/* --- Post CTA --- */
.post-cta {
  max-width: var(--content-width);
  margin: 0 auto 40px;
  padding: 28px 32px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(59, 130, 246, 0.04) 100%);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-lg);
  text-align: center;
}

.cta-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #000;
  background: var(--accent-green);
  padding: 12px 28px;
  border-radius: 10px;
  transition: all 0.2s;
}
.btn-cta:hover {
  background: var(--accent-green-hover);
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

/* --- Tags --- */
.post-tags {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 32px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}
.tag:hover { border-color: rgba(16, 185, 129, 0.3); color: var(--accent-green); }

/* --- Inline Email Capture --- */
.inline-capture {
  max-width: var(--content-width);
  margin: 0 auto 48px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
}

.inline-capture h3 {
  font-family: var(--font-body);
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.inline-capture p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* --- Related Posts --- */
.related-posts {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 32px 60px;
}

.related-posts h3 {
  font-family: var(--font-body);
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.related-grid { display: flex; flex-direction: column; gap: 8px; }

.related-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}
.related-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.related-type {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 80px;
}
.related-title { color: var(--text-primary); font-weight: 500; font-size: 0.9375rem; }

/* --- Footer --- */
.email-capture {
  padding: 60px 32px;
  text-align: center;
  background: linear-gradient(180deg, transparent 0%, rgba(16, 185, 129, 0.03) 100%);
  border-top: 1px solid var(--border-color);
}

.capture-inner { max-width: 540px; margin: 0 auto; }

.email-capture h2 {
  font-family: var(--font-body);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 12px;
}

.email-capture p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.site-footer .footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 32px 48px;
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
}

.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-logo { max-height: 100px; width: auto; object-fit: contain; opacity: 0.85; }

.footer-tagline { font-size: 0.875rem; color: var(--text-muted); }

.footer-links { display: flex; gap: 48px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.footer-col a { font-size: 0.875rem; color: var(--text-secondary); }
.footer-col a:hover { color: var(--accent-green); }

.footer-bottom {
  grid-column: 1 / -1;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.footer-disclaimer { margin-top: 4px; font-size: 0.75rem; }

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
  list-style: none;
}
.pagination .page-item a, .pagination .page-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}
.pagination .page-item.active span { background: var(--accent-green); color: #000; border-color: var(--accent-green); }
.pagination .page-item a:hover { border-color: rgba(16, 185, 129, 0.3); color: var(--accent-green); }

/* --- Mobile --- */
@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 12px;
  }
  .main-nav.open { display: flex; }
  .mobile-toggle { display: block; margin-left: auto; }
  .header-actions { display: none; }

  .header-inner { padding: 0 20px; }

  .blog-hero { padding: 48px 20px 40px; }
  .blog-hero h1 { font-size: 1.75rem; }

  .posts-section { padding: 32px 20px 60px; }
  .posts-grid { grid-template-columns: 1fr; }

  .post-header { padding: 48px 20px 32px; }
  .post-header h1 { font-size: 1.75rem; }
  .post-content { padding: 32px 20px; font-size: 1rem; }
  .post-tags { padding: 0 20px 32px; }
  .related-posts { padding: 0 20px 48px; }

  .site-footer .footer-inner { grid-template-columns: 1fr; gap: 24px; padding: 32px 20px 40px; }
  .footer-links { flex-direction: column; gap: 24px; }

  .email-capture { padding: 40px 20px; }
}
