/* ============================================
   BLOG ARTICLE STYLES — ABHINAV PUROHIT
   Focused on long-form reading, rich typography,
   clean system design diagrams, and subtle animations
   ============================================ */

/* ---- Reading Progress Bar ---- */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #7c5cfc, #38bdf8);
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* ---- Article Top Nav ---- */
.article-nav {
  padding: 1.5rem 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #f1f0fb;
  margin-bottom: 2.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  text-decoration: none;
}

.back-link:hover {
  color: #1a1a2e;
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transform: translateX(-2px);
}

.article-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #475569;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.share-pill-btn:hover {
  color: #7c5cfc;
  border-color: #cbd5e1;
  background: #faf5ff;
}

/* ---- Article Header ---- */
.article-header {
  margin-bottom: 2.5rem;
}

.article-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7c5cfc;
  background: #f3f0ff;
  border: 1px solid #e9d5ff;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
}

.article-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.25;
  color: #1a1a2e;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

.article-subtitle {
  font-size: 1.2rem;
  color: #64748b;
  line-height: 1.6;
  font-weight: 400;
  margin-bottom: 1.75rem;
}

.article-meta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.article-author-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.article-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.article-author-details {
  display: flex;
  flex-direction: column;
}

.article-author-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a2e;
}

.article-meta-sub {
  font-size: 0.825rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.article-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.825rem;
  font-weight: 500;
  color: #475569;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.article-source-badge:hover {
  color: #1a1a2e;
  border-color: #94a3b8;
  background: #f1f5f9;
}

/* ---- Article Content Typography ---- */
.article-content {
  font-size: 1.1rem;
  line-height: 1.85;
  color: #334155;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content h2 {
  font-size: 1.65rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-top: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.015em;
  position: relative;
  display: inline-block;
}

.article-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-lead {
  font-size: 1.25rem;
  line-height: 1.75;
  color: #1e293b;
  font-weight: 400;
  padding-left: 1.25rem;
  border-left: 3px solid #7c5cfc;
  margin: 1.75rem 0 2rem;
  background: linear-gradient(90deg, rgba(124, 92, 252, 0.04) 0%, transparent 100%);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-radius: 0 8px 8px 0;
}

/* ---- Architecture Diagram Showcase ---- */
.diagram-figure {
  margin: 2.5rem 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #334155;
  background: #0f1117;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  position: relative;
}

.diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #181d28;
  border-bottom: 1px solid #283144;
}

.diagram-dots {
  display: flex;
  gap: 6px;
}

.diagram-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.diagram-dot.red { background: #ef4444; }
.diagram-dot.yellow { background: #f59e0b; }
.diagram-dot.green { background: #10b981; }

.diagram-title {
  font-size: 0.8rem;
  font-family: monospace;
  color: #94a3b8;
}

.diagram-zoom-btn {
  background: transparent;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}

.diagram-zoom-btn:hover {
  background: #283144;
  color: #ffffff;
}

.diagram-img-wrap {
  cursor: zoom-in;
  padding: 1.5rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0b0d13;
}

.diagram-img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  transition: transform 0.25s ease;
}

.diagram-caption {
  padding: 0.75rem 1.25rem;
  background: #141822;
  border-top: 1px solid #283144;
  font-size: 0.85rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---- Flow Timeline / Stages Interactive Visual ---- */
.flow-container {
  margin: 2.25rem 0;
  padding: 1.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.flow-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.flow-step {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e8e8f0;
  text-align: center;
  position: relative;
}

.flow-step-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: #7c5cfc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.flow-step-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a1a2e;
}

.flow-step-desc {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* ---- Callout / Highlight Boxes ---- */
.callout-box {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #7c5cfc;
}

.callout-box.info {
  border-left-color: #38bdf8;
  background: #f0f9ff;
  border-color: #bae6fd;
}

.callout-box.warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
  border-color: #fde68a;
}

.callout-box.success {
  border-left-color: #10b981;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.callout-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.callout-body {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #475569;
}

/* ---- Code Snippet Card ---- */
.code-block {
  margin: 1.75rem 0;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1e293b;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: #1e293b;
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: monospace;
}

.code-block pre {
  margin: 0;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #f8fafc;
}

/* ---- Article Footer & Author Bio ---- */
.article-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #e2e8f0;
}

.author-bio-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  margin-bottom: 2.5rem;
}

.bio-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.bio-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 0.35rem;
}

.bio-desc {
  font-size: 0.925rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.bio-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bio-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #7c5cfc;
  text-decoration: none;
}

.bio-link:hover {
  text-decoration: underline;
}

/* ---- Toast Notification ---- */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1a1a2e;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Image Lightbox Modal ---- */
.lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.lightbox-close-btn {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* ---- Responsive Adjustments ---- */
@media (max-width: 768px) {
  .flow-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-title {
    font-size: 1.85rem;
  }

  .author-bio-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .bio-links {
    justify-content: center;
  }

  .article-meta-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .flow-steps {
    grid-template-columns: 1fr;
  }

  .article-title {
    font-size: 1.6rem;
  }

  .article-content {
    font-size: 1.025rem;
  }
}
