/* ================================================================
   SyntraFlow Blog — Enterprise SaaS Enhancement Layer
   Applied on top of existing blog post structure.
   ================================================================ */

/* ---- 1. Reading progress bar (top of viewport) ---- */
.sf-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 60;
  pointer-events: none;
}
.sf-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--primary) / 0.7));
  transition: width 0.1s linear;
  box-shadow: 0 0 8px hsl(var(--primary) / 0.5);
}

/* ---- 2. Breadcrumb strip ---- */
.sf-breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
  opacity: 0.85;
}
.sf-breadcrumb a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.15s;
}
.sf-breadcrumb a:hover {
  color: hsl(var(--primary));
}
.sf-breadcrumb .separator {
  margin: 0 0.5rem;
  opacity: 0.4;
}
.sf-breadcrumb .current {
  color: hsl(var(--foreground));
  font-weight: 500;
}

/* ---- 3. Article shell (2-column / 3-column responsive) ---- */
.sf-article-shell {
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: 0 1.25rem;
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .sf-article-shell {
    grid-template-columns: 240px minmax(0, 1fr) 80px;
    gap: 3rem;
  }
}

/* ---- 4. Table of Contents (left sidebar, sticky) ---- */
.sf-toc {
  display: none;
}
@media (min-width: 1024px) {
  .sf-toc {
    display: block;
    position: sticky;
    top: 6rem;
    align-self: start;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    font-size: 13px;
  }
}
.sf-toc-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
}
.sf-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid hsl(var(--border));
}
.sf-toc li {
  margin: 0;
}
.sf-toc a {
  display: block;
  padding: 0.45rem 0.75rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: all 0.15s;
  line-height: 1.35;
}
.sf-toc a:hover {
  color: hsl(var(--foreground));
}
.sf-toc a.sf-toc-active {
  color: hsl(var(--primary));
  border-left-color: hsl(var(--primary));
  font-weight: 500;
}
.sf-toc .sf-toc-h3 {
  padding-left: 1.5rem;
  font-size: 12.5px;
}

/* ---- 5. Share sidebar (right column, sticky) ---- */
.sf-share {
  display: none;
}
@media (min-width: 1024px) {
  .sf-share {
    display: block;
    position: sticky;
    top: 6rem;
    align-self: start;
  }
}
.sf-share-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 700;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
  text-align: center;
}
.sf-share-btns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}
.sf-share-btns button,
.sf-share-btns a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.sf-share-btns button:hover,
.sf-share-btns a:hover {
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.4);
  background: hsl(var(--primary) / 0.05);
  transform: translateY(-1px);
}
.sf-share-btns svg {
  width: 16px;
  height: 16px;
}

/* Mobile share — horizontal row inline */
.sf-share-mobile {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: hsl(var(--secondary) / 0.3);
  border-radius: 0.75rem;
  align-items: center;
}
@media (min-width: 1024px) {
  .sf-share-mobile { display: none; }
}
.sf-share-mobile span {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}
.sf-share-mobile .sf-share-row {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}
.sf-share-mobile .sf-share-row a,
.sf-share-mobile .sf-share-row button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  text-decoration: none;
}
.sf-share-mobile .sf-share-row svg { width: 14px; height: 14px; }

/* ---- 6. Enhanced author card (under H1 in hero area) ---- */
.sf-author-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.5rem 0;
  margin: 1rem 0 1.5rem;
}
.sf-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.6));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.sf-author-info {
  flex: 1;
  min-width: 0;
}
.sf-author-name {
  font-weight: 600;
  color: hsl(var(--foreground));
  font-size: 14px;
  line-height: 1.2;
  margin: 0;
}
.sf-author-meta {
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sf-author-meta .dot {
  opacity: 0.4;
}
.sf-author-role {
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  margin-top: 2px;
}
.sf-author-cta {
  display: none;
}
@media (min-width: 640px) {
  .sf-author-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.375rem 0.75rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.15s;
    flex-shrink: 0;
  }
  .sf-author-cta:hover { opacity: 0.9; }
}

/* ---- 7. Key takeaways callout (top of article) ---- */
.sf-takeaways {
  background: linear-gradient(135deg, hsl(var(--primary) / 0.05), hsl(var(--primary) / 0.02));
  border: 1px solid hsl(var(--primary) / 0.15);
  border-left: 4px solid hsl(var(--primary));
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.sf-takeaways-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  color: hsl(var(--primary));
  margin-bottom: 0.5rem;
}
.sf-takeaways-title .icon {
  display: inline-block;
  margin-right: 0.35rem;
}

