/* =======================================================
   AIResalePro Blog — shared styles
   Extends the main landing page design system with
   optimized typography for long-form reading.
   ======================================================= */

/* Theme tokens mirror the landing page */
:root,
[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-raised: #ffffff;
  --bg-card: #ffffff;
  --bg-sunken: #eef2f7;
  --bg-navy: #0a0f1e;
  --bg-navy-raised: #141b2e;
  --fg: #111827;
  --fg-on-navy: #f5f7fa;
  --fg-muted: #6b7280;
  --fg-dim: #9ca3af;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #dbeafe;
  --gold: #f59e0b;
  --gold-soft: #fef3c7;
  --success: #10b981;
  --success-soft: #d1fae5;
  --purple: #a78bfa;
  --red: #ef4444;
  --red-soft: #fee2e2;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --code-bg: #f1f5f9;
  --code-fg: #334155;
}

[data-theme="dark"] {
  --bg: #0a0f1e;
  --bg-raised: #141b2e;
  --bg-card: #141b2e;
  --bg-sunken: #050811;
  --bg-navy: #050811;
  --bg-navy-raised: #0a0f1e;
  --fg: #f5f7fa;
  --fg-on-navy: #f5f7fa;
  --fg-muted: #9aa3b2;
  --fg-dim: #64748b;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: rgba(59, 130, 246, 0.15);
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, 0.15);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.15);
  --purple: #a78bfa;
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.15);
  --border: #1f2937;
  --border-strong: #374151;
  --nav-bg: rgba(10, 15, 30, 0.85);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.4);
  --code-bg: #0f172a;
  --code-fg: #cbd5e1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- NAV (reused from landing) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1240px;
  margin: 0 auto;
}
.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--fg); }
.nav-cta { display: flex; gap: 10px; align-items: center; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.logo-mark {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.logo-mark svg { width: 18px; height: 18px; }
.logo .crown { color: var(--gold); font-size: 15px; margin-left: -4px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg-muted);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--border-strong); }
.theme-toggle svg {
  position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.6); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}
.btn-ghost { color: var(--fg-muted); background: transparent; }
.btn-ghost:hover { color: var(--fg); background: var(--bg-sunken); }
.btn-secondary {
  background: var(--bg-raised);
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-strong); background: var(--bg-sunken); }
.arrow { display: inline-block; transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- BLOG INDEX HEADER ---------- */
.blog-hero {
  padding: 80px 0 40px;
  text-align: center;
}
.blog-hero .eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  padding: 6px 14px;
  background: var(--primary-soft);
  border-radius: 100px;
  margin-bottom: 24px;
}
.blog-hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--fg);
  margin-bottom: 16px;
}
.blog-hero p {
  font-size: 18px;
  color: var(--fg-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---------- BLOG POST GRID ---------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  padding: 40px 0 100px;
}
.post-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.25s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.post-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-sunken);
  color: var(--fg-muted);
  margin-bottom: 16px;
  width: fit-content;
}
.post-tag.guide { background: var(--primary-soft); color: var(--primary); }
.post-tag.comparison { background: var(--gold-soft); color: var(--gold); }
.post-tag.howto { background: var(--success-soft); color: var(--success); }
.post-card h2 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
  color: var(--fg);
}
.post-card p {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.55;
  margin-bottom: 20px;
  flex-grow: 1;
}
.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--fg-dim);
}
.post-meta .read-time { color: var(--primary); font-weight: 700; }

/* ---------- POST PAGE ---------- */
.post-header {
  padding: 64px 0 32px;
}
.post-header .breadcrumb {
  font-size: 14px;
  margin-bottom: 24px;
}
.post-header .breadcrumb a {
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 600;
}
.post-header .breadcrumb a:hover { color: var(--primary); }
.post-header .breadcrumb .sep { margin: 0 8px; color: var(--fg-dim); }
.post-header .current { color: var(--fg); }

.post-header h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--fg);
  margin-bottom: 20px;
  max-width: 900px;
}
.post-header .deck {
  font-size: 20px;
  color: var(--fg-muted);
  line-height: 1.55;
  max-width: 800px;
  margin-bottom: 28px;
}
.post-header .byline {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: var(--fg-muted);
}
.post-header .byline strong { color: var(--fg); font-weight: 700; }
.post-header .byline .sep::before { content: '·'; margin: 0 4px; }

