/* ===================================================================
   AgentReady Blog — Shared Styles
   Imports the main design system tokens + header/footer/layout
   =================================================================== */

/* ===== VARIABLES ===== */
:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --surface: #ffffff;
  --card-bg: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --muted: #f1f5f9;
  --muted-fg: #64748b;
  --text: #0f172a;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --border-2: #cbd5e1;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59,130,246,0.1);
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59,130,246,0.1);
  --green: #10b981;
  --green-light: #d1fae5;
  --yellow: #f59e0b;
  --yellow-light: #fef3c7;
  --red: #ef4444;
  --red-light: #fee2e2;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius-sm: 0.375rem;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  --shadow-xs: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0b1120;
  --fg: #f8fafc;
  --surface: #0f1729;
  --card-bg: #0f1729;
  --bg-2: #1a2436;
  --bg-3: #243044;
  --muted: #1a2436;
  --muted-fg: #94a3b8;
  --text: #f8fafc;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --text-secondary: #94a3b8;
  --border: #1e293b;
  --border-2: #334155;
  --primary-light: rgba(59,130,246,0.15);
  --accent-light: rgba(59,130,246,0.15);
  --green-light: rgba(16,185,129,0.15);
  --yellow-light: rgba(245,158,11,0.15);
  --red-light: rgba(239,68,68,0.15);
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-sm: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-md: 0 10px 15px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 25px rgba(0,0,0,0.4);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
button { cursor: pointer; font-family: var(--font); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--bg-3); padding: 2px 6px; border-radius: 4px; }

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255,255,255,0.8);
  transition: background var(--transition), border-color var(--transition);
}
[data-theme="dark"] .header {
  background: rgba(11,17,32,0.8);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--text); text-decoration: none; }
.logo-icon { font-size: 1.375rem; }
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.header-nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
  text-decoration: none;
}
.header-nav a:hover { color: var(--text); text-decoration: none; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.625rem;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }
.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition: all var(--transition);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.625rem;
  font-size: 1.25rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.hamburger-btn:hover { border-color: var(--accent); color: var(--text); }
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  margin: 2px 0;
  border-radius: 1px;
  transition: all var(--transition);
}

/* ===== FOOTER (Dark) ===== */
footer {
  background: #020617;
  color: #94a3b8;
  padding: 3.5rem 0 2rem;
  border-top: 1px solid rgba(30,41,59,0.5);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: #f8fafc;
  font-family: var(--font-heading);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-brand .logo-icon { font-size: 1.25rem; }
.footer-brand p {
  font-size: 0.875rem;
  font-weight: 400;
  color: #64748b;
  margin: 0;
  font-family: var(--font);
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.footer-links h4 {
  color: #f8fafc;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
}
.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: #f8fafc; }
.footer-bottom {
  border-top: 1px solid rgba(30,41,59,0.5);
  padding-top: 1.5rem;
  text-align: center;
}
.footer-bottom p {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== BLOG INDEX ===== */
.blog-hero {
  text-align: center;
  padding: 5rem 1.5rem 2.5rem;
}
.blog-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  line-height: 1.1;
}
.blog-hero p {
  font-size: 1.125rem;
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto;
}
.blog-grid {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: var(--text);
  display: block;
}
.blog-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  text-decoration: none;
}
.blog-card-date {
  font-size: 0.8125rem;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.blog-card h2 {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.625rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.blog-card p {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.6;
}
.blog-card-tag {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== ARTICLE ===== */
.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 3.75rem 1.5rem 5rem;
}
.article-meta {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.article-tag {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.1875rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.article h1 {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.article h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.02em;
}
.article h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
}
.article p {
  font-size: 1rem;
  color: var(--text-2);
  margin-bottom: 1rem;
  line-height: 1.75;
}
.article ul, .article ol {
  margin: 0 0 1rem 1.5rem;
  color: var(--text-2);
}
.article li {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  line-height: 1.6;
}
.article strong { color: var(--text); }
.article a { font-weight: 500; }

/* Code blocks */
.code-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  white-space: pre;
  border: 1px solid rgba(30,41,59,0.5);
}
.code-block code {
  background: none;
  padding: 0;
  font-size: 0.8125rem;
  color: inherit;
}

/* Callout */
.callout {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}
.callout p { color: var(--text); margin: 0; }

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
}
.comparison-table th {
  background: var(--bg-2);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}
.comparison-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.comparison-table tr:hover { background: var(--bg-2); }

/* Score cards */
.score-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.score-category h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}
.score-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.75rem 0;
}
.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* CTA box */
.cta-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin: 3rem 0 0;
}
.cta-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-family: var(--font-heading);
}
.cta-box p { margin: 0 0 1rem; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(to right, #3b82f6, #2563eb);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: white;
}

/* Related articles */
.related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.related h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-3);
}
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { margin-bottom: 0.5rem; }
.related a { font-weight: 500; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .blog-hero { padding: 3rem 1rem 2rem; }
  .blog-hero h1 { font-size: 2rem; }
  .blog-card { padding: 1.5rem; }
  .blog-card h2 { font-size: 1.125rem; }
  .article { padding: 2.5rem 1rem 3.75rem; }
  .article h1 { font-size: 1.625rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .header-nav { gap: 0.5rem; }
  .header-nav a { display: none; }
  .header-nav.mobile-open a { display: block; }
  .header-nav.mobile-open {
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
    z-index: 200;
    backdrop-filter: blur(16px);
  }
  .hamburger-btn { display: flex !important; }
  .footer-grid { grid-template-columns: 1fr; }
  .comparison-table { font-size: 0.75rem; }
  .comparison-table th, .comparison-table td { padding: 0.5rem; }
}

/* ===== SELECTION / SCROLLBAR ===== */
::selection {
  background: rgba(59,130,246,0.2);
  color: var(--text);
}
