/* ==========================================================================
   Modern Editorial Theme - Ultra-Fast, Zero-Dependency CSS
   Optimized for 100/100 Core Web Vitals, Clean Readability & Mobile Devices
   ========================================================================== */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --accent: #0f172a;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --max-width: 860px;
  --container-width: 1080px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-main);
  line-height: 1.75;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.article-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Nav */
header.site-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.site-brand:hover .brand-logo {
  transform: scale(1.06);
}

.brand-text {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.brand-badge {
  background: var(--primary);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
}

nav.main-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

nav.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--primary);
}

/* Hero Section */
.hero {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 60px 0 50px;
  margin-bottom: 48px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: 2.6rem;
  line-height: 1.2;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  max-width: 820px;
}

.hero p.lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 720px;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 28px 0 20px;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs span.separator {
  color: var(--text-light);
}

/* Article Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 60px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.card-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 12px;
}

.article-card h2 {
  font-size: 1.35rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.article-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-light);
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

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

.post-header h1 {
  font-size: 2.5rem;
  line-height: 1.25;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.post-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.author-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-main);
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Post Content */
.post-body {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 48px;
}

.post-body h2 {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 40px;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.post-body h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 28px;
  margin-bottom: 12px;
}

.post-body p {
  margin-bottom: 22px;
}

.post-body ul, .post-body ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

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

.post-body a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.post-body a:hover {
  color: var(--primary-hover);
}

/* Definition Callout Box (Snippet / AI Overview Target) */
.definition-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px 24px;
  margin: 28px 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #0c4a6e;
}

.definition-box strong {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 6px;
}

/* Comparison Table */
.data-table-wrapper {
  overflow-x: auto;
  margin: 32px 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

table.data-table th {
  background: var(--bg-secondary);
  color: var(--accent);
  font-weight: 600;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

table.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

table.data-table tr:last-child td {
  border-bottom: none;
}

/* Author Box */
.author-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 40px;
}

.author-box-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
}

.author-box-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.author-box-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Footer */
footer.site-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 50px 0 40px;
  margin-top: 60px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 28px;
  margin-bottom: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--accent);
}

.footer-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-block;
  flex-shrink: 0;
}

.footer-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-light);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .post-header h1 { font-size: 1.9rem; }
  .post-body { padding: 24px 20px; }
  .nav-wrapper { height: 60px; }
  .articles-grid { grid-template-columns: 1fr; }
  .footer-content { flex-direction: column; align-items: flex-start; }
}
