/* ==============================
   ARTICLE LAYOUT — Blog Posts
   Alchemic Technology 2026
   ============================== */

/* Article Container */
.article-container {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Article Header ---- */
.article-header {
  padding: 6rem 0 3rem;
  margin-bottom: 3.5rem;
  position: relative;
}

.article-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.article-header h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 1.25rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 680px;
}

.article-header > p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
}

/* Meta bar */
.article-meta {
  display: flex;
  gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.88rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.75rem;
}

.article-meta .tag {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent);
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.article-meta time,
.article-meta span {
  color: var(--text-dim);
}

/* ---- Article Body ---- */
.article-body {
  font-size: 1.1rem;
  line-height: 1.85;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 3.5rem 0 1.25rem;
  color: var(--text);
  letter-spacing: -0.025em;
  position: relative;
  padding-top: 1rem;
}

.article-body h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.article-body p {
  margin-bottom: 1.35rem;
  color: var(--text-muted);
}

.article-body > p:first-child {
  font-size: 1.2rem;
  color: var(--text);
  line-height: 1.75;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.75rem 1.5rem;
  color: var(--text-muted);
}

.article-body li {
  margin-bottom: 0.6rem;
  line-height: 1.7;
}

.article-body li::marker {
  color: var(--accent);
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(16, 185, 129, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.article-body a:hover {
  text-decoration-color: var(--accent);
}

/* Inline code */
.article-body code {
  background: var(--surface-raised);
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  font-size: 0.88em;
  color: var(--accent);
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  border: 1px solid var(--border);
}

/* Code blocks */
.article-body pre {
  background: #0c0c0e;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.7;
  position: relative;
}

.article-body pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.article-body pre code {
  background: none;
  padding: 0;
  border: none;
  color: var(--text);
  font-size: inherit;
}

/* Blockquotes */
.article-body blockquote {
  border-left: 3px solid var(--primary);
  padding: 1.25rem 1.75rem;
  margin: 2.5rem 0;
  background: rgba(79, 70, 229, 0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.article-body blockquote p {
  margin-bottom: 0;
  font-style: italic;
  color: var(--text-muted);
}

/* ---- Comparison Tables (vs post) ---- */
.table-wrap {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table-wrap thead {
  background: var(--surface);
}

.table-wrap th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  border-bottom: 2px solid var(--border-strong);
}

.table-wrap td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

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

.table-wrap tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Verdict box (vs post) */
.verdict-box {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 2rem 2.25rem;
  margin: 2.5rem 0;
  position: relative;
  overflow: hidden;
}

.verdict-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.verdict-box h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text);
}

/* ---- Automation Cards (automations post) ---- */
.automation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  margin: 2.5rem 0;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.automation-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.automation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.automation-card h3 {
  margin-top: 0.5rem;
  color: var(--text);
  font-size: 1.35rem;
}

.automation-card .time-saved {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

/* ---- Step Boxes (setup post) ---- */
.step-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem 2.25rem;
  margin: 2rem 0;
  position: relative;
}

.step-box h4 {
  color: var(--accent);
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

/* ---- Callout Boxes ---- */
.callout {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(16, 185, 129, 0.08));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 2rem 2.25rem;
  margin: 2.5rem 0;
  position: relative;
}

.callout::before {
  content: '💡';
  position: absolute;
  top: -0.75rem;
  left: 1.25rem;
  font-size: 1.25rem;
  background: var(--bg);
  padding: 0 0.5rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---- Guide CTA ---- */
.guide-cta {
  background: linear-gradient(135deg, var(--primary), #1e1b4b);
  border-radius: var(--radius-lg);
  padding: 3.5rem 3rem;
  margin: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.guide-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.guide-cta h3 {
  font-size: 1.85rem;
  margin-bottom: 1rem;
  color: white;
  position: relative;
}

.guide-cta p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 520px;
  margin-inline: auto;
  position: relative;
}

.guide-cta .btn {
  background: white;
  color: #1e1b4b;
  padding: 1rem 2.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: all 0.25s ease;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.guide-cta .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ---- Back Link ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  margin: 3.5rem 0;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.back-link:hover {
  color: var(--text);
  gap: 0.75rem;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 768px) {
  .article-header {
    padding: 4rem 0 2rem;
    margin-bottom: 2.5rem;
  }

  .article-header h1 {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
  }

  .article-body {
    font-size: 1.05rem;
  }

  .article-body h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
  }

  .article-body pre {
    padding: 1rem 1.25rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
  }

  .table-wrap {
    font-size: 0.85rem;
  }

  .table-wrap th,
  .table-wrap td {
    padding: 0.7rem 0.9rem;
  }

  .automation-card {
    padding: 1.5rem;
  }

  .guide-cta {
    padding: 2.5rem 1.75rem;
  }

  .guide-cta h3 {
    font-size: 1.5rem;
  }

  .callout {
    padding: 1.5rem;
  }

  .verdict-box {
    padding: 1.5rem 1.75rem;
  }

  .step-box {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .article-container {
    padding: 0 1rem;
  }

  .article-meta {
    gap: 0.5rem;
  }

  .article-body h2::before {
    width: 30px;
  }
}

/* ---- Reading Progress Bar ---- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 200;
  transition: width 0.1s linear;
}

/* ---- Mobile Nav ---- */
@media (max-width: 768px) {
  header .container {
    flex-wrap: wrap;
  }

  header nav {
    gap: 1rem;
    font-size: 0.82rem;
  }

  header nav a[style*="background"] {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.82rem !important;
  }
}

@media (max-width: 480px) {
  header nav {
    gap: 0.6rem;
    font-size: 0.78rem;
  }
}

/* ---- Enhanced Article Typography ---- */

/* Lead paragraph — larger and brighter */
.article-body > p:first-child {
  font-size: 1.25rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

/* Pull quote style for emphasis */
.article-body > blockquote.pullquote {
  border-left: none;
  text-align: center;
  font-size: 1.4rem;
  padding: 2.5rem 2rem;
  background: transparent;
  color: var(--text);
  position: relative;
}

.article-body > blockquote.pullquote::before {
  content: '\201C';
  font-size: 4rem;
  color: var(--primary);
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.4;
}

/* Smoother transitions for internal links */
.article-body h2 {
  scroll-margin-top: 100px;
}

/* Numbered list enhancement */
.article-body ol {
  counter-reset: list-counter;
  list-style: none;
  padding-left: 0;
}

.article-body ol > li {
  counter-increment: list-counter;
  padding-left: 2.5rem;
  position: relative;
}

.article-body ol > li::before {
  content: counter(list-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: rgba(79, 70, 229, 0.15);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Horizontal rule between major sections */
.article-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: 3.5rem 0;
}

/* Image within articles */
.article-body img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 2rem 0;
}

/* ---- "Related Posts" at end (optional enhancement) ---- */
.related-posts {
  margin: 3rem 0;
  padding: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.related-posts h3 {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.related-posts a {
  display: block;
  padding: 0.75rem 0;
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}

.related-posts a:last-child {
  border-bottom: none;
}

.related-posts a:hover {
  color: var(--accent);
}

.related-posts a span {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.88rem;
  display: block;
  margin-top: 0.25rem;
}