/* ---- 8. Typography upgrade — override .prose for enterprise feel ---- */
.sf-article-body {
  font-size: 17px;
  line-height: 1.7;
  color: hsl(var(--foreground));
}
.sf-article-body h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: hsl(var(--foreground));
  margin: 2.5rem 0 1rem;
  scroll-margin-top: 6rem;
}
.sf-article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 2rem 0 0.75rem;
  scroll-margin-top: 6rem;
}
.sf-article-body h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}
.sf-article-body p {
  margin: 1rem 0;
}
.sf-article-body ul,
.sf-article-body ol {
  margin: 1.25rem 0;
  padding-left: 1.5rem;
}
.sf-article-body li {
  margin: 0.4rem 0;
}
.sf-article-body a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.sf-article-body a:hover {
  text-decoration-thickness: 2px;
}
.sf-article-body strong { font-weight: 600; color: hsl(var(--foreground)); }
.sf-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 14.5px;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  overflow: hidden;
}
.sf-article-body th {
  background: hsl(var(--muted) / 0.5);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
}
.sf-article-body td {
  padding: 0.75rem 1rem;
  border-top: 1px solid hsl(var(--border));
  vertical-align: top;
}
.sf-article-body tr:hover td { background: hsl(var(--muted) / 0.2); }

/* Pull-quotes */
.sf-article-body blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid hsl(var(--primary));
  background: hsl(var(--muted) / 0.3);
  font-style: italic;
  color: hsl(var(--foreground));
  border-radius: 0 0.5rem 0.5rem 0;
}

/* Inline code */
.sf-article-body code {
  background: hsl(var(--muted));
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* ---- 9. Inline CTA card (embedded mid-article) ---- */
.sf-inline-cta {
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.75));
  border-radius: 1rem;
  padding: 1.75rem;
  margin: 2.5rem 0;
  color: white;
  text-align: center;
}
.sf-inline-cta-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: white;
}
.sf-inline-cta p {
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  margin: 0 0 1rem;
}
.sf-inline-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: white;
  color: hsl(var(--primary));
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.15s;
}
.sf-inline-cta a:hover { transform: translateY(-1px); }

/* ---- 10. Author bio (bottom of article) ---- */
.sf-author-bio {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  margin: 3rem 0 2rem;
  background: hsl(var(--secondary) / 0.3);
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
}
.sf-author-bio .sf-author-avatar { width: 64px; height: 64px; font-size: 20px; }
.sf-author-bio-content { flex: 1; }
.sf-author-bio-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.sf-author-bio-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.25rem;
}
.sf-author-bio-desc {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  line-height: 1.55;
}

/* ---- 11. Newsletter CTA (bottom) ---- */
.sf-newsletter {
  background: hsl(var(--secondary) / 0.5);
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  padding: 1.5rem 1.75rem;
  border-radius: 1rem;
  margin: 1.5rem 0 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.sf-newsletter > div { flex: 1; min-width: 240px; }
.sf-newsletter h3 {
  color: hsl(var(--foreground));
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
}
.sf-newsletter p {
  color: hsl(var(--muted-foreground));
  font-size: 13.5px;
  margin: 0;
  line-height: 1.5;
}
.sf-newsletter-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.55rem 1.1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 13.5px;
  text-decoration: none;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.sf-newsletter-cta:hover { opacity: 0.92; }

/* ---- 12. Related articles grid (bottom) ---- */
.sf-related {
  max-width: 1200px;
  margin: 3rem auto 4rem;
  padding: 0 1.25rem;
}
.sf-related-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin: 0 0 1.25rem;
}
.sf-related-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 640px) { .sf-related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .sf-related-grid { grid-template-columns: repeat(3, 1fr); } }
.sf-related-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.75rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.sf-related-card:hover {
  border-color: hsl(var(--primary) / 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px hsl(var(--primary) / 0.08);
}
.sf-related-img {
  aspect-ratio: 16/9;
  background: hsl(var(--muted));
  overflow: hidden;
}
.sf-related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.sf-related-card:hover .sf-related-img img { transform: scale(1.04); }
.sf-related-body {
  padding: 1rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.sf-related-tag {
  display: inline-block;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-size: 10.5px;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  align-self: start;
}
.sf-related-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0 0 0.5rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sf-related-card p {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  margin: 0 0 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.sf-related-meta {
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
  margin-top: auto;
}

/* ---- 13. Hide old byline (we replace with sf-author-card) ---- */
.sf-article-shell .flex.items-center.gap-4.mb-8.text-sm.text-muted-foreground {
  display: none;
}

/* ---- 14. Print-friendly ---- */
@media print {
  .sf-progress-bar, .sf-toc, .sf-share, .sf-share-mobile,
  .sf-inline-cta, .sf-newsletter, .sf-related { display: none !important; }
}

/* Hide the blue CTA button from the author card — looks too promotional inline */
.sf-author-cta { display: none !important; }

/* Extra guard: mobile share strip should stay hidden on desktop */
@media (min-width: 1024px) { .sf-share-mobile { display: none !important; } }


/* Hide the ORIGINAL byline — sf-author-card replaces it (avoids duplicate author info) */
main .flex.items-center.gap-4.mb-8.text-sm.text-muted-foreground { display: none !important; }
article .flex.items-center.gap-4.mb-8.text-sm.text-muted-foreground { display: none !important; }


/* Breadcrumb removed at user request — site header provides sufficient navigation */
.sf-breadcrumb { display: none !important; }
