/* Hero */
.blog-hero {
  padding: 60px 0;
  text-align: center;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.blog-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.blog-hero h1 span {
  background: linear-gradient(135deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-hero p {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  max-width: 600px;
  margin: 0 auto;
}

/* Ad Banner */
.blog-ad-banner {
  background: var(--muted);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin: 32px auto;
}

.ad-leaderboard {
  width: 100%;
  max-width: 728px;
  height: 90px;
}

.ad-rectangle {
  width: 300px;
  height: 250px;
}

/* Categories Filter */
.categories-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.categories-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.category-label {
  font-weight: 600;
  color: var(--foreground);
}

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.category-tab {
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.category-tab:hover {
  background: var(--border);
}

.category-tab.active {
  background: var(--primary);
  color: white;
}

/* Blog Layout */
.blog-section {
  padding: 48px 0;
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
}

/* Featured Post */
.featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 48px;
  transition: box-shadow 0.3s, transform 0.3s;
}

.featured-post:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.featured-image {
  width: 100%;
  height: 100%;
  min-height: 300px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 4rem;
}

.featured-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-badge {
  display: inline-block;
  padding: 4px 12px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 16px;
  width: fit-content;
}

.featured-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.featured-content h2 a:hover {
  color: var(--primary);
}

.post-excerpt {
  color: var(--muted-foreground);
  margin-bottom: 20px;
  line-height: 1.7;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.post-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
}

.meta-divider {
  width: 4px;
  height: 4px;
  background: var(--border);
  border-radius: 50%;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.blog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.3s, transform 0.3s;
}

.blog-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.card-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5rem;
}

.card-image.green { background: linear-gradient(135deg, #10b981, #34d399); }
.card-image.orange { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.card-image.pink { background: linear-gradient(135deg, #ec4899, #f472b6); }
.card-image.cyan { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.card-image.red { background: linear-gradient(135deg, #ef4444, #f87171); }

.card-content {
  padding: 20px;
}

.card-category {
  display: inline-block;
  padding: 4px 10px;
  background: var(--muted);
  color: var(--primary);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.card-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.card-content h3 a:hover {
  color: var(--primary);
}

.card-excerpt {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.read-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.read-time svg {
  width: 14px;
  height: 14px;
}

/* Sidebar */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.sidebar-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

/* Search */
.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Popular Posts */
.popular-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.popular-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.popular-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.popular-number {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.popular-content h4 {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}

.popular-content h4:hover {
  color: var(--primary);
}

.popular-content span {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Tags */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 12px;
  background: var(--muted);
  color: var(--muted-foreground);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
}

.tag:hover {
  background: var(--primary);
  color: white;
}

/* Newsletter */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.newsletter-form input {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.newsletter-btn {
  padding: 12px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.newsletter-btn:hover {
  background: var(--primary-hover);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.page-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 500;
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-btn.arrow {
  width: auto;
  padding: 0 16px;
}

.page-btn svg {
  width: 16px;
  height: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .ad-sidebar {
    grid-column: span 2;
    justify-self: center;
  }
}

@media (max-width: 768px) {
  .blog-hero h1 { font-size: 2rem; }
  .blog-hero p { font-size: 1rem; }

  .featured-post {
    grid-template-columns: 1fr;
  }

  .featured-image {
    min-height: 200px;
  }

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

  .blog-sidebar {
    grid-template-columns: 1fr;
  }

  .ad-sidebar {
    grid-column: span 1;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }

  .category-tabs {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 8px;
    flex-wrap: nowrap;
  }

  .category-tab {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .pagination {
    flex-wrap: wrap;
  }
}

/*Single blog*/

/* Breadcrumb */
.breadcrumb {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-size: 0.875rem;
}

.breadcrumb-list a {
  color: var(--muted-foreground);
  transition: color 0.2s;
}

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

.breadcrumb-list span {
  color: var(--muted-foreground);
}

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

/* Ad Banner */
.ad-banner {
  background: var(--muted);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin: 32px auto;
}

.ad-leaderboard {
  width: 100%;
  max-width: 728px;
  height: 90px;
}

.ad-rectangle {
  width: 300px;
  height: 250px;
}

/* Article Layout */
.article-section {
  padding: 48px 0;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
}

/* Article Header */
.article-header {
  margin-bottom: 32px;
}

.article-category {
  display: inline-block;
  padding: 6px 14px;
  background: var(--muted);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
}

.author-details h4 {
  font-weight: 600;
  margin-bottom: 2px;
}

.author-details span {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.meta-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.meta-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.meta-stat svg {
  width: 18px;
  height: 18px;
}

/* Featured Image */
.article-featured-image {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: var(--radius);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.article-featured-image svg {
  width: 120px;
  height: 120px;
  opacity: 0.9;
}

/* Article Content */
.article-content {
  font-size: 1.125rem;
  line-height: 1.8;
}

.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 40px 0 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.article-content h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 32px 0 16px;
}

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

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

.article-content li {
  margin-bottom: 12px;
  color: #374151;
}

.article-content blockquote {
  margin: 32px 0;
  padding: 24px 32px;
  background: linear-gradient(135deg, #eef2ff, #f0fdf4);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--foreground);
}

.article-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-content a:hover {
  color: var(--primary-hover);
}

.article-content code {
  background: var(--muted);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Monaco', 'Consolas', monospace;
}

.article-content pre {
  background: var(--foreground);
  color: #e2e8f0;
  padding: 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
}

.article-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Tip Box */
.tip-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
  display: flex;
  gap: 16px;
}

.tip-box svg {
  width: 24px;
  height: 24px;
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 2px;
}

.tip-box-content h4 {
  font-weight: 600;
  color: #92400e;
  margin-bottom: 4px;
}

.tip-box-content p {
  color: #a16207;
  margin: 0;
  font-size: 1rem;
}

/* In-Content Ad */
.in-content-ad {
  margin: 40px 0;
}

/* Tags */
.article-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.article-tags span {
  font-weight: 600;
  margin-right: 8px;
}

.tag {
  padding: 6px 14px;
  background: var(--muted);
  color: var(--muted-foreground);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
}

.tag:hover {
  background: var(--primary);
  color: white;
}

/* Share */
.share-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.share-label {
  font-weight: 600;
}

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

.share-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform 0.2s, opacity 0.2s;
}

.share-btn:hover {
  transform: scale(1.1);
  opacity: 0.9;
}

.share-btn.twitter { background: #1da1f2; }
.share-btn.facebook { background: #1877f2; }
.share-btn.linkedin { background: #0a66c2; }
.share-btn.copy { background: var(--foreground); }

.share-btn svg {
  width: 20px;
  height: 20px;
}

/* Author Box */
.author-box {
  background: var(--muted);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 40px;
  display: flex;
  gap: 24px;
}

.author-box-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.author-box-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.author-box-info .role {
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 12px;
}

.author-box-info p {
  color: var(--muted-foreground);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Related Posts */
.related-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.related-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.related-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.3s, transform 0.3s;
}

.related-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.related-image {
  height: 140px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.related-image.green { background: linear-gradient(135deg, #10b981, #34d399); }
.related-image.orange { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

.related-image svg {
  width: 40px;
  height: 40px;
}

.related-content {
  padding: 20px;
}

.related-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.related-content h3:hover {
  color: var(--primary);
}

.related-meta {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

/* Sidebar */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.sidebar-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

/* Table of Contents */
.toc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toc-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--muted);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: all 0.2s;
}

.toc-link:hover, .toc-link.active {
  background: var(--primary);
  color: white;
}

.toc-number {
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.toc-link:not(.active) .toc-number {
  background: var(--border);
}

/* Popular Posts */
.popular-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.popular-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.popular-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.popular-thumb {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.popular-thumb svg {
  width: 24px;
  height: 24px;
}

.popular-content h4 {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}

.popular-content h4:hover {
  color: var(--primary);
}

.popular-content span {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Newsletter */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.newsletter-form input {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.newsletter-btn {
  padding: 12px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.newsletter-btn:hover {
  background: var(--primary-hover);
}

/* CTA Box */
.cta-box {
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: var(--radius);
  padding: 24px;
  color: white;
  text-align: center;
}

.cta-box h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  border: none;
  padding: 0;
}

.cta-box p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 16px;
}

.cta-btn {
  display: inline-block;
  padding: 12px 24px;
  background: white;
  color: var(--primary);
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s;
}

.cta-btn:hover {
  transform: scale(1.05);
}

/* Responsive */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .cta-box {
    grid-column: span 2;
  }
}
@media (max-width: 768px) {
  .article-title { font-size: 1.75rem; }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .meta-stats {
    margin-left: 0;
  }

  .article-featured-image {
    height: 250px;
  }

  .article-content {
    font-size: 1rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
  }

  .author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

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

  .article-sidebar {
    grid-template-columns: 1fr;
  }

  .cta-box {
    grid-column: span 1;
  }

  .share-section {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}