/* ============================================================
   The Ideal Code — Blog Styles
   ============================================================ */

/* --- Gradient text --- */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 40%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Section divider --- */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168,85,247,0.15), rgba(34,211,238,0.1), transparent);
  border: none;
}

/* ============================================================
   Reading Progress Bar
   ============================================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  z-index: 200;
  transition: width 0.1s linear;
}

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px 0;
}
.breadcrumb a {
  color: var(--text-secondary);
  transition: color 0.2s;
}
.breadcrumb a:hover {
  color: var(--accent-hover);
}
.breadcrumb svg {
  flex-shrink: 0;
  opacity: 0.4;
}

/* ============================================================
   Blog Hero (Landing Page)
   ============================================================ */
.blog-hero {
  text-align: center;
  padding: 100px 24px 60px;
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(168,85,247,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.blog-hero .container {
  position: relative;
  z-index: 1;
}
.blog-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.blog-hero p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================================
   Category Filter Pills
   ============================================================ */
.category-filters {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 24px 48px;
}
.filter-pill {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}
.filter-pill.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   Blog Cards Grid
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
.blog-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  border-color: rgba(168,85,247,0.25);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.blog-card-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
}
.blog-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(3,3,10,0.6) 100%);
}
.blog-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-hover);
  margin-bottom: 10px;
}
.blog-card-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.blog-card-title a {
  transition: color 0.2s;
}
.blog-card-title a:hover {
  color: var(--accent-hover);
}
.blog-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.blog-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   Newsletter Section
   ============================================================ */
.newsletter-section {
  max-width: 640px;
  margin: 80px auto 0;
  padding: 48px;
  text-align: center;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}
.newsletter-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(168,85,247,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.newsletter-section h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
}
.newsletter-section p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  position: relative;
}
.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}
.newsletter-form .input {
  flex: 1;
}

/* ============================================================
   Article Layout
   ============================================================ */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  align-items: start;
}

/* Article Header */
.article-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px 40px;
  text-align: center;
}
.article-header .blog-card-category {
  margin-bottom: 16px;
}
.article-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}
.article-header .article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.article-header .article-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Quick Answer Box */
.quick-answer {
  max-width: 720px;
  margin: 0 auto 32px;
  padding: 24px 28px;
  background: rgba(168,85,247,0.06);
  border: 1px solid rgba(168,85,247,0.2);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.quick-answer-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-hover);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.quick-answer p {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.65;
  margin: 0;
}

/* Article Content */
.article-content {
  max-width: 720px;
}
.article-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 48px 0 16px;
  letter-spacing: -0.01em;
  scroll-margin-top: 80px;
}
.article-content h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 32px 0 12px;
}
.article-content p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 20px;
}
.article-content ul, .article-content ol {
  margin: 0 0 20px 24px;
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 16px;
}
.article-content li {
  margin-bottom: 8px;
}
.article-content strong {
  color: var(--text-primary);
  font-weight: 600;
}
.article-content a {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(168,85,247,0.3);
  transition: text-decoration-color 0.2s;
}
.article-content a:hover {
  text-decoration-color: var(--accent-hover);
}

/* Callout / Tip Box */
.callout {
  padding: 20px 24px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.7;
}
.callout.tip {
  background: rgba(16,185,129,0.06);
  border-left: 4px solid var(--green);
}
.callout.tip .callout-label { color: var(--green); }
.callout.info {
  background: rgba(34,211,238,0.06);
  border-left: 4px solid var(--cyan);
}
.callout.info .callout-label { color: var(--cyan); }
.callout.warning {
  background: rgba(245,158,11,0.06);
  border-left: 4px solid var(--amber);
}
.callout.warning .callout-label { color: var(--amber); }
.callout-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.callout p {
  font-size: 14px !important;
  margin-bottom: 0 !important;
}

/* Stat Highlight */
.stat-highlight {
  padding: 24px;
  text-align: center;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 24px 0;
}
.stat-highlight .stat-number {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent-hover);
  margin-bottom: 4px;
}
.stat-highlight .stat-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Comparison Table */
.article-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  margin: 24px 0;
}
.article-content th {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 14px 18px;
  text-align: left;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.article-content td {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.article-content tr:last-child td { border-bottom: none; }
.article-content tr:nth-child(even) td {
  background: rgba(255,255,255,0.015);
}

/* Blockquote */
.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  margin: 24px 0;
  background: rgba(168,85,247,0.04);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.article-content blockquote p {
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 0;
}

/* Code blocks */
.article-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-hover);
}
.article-content pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 24px 0;
}
.article-content pre code {
  background: none;
  padding: 0;
  color: var(--text-secondary);
}

/* ============================================================
   Table of Contents (Sticky Sidebar)
   ============================================================ */
.toc-sidebar {
  position: sticky;
  top: 100px;
}
.toc-sidebar h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.toc-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-sidebar li {
  margin-bottom: 4px;
}
.toc-sidebar a {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all 0.2s;
  line-height: 1.4;
}
.toc-sidebar a:hover {
  color: var(--text-secondary);
  border-left-color: var(--border-hover);
}
.toc-sidebar a.active {
  color: var(--accent-hover);
  border-left-color: var(--accent);
  background: rgba(168,85,247,0.06);
}

/* ============================================================
   Share Buttons
   ============================================================ */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 32px 0;
}
.share-buttons span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.2s;
  cursor: pointer;
}
.share-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent-hover);
  background: rgba(168,85,247,0.06);
}

/* ============================================================
   Author Card
   ============================================================ */
.author-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 48px 0 32px;
}
.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.author-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}
.author-info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ============================================================
   FAQ Section
   ============================================================ */
.faq-section {
  margin: 48px 0;
}
.faq-section h2 {
  margin-bottom: 24px !important;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255,255,255,0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
}
.faq-question:hover {
  background: rgba(255,255,255,0.04);
}
.faq-question svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}
.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer {
  padding: 0 20px 16px;
  max-height: 500px;
}
.faq-answer p {
  font-size: 14px !important;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================================
   Related Articles
   ============================================================ */
.related-section {
  margin: 60px 0;
}
.related-section h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s;
}
.related-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.related-card .blog-card-category {
  margin-bottom: 8px;
}
.related-card h4 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}
.related-card h4 a {
  text-decoration: none !important;
}
.related-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: 60px 48px 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto 40px;
}
.footer-brand p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 12px;
  max-width: 280px;
}
.footer-col h5 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--accent-hover); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}
.footer-bottom p { font-size: 12px; color: var(--text-muted); }
.footer-bottom a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
.footer-bottom a:hover { color: var(--accent-hover); }
.footer-legal { display: flex; gap: 20px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    display: none;
  }
}
@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}
@media (max-width: 768px) {
  .blog-hero {
    padding: 80px 16px 40px;
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .article-header {
    padding: 60px 16px 32px;
  }
  .article-header h1 {
    font-size: 26px;
  }
  .newsletter-section {
    margin: 48px 16px 0;
    padding: 32px 24px;
  }
  .newsletter-form {
    flex-direction: column;
  }
  .header-nav { display: none; }
  .author-card {
    flex-direction: column;
    text-align: center;
  }
}
@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .blog-card-image {
    height: 160px;
  }
  .category-filters {
    padding: 0 16px 32px;
  }
}
