/* ==========================================================================
   RankCraft — Clean Blog & Article Stylesheet
   ========================================================================== */

/* Blog Hero & Search Header */
.blog-header {
  text-align: center;
  padding: 3.5rem 1rem 2.5rem;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-page) 100%);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.blog-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}
.blog-header p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}
.blog-search-bar {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}
.blog-search-input {
  width: 100%;
  padding: 0.85rem 1.25rem 0.85rem 2.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.9375rem;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.blog-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.blog-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Category Filter Pills */
.category-filter-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0 1.5rem;
  scrollbar-width: none;
  justify-content: center;
  flex-wrap: wrap;
}
.category-filter-nav::-webkit-scrollbar {
  display: none;
}
.category-pill {
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.category-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.category-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Featured Hero Post Card */
.featured-post-card {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.featured-post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.featured-post-img-wrapper {
  position: relative;
  min-height: 280px;
  background: #0f172a;
  overflow: hidden;
}
.featured-post-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.featured-post-card:hover .featured-post-img {
  transform: scale(1.03);
}
.featured-post-body {
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Standard Blog Cards Grid */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.blog-card-thumbnail {
  width: 100%;
  height: 190px;
  background: #0f172a;
  position: relative;
  overflow: hidden;
}
.blog-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.blog-card:hover .blog-card-thumbnail img {
  transform: scale(1.05);
}
.blog-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.blog-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: inline-block;
}
.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  transition: color 0.15s ease;
}
.blog-card:hover .blog-card-title {
  color: var(--primary);
}
.blog-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.author-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  object-fit: cover;
}

/* Article Template Styles */
.article-container {
  max-width: 840px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}
.article-header {
  margin-bottom: 2rem;
}
.article-meta-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.article-featured-img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  border: 1px solid var(--border);
}
.table-of-contents {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}
.toc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toc-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.toc-list li {
  margin-bottom: 0.4rem;
}
.toc-list a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}
.toc-list a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Rich Content Typography */
.article-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-main);
}
.article-content h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--secondary);
  margin: 2.5rem 0 1rem;
  scroll-margin-top: 90px;
}
.article-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 2rem 0 0.75rem;
  scroll-margin-top: 90px;
}
.article-content p {
  margin-bottom: 1.4rem;
}
.article-content ul, .article-content ol {
  margin-bottom: 1.4rem;
  padding-left: 1.5rem;
}
.article-content li {
  margin-bottom: 0.5rem;
}
.article-content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--bg-page);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.75rem 0;
  font-style: italic;
  color: var(--text-main);
}
.article-content code {
  background: var(--bg-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--primary);
}
.article-content pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin: 1.5rem 0;
}
.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Social Share Bar */
.social-share-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 0;
  margin: 2.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.share-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Author Box */
.author-box {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 2.5rem 0;
}
.author-box-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

/* Post Navigation (Prev / Next) */
.post-navigation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2.5rem 0;
}
.post-nav-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
}
.post-nav-card:hover {
  border-color: var(--primary);
}
.post-nav-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.post-nav-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--secondary);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .featured-post-card {
    grid-template-columns: 1fr;
  }
  .blog-header h1 {
    font-size: 1.85rem;
  }
  .post-navigation-grid {
    grid-template-columns: 1fr;
  }
}
