/* ============================================
   AVELLE SOLUTIONS — BLOG STYLES
   Extends main design system (styles.css)
   Optimized for reading — no Spline 3D
   ============================================ */

/* --- Blog Hero (Lightweight) --- */
.blog-hero {
  padding: 140px 0 var(--space-12);
  background: radial-gradient(ellipse at 50% 0%, rgba(107, 63, 160, 0.06) 0%, transparent 60%),
    var(--bg-deep);
  text-align: center;
}

.blog-hero .section-label {
  margin-bottom: var(--space-4);
}

.blog-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  max-width: 820px;
  margin: 0 auto var(--space-6);
  letter-spacing: -1.5px;
}

.blog-hero .hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.blog-hero .hero-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.blog-hero .hero-meta .author-link {
  color: var(--primary);
  font-weight: 600;
}

/* --- Breadcrumb --- */
.breadcrumb {
  padding: var(--space-4) 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.breadcrumb .separator {
  margin: 0 var(--space-2);
  opacity: 0.5;
}

/* --- Article Layout --- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr min(720px, 100%) 1fr;
  padding: var(--space-12) var(--space-6);
}

.article-layout > * {
  grid-column: 2;
}

.article-content {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-body);
}

/* --- Article Typography --- */
.article-content h2 {
  font-size: 1.65rem;
  margin: var(--space-12) 0 var(--space-5);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  letter-spacing: -0.5px;
}

.article-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.article-content h3 {
  font-size: 1.25rem;
  margin: var(--space-8) 0 var(--space-4);
  letter-spacing: -0.3px;
}

.article-content p {
  margin-bottom: var(--space-5);
}

.article-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

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

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

/* Lists */
.article-content ul,
.article-content ol {
  margin-bottom: var(--space-5);
  padding-left: var(--space-6);
}

.article-content ul {
  list-style: none;
}

.article-content ul li {
  position: relative;
  padding-left: var(--space-5);
  margin-bottom: var(--space-3);
  line-height: 1.7;
}

.article-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.article-content ol {
  list-style: none;
  counter-reset: ol-counter;
}

.article-content ol li {
  counter-increment: ol-counter;
  position: relative;
  padding-left: var(--space-8);
  margin-bottom: var(--space-3);
}

.article-content ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
}

/* --- TL;DR Box --- */
.tldr-box {
  background: rgba(107, 63, 160, 0.05);
  border: 1px solid rgba(107, 63, 160, 0.15);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
}

.tldr-box strong {
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: var(--space-2);
}

/* --- Blockquote --- */
.article-content blockquote {
  border-left: 3px solid var(--primary);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-6) 0;
  background: rgba(107, 63, 160, 0.03);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-body);
  font-style: italic;
}

.article-content blockquote cite {
  display: block;
  margin-top: var(--space-3);
  font-style: normal;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* --- Comparison / Data Tables --- */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0 var(--space-8);
  font-size: 0.92rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-content thead {
  background: var(--bg-surface);
}

.article-content th {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--primary);
}

.article-content td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}

.article-content tbody tr:hover {
  background: rgba(107, 63, 160, 0.03);
}

/* --- Expert Quote --- */
.expert-quote {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin: var(--space-8) 0;
  text-align: center;
  position: relative;
}

.expert-quote::before {
  content: '"';
  font-family: Georgia, serif;
  font-size: 5rem;
  color: var(--primary);
  opacity: 0.15;
  position: absolute;
  top: -10px;
  left: var(--space-6);
  line-height: 1;
}

.expert-quote p {
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.8;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.expert-quote cite {
  font-style: normal;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
}

/* --- Time Saved Badge --- */
.time-saved {
  display: inline-block;
  background: rgba(107, 63, 160, 0.08);
  border: 1px solid rgba(107, 63, 160, 0.2);
  border-radius: var(--radius-sm, 6px);
  padding: var(--space-2, 8px) var(--space-4, 16px);
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: var(--space-4);
}

/* --- FAQ Section (Article) --- */
.article-faq {
  margin: var(--space-12) 0;
}

.article-faq h2 {
  border-top: 1px solid var(--border);
  padding-top: var(--space-6);
}

/* --- Author Box --- */
.author-box {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin: var(--space-12) 0;
}

.author-box img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--primary);
}

.author-box-info h4 {
  font-size: 1rem;
  margin-bottom: var(--space-1);
}

.author-box-info .author-role {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: var(--space-2);
}

.author-box-info p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-body);
  margin: 0;
}

.author-box-info a {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
}

/* --- Article CTA Banner --- */
.article-cta {
  background: radial-gradient(ellipse at center, rgba(107, 63, 160, 0.07) 0%, transparent 70%),
    var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-8);
  text-align: center;
  margin: var(--space-12) 0;
}

.article-cta h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
}

.article-cta p {
  margin-bottom: var(--space-6);
  font-size: 1rem;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.article-cta .btn-primary {
  color: #FFFFFF !important;
  text-decoration: none;
}

/* --- Blog Hero Image --- */
.blog-hero-image {
  width: 100%;
  max-width: 900px;
  margin: 0 auto var(--space-10);
  display: block;
}

.blog-hero-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(107, 63, 160, 0.15);
  display: block;
  animation: imageReveal 0.8s ease forwards;
}

@keyframes imageReveal {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Mid-Article Figure --- */
.article-figure {
  margin: var(--space-10) calc(-1 * var(--space-4));
  text-align: center;
}

.article-figure img {
  width: 100%;
  max-width: 820px;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(107, 63, 160, 0.12);
  display: block;
  margin: 0 auto;
}

.article-figure figcaption {
  margin-top: var(--space-3);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 768px) {
  .blog-hero-image img {
    border-radius: 10px;
  }
  .article-figure {
    margin-left: 0;
    margin-right: 0;
  }
  .article-figure img {
    border-radius: 10px;
  }
}

/* --- Related Articles --- */
.related-articles {
  margin: var(--space-12) 0 0;
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.related-articles h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-6);
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-decoration: none;
  transition: all var(--transition-med);
}

.related-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.related-card h4 {
  font-size: 0.95rem;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.related-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Blog Index Page --- */
.blog-index-hero {
  padding: 140px 0 var(--space-12);
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(107, 63, 160, 0.06) 0%, transparent 60%),
    var(--bg-deep);
}

.blog-index-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: var(--space-4);
  letter-spacing: -1.5px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  padding: var(--space-12) 0;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: all var(--transition-med);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--primary-glow);
}

.article-card-body {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card .card-category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: var(--space-3);
}

.article-card h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  line-height: 1.35;
}

.article-card p {
  font-size: 0.88rem;
  color: var(--text-body);
  line-height: 1.6;
  flex: 1;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
  .article-layout {
    grid-template-columns: 1fr;
    padding: var(--space-8) var(--space-5);
  }

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

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

  .blog-hero h1 {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
  }

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