/* ============================== */
/* BLOG & ARTICLE STYLES
/* ============================== */

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #7c3aed);
  width: 0%;
  z-index: 1001;
  transition: width 0.1s ease-out;
}

/* Breadcrumbs */
.breadcrumb-nav {
  padding: 16px 0 0;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.breadcrumb-list a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.breadcrumb-list a:hover {
  color: var(--accent);
}

.breadcrumb-separator {
  color: var(--border-hover);
  user-select: none;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

/* Hero Section for Blog Directory */
.blog-hero {
  padding: 48px 0 32px;
  text-align: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.blog-hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 24px;
}

/* Search & Filter Bar */
.blog-controls {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blog-search-wrap {
  position: relative;
  width: 100%;
}

.blog-search-input {
  width: 100%;
  padding: 12px 18px 12px 42px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.98rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.blog-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.blog-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.category-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.category-chip:hover,
.category-chip.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Featured Article Card */
.featured-section {
  padding: 40px 0 20px;
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.featured-card h2 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.3;
}

.featured-card h2 a {
  color: var(--text);
  transition: color var(--transition);
}

.featured-card h2 a:hover {
  color: var(--accent);
}

.featured-card p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.read-more-link {
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition);
}

.read-more-link:hover {
  gap: 8px;
}

/* Articles Grid */
.blog-grid-section {
  padding: 24px 0 60px;
}

.section-heading-row {
  margin-bottom: 24px;
}

.section-heading-row h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.article-category {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--accent);
  margin-bottom: 12px;
  align-self: flex-start;
}

.article-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin-bottom: 10px;
}

.article-card h3 a {
  color: var(--text);
  transition: color var(--transition);
}

.article-card h3 a:hover {
  color: var(--accent);
}

.article-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* No results state */
.no-results {
  display: none;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}

.no-results p {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

/* ============================== */
/* ARTICLE PAGE DETAIL STYLES
/* ============================== */
.article-header {
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.article-header .container {
  max-width: 860px;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 16px 0;
  color: var(--text);
}

.article-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.article-header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Article Content Layout */
.article-body-wrapper {
  padding: 48px 0 64px;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 820px;
  margin: 0 auto;
}

.article-content {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.article-content h2 {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article-content h3 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 12px;
}

.article-content p {
  margin-bottom: 20px;
}

.article-content strong {
  color: var(--text);
}

.article-content ul,
.article-content ol {
  margin: 16px 0 24px 24px;
}

.article-content li {
  margin-bottom: 8px;
}

/* Table of Contents */
.article-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0 36px;
}

.toc-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-list {
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
}

.toc-list li {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.toc-list a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.toc-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Callout Boxes */
.callout {
  padding: 20px 24px;
  border-radius: var(--radius);
  margin: 28px 0;
  border-left: 4px solid;
}

.callout-info {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--text);
}

.callout-tip {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: var(--text);
}

.callout-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  color: var(--text);
}

.callout-title {
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Comparison Table */
.table-wrapper {
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}

.comparison-table th {
  background: var(--bg-secondary);
  color: var(--text);
  font-weight: 700;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.comparison-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

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

.comparison-table tr:hover {
  background: var(--bg-secondary);
}

/* Copyable Template Box */
.template-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 24px 0;
  overflow: hidden;
}

.template-header {
  background: var(--bg-secondary);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text);
  transition: all var(--transition);
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.template-body {
  padding: 16px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text-secondary);
}

/* Conversion CTA Card inside Article */
.article-tool-cta {
  background: linear-gradient(135deg, var(--accent-light), var(--bg-card));
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin: 40px 0;
  box-shadow: var(--shadow);
}

.article-tool-cta h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.article-tool-cta p {
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 20px;
  font-size: 1.02rem;
}

.cta-btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #ffffff !important;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  transition: background var(--transition), transform var(--transition);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.cta-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.cta-badge-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Share Bar */
.article-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 40px 0;
}

.share-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.share-buttons {
  display: flex;
  gap: 10px;
}

.share-btn {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Related Articles */
.related-articles {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.related-articles h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .blog-hero h1 {
    font-size: 2rem;
  }

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

  .featured-card {
    padding: 24px 20px;
  }

  .featured-card h2 {
    font-size: 1.45rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .article-tool-cta {
    padding: 24px 16px;
  }

  .cta-badge-list {
    flex-direction: column;
    gap: 6px;
  }
}
