/* css/article.css */

.article-body {
  color: #e2e8f0;
  line-height: 1.75;
  font-size: 1.25rem;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: 0.02em;
  max-width: 75ch;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

body {
  background: #0a0e17 !important;
}

/* === HEADINGS === */
.article-body h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: white;
  background: linear-gradient(to right, #a5b4fc, #e879f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
  position: relative;
}

.article-body h2::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #a5b4fc, #e879f9, transparent);
  margin-top: 0.5rem;
  opacity: 0.2;
  border-radius: 2px;
}

.article-body h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: #e2e8f0;
  display: block;
  position: relative;
}

.article-body h3::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, #818cf8, transparent);
  margin-top: 0.5rem;
  opacity: 0.1;
}

/* === PARAGRAPHS & LISTS === */
.article-body p {
  margin-bottom: 1.75rem;
  text-align: justify;
  hyphens: auto;
}

.article-body ul,
.article-body ol {
  margin: 1.75rem 0;
  padding-left: 2rem;
  color: #cbd5e1;
}

.article-body li {
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.article-body li::marker {
  color: #6366f1;
  font-weight: bold;
}

/* === BLOCKQUOTE (Standard) === */
.article-body blockquote:not(.twitter-tweet) {
  border-left: 3px solid transparent;  /* Reserves space; color doesn't matter */
  border-image: linear-gradient(to bottom, #a5b4fc, #d8b4fe) 1;  /* Gradient direction: top to bottom for vertical border */
  border-image-slice: 1;
  background: rgba(30, 41, 59, 0.4);
  padding: .6rem .6rem;
  margin: .3rem 0;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #f1f5f9;
  font-size: 1.15rem;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.15);
}

/* === LINKS === */
.article-body a {
  color: #a8b4ff;
  text-decoration: underline;
  text-decoration-color: rgba(168, 180, 255, 0.5);
  text-underline-offset: 4px;
  transition: all 0.2s ease;
}

.article-body a:hover {
  color: #e879f9;
  text-decoration-color: #e879f9;
}

/* === IMAGES === */
.article-body img {
  border-radius: 16px;
  margin: 3rem auto;
  display: block;
  max-width: 100%;
  height: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  border: 1px solid rgba(129, 140, 248, 0.15);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  cursor: zoom-in;
}

.article-body img:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* === INLINE CODE === */
.article-body :not(pre) > code {
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: 8px;
  color: #e2e8f0;
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 0.92em;
}

/* === CODE BLOCKS === */
.article-body pre {
  position: relative;
  margin: 3rem 0;
  padding: 3.5rem 1.5rem 1.5rem;
  border-radius: 16px;
  background: #0f1320;
  border: 1px solid rgba(129, 140, 248, 0.15);
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.3), 0 8px 30px rgba(0,0,0,0.4);
  overflow-x: auto;
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
}

.article-body pre.wrapped {
  overflow-x: hidden;
}

.article-body pre::before {
  content: attr(data-label);
  position: absolute;
  top: 0; left: 0;
  background: rgba(129, 140, 248, 0.25);
  color: #a8b4ff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 1.2rem;
  border-bottom-right-radius: 12px;
  backdrop-filter: blur(4px);
}

.article-body pre code {
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.6;
  background: transparent;
  white-space: pre;
}

.article-body pre.wrapped code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* === CODE TOOLBAR === */
.code-toolbar {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: flex;
  gap: 0.6rem;
  z-index: 10;
}

.code-btn {
  background: rgba(129, 140, 248, 0.18);
  border: 1px solid rgba(129, 140, 248, 0.3);
  color: #94a3b8;
  font-size: 0.7rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 600;
  transition: all 0.2s;
}

.code-btn:hover {
  background: rgba(129, 140, 248, 0.35);
  color: #e2e8f0;
  border-color: #a8b4ff;
}

.code-btn.active { background: rgba(99, 102, 241, 0.3); color: #a8b4ff; border-color: #6366f1; }
.code-btn.copied { background: #10b981; color: white; border-color: #10b981; }

/* === SHARE BAR === */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.6rem 1.1rem;
  border-radius: 99px;
  color: #cbd5e1;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.25s ease;
  backdrop-filter: blur(4px);
}

.share-btn:hover {
  color: white !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.share-btn.x:hover         { background: #000000; border-color: #333; }
.share-btn.linkedin:hover  { background: #0077b5; border-color: #0077b5; }
.share-btn.facebook:hover  { background: #1877f2; border-color: #1877f2; }
.share-btn.copy:hover      { background: #6366f1; border-color: #6366f1; color: white !important; }

/* === SOCIAL EMBEDS (FALLBACK CARD) === */
/* If the script is blocked, this styles the link as a nice dark card */
.article-body .twitter-tweet {
  margin: .3rem auto !important;
  padding: .6rem !important;
  max-width: 550px !important;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(10, 14, 23, 0.9));
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.article-body .twitter-tweet a {
  display: inline-block;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
  background: #000; /* X Black */
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  border: 1px solid #333;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-body .twitter-tweet a:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}