/* ===========================================================
   blog.css — enhancements for /blog/* articles
   Loaded after main.css. Pairs with blog.js.
   =========================================================== */

/* ---- Reading progress bar (top of viewport) ---- */
.blog-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #7237a2 0%, #b061d8 100%);
  z-index: 1000;
  transition: width 0.1s ease-out;
  will-change: width;
}

/* ---- Article header polish ---- */
.article__category {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: #f5efff;
  color: #7237a2;
  border: 1px solid #d8c5f5;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.article__category::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7237a2;
}
.article__title {
  letter-spacing: -0.025em;
}

/* ---- Article meta strip (date + read time) ---- */
.article__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.article__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: #6b7280;
}

/* ---- Lead paragraph with drop cap ---- */
.article__lead {
  position: relative;
  font-size: 1.2rem;
  line-height: 1.6;
  color: #1f2937;
  padding-left: 1rem;
  border-left: 3px solid #7237a2;
  margin-bottom: 2.5rem;
  font-weight: 500;
}

/* ---- H2 with accent rule ---- */
.article__content h2 {
  position: relative;
  padding-top: 0.5rem;
  margin-top: 3rem;
}
.article__content h2::before {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #7237a2 0%, #b061d8 100%);
  border-radius: 2px;
  margin-bottom: 1rem;
}

/* ---- H3 with subtle accent ---- */
.article__content h3 {
  color: #1f2937;
  margin-top: 2rem;
}
.article__content h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 0.85em;
  background: #b061d8;
  vertical-align: -0.1em;
  margin-right: 0.6rem;
  border-radius: 1px;
}

/* ---- Pull quotes ---- */
.article__content blockquote {
  margin: 2.5rem 0;
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, #f8f7fc 0%, #ede5f7 100%);
  border-left: 4px solid #7237a2;
  border-radius: 0 12px 12px 0;
  font-size: 1.15rem;
  line-height: 1.55;
  color: #1f2937;
  font-style: italic;
  position: relative;
}
.article__content blockquote::before {
  content: '"';
  position: absolute;
  top: -0.5rem;
  left: 1.25rem;
  font-size: 3rem;
  font-family: Georgia, serif;
  color: #b061d8;
  opacity: 0.4;
  line-height: 1;
}
.article__content blockquote p {
  margin: 0;
}
.article__content blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #6b7280;
  font-style: normal;
}

/* ---- Inline highlights ---- */
.article__content strong {
  color: #1f2937;
  font-weight: 700;
}
.article__content em {
  color: #4b5563;
}

/* ---- Lists ---- */
.article__content ul,
.article__content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.article__content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  color: #374151;
}
.article__content ul li::marker {
  color: #7237a2;
}

/* ---- Tables (if any) ---- */
.article__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}
.article__content th {
  background: #f5efff;
  color: #4a1f6f;
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-bottom: 2px solid #d8c5f5;
}
.article__content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}
.article__content tr:hover td {
  background: #f8f7fc;
}

/* ---- Code (inline + blocks) ---- */
.article__content code {
  background: #f1f3f5;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.92em;
  color: #4a1f6f;
}
.article__content pre {
  background: #1f2937;
  color: #f3f4f6;
  padding: 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.article__content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* ---- Share strip (top of article, sticky-feeling) ---- */
.blog-share {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  margin: 1.5rem 0 2.5rem;
}
.blog-share__label {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
  margin-right: 0.25rem;
}
.blog-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.blog-share__btn:hover {
  transform: translateY(-2px);
  border-color: #7237a2;
  color: #7237a2;
  background: #f5efff;
}
.blog-share__btn svg { width: 14px; height: 14px; }

/* ---- Author bio (injected at end of article) ---- */
.blog-author {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  align-items: center;
  margin: 3rem 0 0;
  padding: 1.75rem;
  background: linear-gradient(135deg, #f8f7fc 0%, #fff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}
@media (max-width: 600px) {
  .blog-author { grid-template-columns: 1fr; text-align: center; }
}
.blog-author__photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: #f5efff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(74, 31, 111, 0.15);
}
.blog-author__photo img { width: 100%; height: 100%; object-fit: cover; }
.blog-author__body h4 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
  color: #1f2937;
}
.blog-author__body p {
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 0.5rem;
}
.blog-author__link {
  color: #7237a2;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}
.blog-author__link:hover { text-decoration: underline; }

/* ---- Related posts (injected at end) ---- */
.blog-related {
  margin: 3rem 0 0;
}
.blog-related__title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #1f2937;
}
.blog-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.blog-related__card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.blog-related__card:hover {
  transform: translateY(-4px);
  border-color: #b89cd6;
  box-shadow: 0 16px 30px -10px rgba(74, 31, 111, 0.18);
}
.blog-related__cat {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7237a2;
  margin-bottom: 0.5rem;
}
.blog-related__cardtitle {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}
.blog-related__cardmeta {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: auto;
}

/* ---- Footer CTA (injected at end of article) ---- */
.blog-cta {
  margin: 3rem 0 1rem;
  padding: 2.5rem;
  background: linear-gradient(135deg, #7237a2 0%, #4a1f6f 100%);
  border-radius: 14px;
  text-align: center;
  color: #fff;
}
.blog-cta h3 {
  color: #fff;
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
}
.blog-cta p {
  color: #e9d8ff;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
.blog-cta__btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #fff;
  color: #7237a2;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.blog-cta__btn:hover { transform: translateY(-2px); }
