/* ── Blog Post Styles ──
   Loaded by all blog post pages alongside theme.css and styles.css.
   Uses design tokens from theme.css (--brand, --accent, --surface, --text, etc.)
*/

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  z-index: 10000;
  width: 0;
  transition: width 50ms linear;
  pointer-events: none;
}

/* ── Article Layout ── */
.blog-article {
  max-width: 800px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 3rem;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.separator { color: var(--border); }

/* Category tag */
.article-category { margin-bottom: 1rem; }
.category-tag {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Title & subtitle */
.article-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 1rem;
  color: var(--text);
}
.article-subtitle {
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--muted);
  margin: 0 0 2rem;
}

/* Meta bar (author + share) */
.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.author-info { display: flex; align-items: center; gap: 12px; }
.author-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.author-name { font-weight: 600; color: var(--text); }
.article-date { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.article-actions { display: flex; gap: 12px; }
.share-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.share-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ── Hero Image ── */
.hero-image {
  margin: 3rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.hero-image img { width: 100%; height: auto; display: block; }
.hero-image figcaption {
  padding: 1rem;
  background: var(--surface-alt);
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}

/* ── Table of Contents ── */
.table-of-contents {
  margin: 2rem 0;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table-of-contents h2 { margin: 0 0 1rem; font-size: 1.25rem; }
.table-of-contents ol { margin: 0; padding-left: 1.5rem; }
.table-of-contents li { margin-bottom: 8px; }
.table-of-contents a {
  color: var(--text);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.2s;
}
.table-of-contents a:hover,
.table-of-contents a.active {
  color: var(--brand);
  font-weight: 600;
}

/* ── Article Content Typography ── */
.article-content { line-height: 1.8; font-size: 1.1rem; }
.article-content h2 { font-size: 2rem; margin: 3rem 0 1.5rem; font-weight: 700; color: var(--text); }
.article-content h3 { font-size: 1.5rem; margin: 2.5rem 0 1rem; font-weight: 600; }
.article-content h4 { font-size: 1.25rem; margin: 2rem 0 0.75rem; font-weight: 600; }
.article-content p { margin: 0 0 1.5rem; }
.article-content ul,
.article-content ol { margin: 0 0 1.5rem; padding-left: 1.5rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.article-content a:hover { opacity: 0.8; }
.article-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1.5rem 0; }

/* Section entrance animation */
.article-content section {
  animation: fadeInUp 0.6s ease both;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Lead paragraph with drop cap */
.lead-paragraph {
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 2rem;
  font-weight: 400;
}
.lead-paragraph::first-letter {
  float: left;
  font-size: 3.5em;
  line-height: 0.8;
  margin: 0.05em 0.1em 0 0;
  font-weight: 700;
  color: var(--brand);
}

/* ── Blockquotes ── */
.article-content blockquote {
  position: relative;
  margin: 2rem 0;
  padding: 1.5rem 2rem 1.5rem 2.5rem;
  background: var(--surface-alt);
  border-left: 4px solid var(--brand);
  border-radius: 0 12px 12px 0;
  font-style: italic;
}
.article-content blockquote::before {
  content: '\201C';
  font-size: 3rem;
  color: var(--brand);
  opacity: 0.3;
  position: absolute;
  top: -0.25rem;
  left: 0.5rem;
  font-family: Georgia, serif;
}
.featured-quote {
  margin: 3rem 0;
  padding: 2rem 2rem 2rem 2.5rem;
  background: var(--surface-alt);
  border-radius: 12px;
  border-left: 4px solid var(--brand);
  font-style: italic;
  font-size: 1.2rem;
  position: relative;
}
.featured-quote::before {
  content: '\201C';
  font-size: 3rem;
  color: var(--brand);
  opacity: 0.3;
  position: absolute;
  top: -0.25rem;
  left: 0.5rem;
  font-family: Georgia, serif;
}
.featured-quote p { margin: 0 0 1rem; font-size: 1.3rem; line-height: 1.5; }
.featured-quote cite { color: var(--muted); font-style: normal; font-size: 0.9rem; }

/* ── Callout Boxes ── */
.callout {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 12px;
  margin: 2rem 0;
  border-left: 4px solid;
}
.callout-insight { background: rgba(59, 130, 246, 0.05); border-left-color: #3b82f6; }
.callout-warning { background: rgba(245, 158, 11, 0.05); border-left-color: #f59e0b; }
.callout-success { background: rgba(16, 185, 129, 0.05); border-left-color: #10b981; }
.callout-tip     { background: rgba(147, 149, 242, 0.05); border-left-color: var(--brand); }
.callout-icon { font-size: 1.5rem; flex-shrink: 0; }
.callout-content h3 { margin: 0 0 0.5rem; font-size: 1.1rem; font-weight: 600; }
.callout-content p { margin: 0; }

/* ── Key Takeaways ── */
.key-takeaways {
  background: linear-gradient(135deg, rgba(147, 149, 242, 0.08), rgba(6, 182, 212, 0.08));
  border: 1px solid var(--brand);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin: 0 0 2.5rem;
}
.key-takeaways h3 { margin: 0 0 1rem; font-size: 1.1rem; color: var(--brand); font-weight: 600; }
.key-takeaways ul { margin: 0; padding-left: 1.5rem; }
.key-takeaways li { margin-bottom: 0.5rem; color: var(--text); }

/* ── Stat Highlight ── */
.stat-highlight {
  text-align: center;
  padding: 2rem;
  margin: 2.5rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.stat-number {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.stat-label {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ── FAQ Accordion ── */
.faq-section { margin: 2.5rem 0; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-item summary {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.25rem; color: var(--brand); transition: transform 0.2s; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item[open] summary { background: rgba(147, 149, 242, 0.05); }
.faq-answer { padding: 0 1.5rem 1.25rem; }
.faq-answer p { margin: 0.75rem 0 0; }

/* ── Comparison Table ── */
.comparison-table {
  margin: 2rem 0;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.comparison-table table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.comparison-table th {
  background: var(--surface);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}
.comparison-table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); }
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:hover td { background: rgba(147, 149, 242, 0.03); }

/* ── Sources Block ── */
.sources-block {
  margin: 3rem 0 0;
  padding: 1.5rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
}
.sources-block h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sources-block ul { margin: 0; padding-left: 1.25rem; }
.sources-block li { margin-bottom: 0.5rem; }
.sources-block a { color: var(--brand); }

/* ── Code Blocks ── */
.code-block {
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #2a2a2a;
  border-bottom: 1px solid #3a3a3a;
}
.code-title { color: #e5e5e5; font-size: 14px; font-weight: 500; }
.copy-code {
  padding: 4px 12px;
  background: #1e293b;
  color: #fff;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
  font-weight: 600;
  outline: none;
}
.copy-code:hover, .copy-code:focus { background: #3b82f6; color: #fff; }
.code-block pre { margin: 0; padding: 1.5rem; overflow-x: auto; }
.code-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  color: #e5e5e5;
  line-height: 1.6;
}

/* ── Inline Images ── */
.inline-image { margin: 2.5rem 0; border-radius: 12px; overflow: hidden; }
.inline-image img { width: 100%; height: auto; display: block; }
.inline-image figcaption {
  padding: 1rem;
  background: var(--surface-alt);
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}

/* ── Enhanced Lists ── */
.enhanced-list { list-style: none; padding-left: 0; }
.enhanced-list li { margin-bottom: 1rem; padding-left: 1.5rem; position: relative; }
.enhanced-list li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: bold;
}

/* ── Article Footer ── */
.article-footer {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 2px solid var(--border);
}

/* Tags */
.article-tags { margin-bottom: 3rem; }
.article-tags h3 { margin: 0 0 1rem; font-size: 1.25rem; }
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tags-list .tag {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
}
.tags-list .tag:hover { opacity: 0.85; }

/* Author bio */
.author-bio { display: flex; gap: 2rem; padding: 2rem; align-items: flex-start; }
.author-image { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-details h3 {
  margin: 0 0 0.25rem;
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.author-details h4 { margin: 0 0 0.75rem; font-size: 1.25rem; }
.author-details p { color: var(--muted); margin: 0 0 1rem; line-height: 1.5; }
.author-links { display: flex; gap: 1rem; }
.author-links a { color: var(--brand); text-decoration: none; font-weight: 500; font-size: 14px; }
.author-links a:hover { text-decoration: underline; }

/* Related articles */
.related-articles { margin-bottom: 3rem; }
.related-articles h3 { margin: 0 0 2rem; font-size: 1.5rem; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}
.related-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); }
.related-link { display: block; text-decoration: none; color: inherit; }
.related-card img { width: 100%; height: 160px; object-fit: cover; }
.related-content { padding: 1.5rem; }
.related-content h4 { margin: 0 0 0.5rem; font-size: 1.1rem; line-height: 1.3; }
.related-content p { margin: 0 0 1rem; color: var(--muted); font-size: 14px; }
.related-date { font-size: 12px; color: var(--muted); }

/* Article navigation (prev/next) */
.article-navigation { display: flex; gap: 2rem; margin-top: 2rem; }
.nav-link {
  flex: 1;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s;
}
.nav-link:hover { border-color: var(--brand); transform: translateY(-2px); }
.nav-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-title { font-weight: 600; color: var(--text); }
.next-article { text-align: right; }

/* Case studies (used in showcase) */
.case-study {
  margin: 2rem 0;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.case-study-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.case-study-header h3 { margin: 0; flex: 1; }
.case-study-metrics { display: flex; gap: 1rem; flex-shrink: 0; }
.metric {
  background: var(--brand);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.case-study-content p { margin-bottom: 1rem; }

/* Architecture diagram grid */
.architecture-diagram {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.arch-component {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.arch-component h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.arch-component p { margin: 0; font-size: 14px; color: var(--muted); }

/* Implementation timeline */
.implementation-timeline { margin: 2rem 0; }
.timeline-step { display: flex; gap: 1.5rem; margin-bottom: 2rem; align-items: flex-start; }
.step-number {
  width: 40px;
  height: 40px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}
.step-content h4 { margin: 0 0 0.5rem; }
.step-content p { margin: 0; color: var(--muted); }

/* Trend cards */
.trend-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.trend-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.trend-card h4 { margin: 0 0 1rem; }
.trend-card p { margin: 0; color: var(--muted); }

/* Metrics grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}
.metric-category h4 { margin: 0 0 1rem; color: var(--text); }
.metric-category ul { list-style: none; padding: 0; margin: 0; }
.metric-category li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.metric-category li:last-child { border-bottom: none; }

/* Agent type cards (used in showcase) */
.agent-type { padding: 2rem; }
.agent-type h4 { margin: 0 0 1rem; color: var(--text); }
.agent-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; }
.tag {
  display: inline-block;
  background: var(--surface-alt);
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid var(--border);
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 90;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .blog-article { padding: 0 1rem; }
  .article-meta { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .article-actions { width: 100%; }
  .author-bio { flex-direction: column; text-align: center; }
  .comparison-table { font-size: 0.85rem; }
  .case-study-header { flex-direction: column; align-items: flex-start; }
  .case-study-metrics { width: 100%; justify-content: space-between; }
  .article-navigation { flex-direction: column; gap: 1rem; }
  .next-article { text-align: left; }
  .architecture-diagram { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .trend-cards { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
}