/* ---------- POST CONTENT ---------- */
.post-content {
  max-width: 760px;
  padding: 40px 0 80px;
  font-size: 18px;
  line-height: 1.75;
}
.post-content p {
  margin-bottom: 1.3em;
  color: var(--fg);
}
.post-content p strong { font-weight: 700; color: var(--fg); }
.post-content h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 2em 0 0.6em;
  color: var(--fg);
}
.post-content h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 1.8em 0 0.4em;
  color: var(--fg);
}
.post-content ul, .post-content ol {
  margin: 0 0 1.5em 1.5em;
  padding: 0;
}
.post-content li {
  margin-bottom: 0.5em;
  color: var(--fg);
}
.post-content li::marker { color: var(--primary); }
.post-content a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.post-content a:hover { border-bottom-color: var(--primary); }
.post-content blockquote {
  margin: 1.5em 0;
  padding: 4px 0 4px 24px;
  border-left: 4px solid var(--primary);
  color: var(--fg-muted);
  font-style: italic;
  font-size: 19px;
}
.post-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Callout boxes (match landing page style) */
.callout {
  margin: 2em 0;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid;
  background: var(--bg-raised);
}
.callout.pro {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.callout.warn {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.callout.success {
  background: var(--success-soft);
  border-color: var(--success);
}
.callout-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.callout.pro .callout-label { color: var(--primary); }
.callout.warn .callout-label { color: var(--gold); }
.callout.success .callout-label { color: var(--success); }
.callout-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 8px !important;
  letter-spacing: -0.01em;
}
.callout p { margin-bottom: 0.5em !important; font-size: 16px; }
.callout p:last-child { margin-bottom: 0 !important; }

/* Data tables in posts */
.post-content .data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 15px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.post-content .data-table thead {
  background: var(--bg-navy);
  color: var(--fg-on-navy);
}
.post-content .data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: white;
}
.post-content .data-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--fg);
}
.post-content .data-table tr:nth-child(even) td { background: var(--bg-sunken); }

/* TOC */
.post-toc {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 40px;
  max-width: 760px;
}
.post-toc h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin-bottom: 12px;
}
.post-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.post-toc li {
  counter-increment: toc;
  margin-bottom: 6px;
  padding-left: 24px;
  position: relative;
  color: var(--fg);
  font-size: 15px;
  font-weight: 500;
}
.post-toc li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.post-toc a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}
.post-toc a:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* End-of-post CTA */
.post-cta {
  background: linear-gradient(135deg, var(--bg-navy) 0%, var(--bg-navy-raised) 100%);
  color: var(--fg-on-navy);
  border-radius: 20px;
  padding: 40px 36px;
  margin: 3em 0 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.post-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.2), transparent 40%),
              radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.1), transparent 40%);
  pointer-events: none;
}
.post-cta h3 {
  font-size: 24px;
  font-weight: 800;
  color: white !important;
  margin: 0 0 12px 0 !important;
  letter-spacing: -0.015em;
  position: relative;
}
.post-cta p {
  color: rgba(255, 255, 255, 0.8) !important;
  max-width: 500px;
  margin: 0 auto 24px !important;
  position: relative;
  font-size: 16px;
}
.post-cta .btn {
  background: white;
  color: var(--primary);
  position: relative;
}
.post-cta .btn:hover { background: #f5f7fa; transform: translateY(-1px); }

/* Related posts */
.related-posts {
  padding: 60px 0;
  border-top: 1px solid var(--border);
}
.related-posts h2 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin-bottom: 28px;
}

/* Footer reused from landing */
footer {
  padding: 48px 0 32px;
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 13px;
  color: var(--fg-muted);
}
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.footer-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover { color: var(--primary); }

/* Responsive */
@media (max-width: 760px) {
  .post-content h2 { font-size: 26px; }
  .post-content h3 { font-size: 20px; }
  .post-content { font-size: 17px; }
  .post-cta { padding: 32px 24px; }
  .post-cta h3 { font-size: 20px; }
  .nav-links { display: none; }
  .nav-cta .btn-ghost { display: none; }
}
