/* ═══════════════════════════════════════════════════════════════
   TESTBYAI — OFFICIAL BLOG & ARTICLE DESIGN SYSTEM (REFINED SCALE)
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-page: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-subtle: #F1F5F9;
  --text-heading: #0F172A;
  --text-body: #334155;
  --text-muted: #64748B;
  --primary: #0F172A;
  --primary-gradient: linear-gradient(135deg, #0F172A 0%, #334155 100%);
  --primary-hover: #000000;
  --primary-light: #F1F5F9;
  --primary-border: #CBD5E1;
  --accent-emerald: #10B981;
  --accent-emerald-light: #ECFDF5;
  --border-color: #E2E8F0;
  --border-subtle: #CBD5E1;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.06);
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background-color: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-body);
  line-height: 1.68;
  font-size: 0.95rem;
  -webkit-font-smoothing: antialiased;
  width: 100%;
}

*, *:before, *:after { box-sizing: inherit; }

a { color: inherit; text-decoration: none; }

/* Conteneur principal */
.container { 
  max-width: 1280px; 
  margin: 0 auto; 
  padding: 0 1.75rem; 
  width: 100%; 
}

/* ── NAVBAR ── */
.navbar {
  position: -webkit-sticky;
  position: sticky; 
  top: 0; 
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.brand-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 800;
  color: var(--text-heading); letter-spacing: -0.4px;
}
.brand-logo .accent { color: #2563EB; }
.btn-nav {
  background: var(--primary-gradient); color: #FFF;
  padding: 0.5rem 1.15rem; border-radius: 99px;
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 700;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.15); transition: transform 0.2s;
  white-space: nowrap;
}
.btn-nav:hover { transform: translateY(-1px); }

/* Language Dropdown */
.lang-dropdown { position: relative; display: inline-block; margin-right: 10px; }
.lang-btn {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  padding: 0.4rem 0.75rem;
  border-radius: 99px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 5px;
  min-width: 160px;
  box-shadow: var(--shadow-md);
  z-index: 500;
}
.lang-menu.open { display: block; }
.lang-item {
  display: flex;
  align-items: center;
  padding: 6px 9px;
  font-size: 0.78rem;
  color: var(--text-body);
  border-radius: 6px;
}
.lang-item:hover { background: var(--bg-surface-subtle); color: var(--text-heading); }
.lang-item.active { font-weight: 700; color: var(--text-heading); background: var(--bg-surface-subtle); }

/* ── HEADER ARTICLE ── */
.article-header-section {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 2.2rem 0 1.8rem;
}
.breadcrumbs {
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem;
}
.breadcrumbs a:hover { color: var(--text-heading); }
.article-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  font-weight: 800; color: var(--text-heading);
  line-height: 1.25; letter-spacing: -0.6px; margin-bottom: 1rem;
  max-width: 980px; word-wrap: break-word; word-break: break-word;
}
.article-meta {
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--text-muted); font-weight: 500;
}
.author-badge { display: flex; align-items: center; gap: 0.45rem; color: var(--text-heading); font-weight: 700; }
.author-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-gradient); color: #FFF; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 800; flex-shrink: 0; }

/* ── LAYOUT PRINCIPAL (3 COLONNES) ── */
.article-layout {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 2.25rem;
  padding: 2.25rem 0 4.5rem;
  align-items: start;
  position: relative;
}

/* SIDEBAR GAUCHE : Sticky Table des matières */
.toc-sidebar { 
  position: -webkit-sticky;
  position: sticky; 
  top: 85px; 
  align-self: start;
  z-index: 10;
}
.toc-title { font-family: var(--font-display); font-size: 0.76rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 0.85rem; }
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.82rem; border-left: 2px solid var(--border-color); padding-left: 0.85rem; margin: 0; }
.toc-list a { color: var(--text-muted); transition: color 0.2s, font-weight 0.2s; display: block; line-height: 1.4; }
.toc-list a:hover, .toc-list a.active { color: var(--text-heading); font-weight: 700; }

/* ARTICLE BODY (COLONNE CENTRALE) */
.article-body {
  background: #FFFFFF; border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: 2.25rem 2.5rem; box-shadow: var(--shadow-sm);
  min-width: 0;
}

.lead-paragraph { font-size: 1.05rem; color: var(--text-heading); font-weight: 500; line-height: 1.7; margin-bottom: 1.5rem; }

/* Typographie */
.article-body h2 { font-family: var(--font-display); font-size: 1.38rem; font-weight: 800; color: var(--text-heading); margin: 2rem 0 0.85rem; letter-spacing: -0.4px; line-height: 1.3; word-wrap: break-word; }
.article-body h3 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; color: var(--text-heading); margin: 1.4rem 0 0.65rem; word-wrap: break-word; }
.article-body p { font-size: 0.94rem; color: var(--text-body); margin-bottom: 1.15rem; line-height: 1.68; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem 1.25rem; color: var(--text-body); }
.article-body li { margin-bottom: 0.45rem; font-size: 0.94rem; line-height: 1.65; }
.article-body strong { color: var(--text-heading); font-weight: 700; }

/* Key Takeaways Box */
.takeaways-box {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--text-heading);
  border-radius: var(--radius-sm);
  padding: 1.25rem; margin: 1.6rem 0;
}
.takeaways-title { font-family: var(--font-display); font-size: 0.92rem; font-weight: 800; color: var(--text-heading); display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.65rem; }

/* Before / After IA Component */
.before-after-card {
  background: #FFFFFF; border: 1px solid var(--border-color); border-radius: var(--radius-md);
  overflow: hidden; margin: 1.85rem 0; box-shadow: var(--shadow-sm);
}
.ba-header { background: var(--text-heading); color: #FFF; padding: 0.75rem 1.1rem; font-family: var(--font-display); font-size: 0.8rem; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; }
.ba-col { padding: 1.1rem; }
.ba-before { background: #FEF2F2; border-right: 1px solid var(--border-color); }
.ba-after { background: var(--accent-emerald-light); }
.ba-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 0.45rem; }
.ba-before .ba-label { color: #DC2626; }
.ba-after .ba-label { color: #047857; }
.ba-text { font-size: 0.86rem; line-height: 1.55; color: var(--text-heading); }

/* Banner CTA Produit Intégré */
.inline-cta-banner {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #FFFFFF; border-radius: var(--radius-md); padding: 1.85rem 1.65rem;
  margin: 2.2rem 0; text-align: center; position: relative; overflow: hidden;
}
.inline-cta-banner h3 { color: #FFFFFF; font-size: 1.25rem; font-weight: 800; font-family: var(--font-display); margin-bottom: 0.45rem; }
.inline-cta-banner p { color: #94A3B8; font-size: 0.88rem; max-width: 480px; margin: 0 auto 1.15rem; }
.btn-inline-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  background: #FFFFFF; color: #0F172A;
  padding: 0.75rem 1.6rem; border-radius: 99px; font-family: var(--font-display);
  font-size: 0.88rem; font-weight: 800; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.btn-inline-cta:hover { transform: translateY(-2px); background: #F8FAFC; }

/* Tables */
.article-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
}
.article-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem; text-align: left; min-width: 440px;
}
.article-table th {
  background: var(--text-heading); color: #FFF;
  padding: 0.75rem 0.9rem; font-family: var(--font-display); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.article-table td {
  padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border-color);
}
.article-table tr:last-child td { border-bottom: none; }
.article-table tr:nth-child(even) { background: var(--bg-surface-subtle); }

/* SIDEBAR DROITE : Sticky Promo Outil */
.product-sidebar { 
  position: -webkit-sticky;
  position: sticky; 
  top: 85px; 
  align-self: start;
  z-index: 10;
}
.sidebar-promo-card {
  background: #FFFFFF; border: 2px solid var(--primary-border);
  border-radius: var(--radius-md); padding: 1.35rem 1.15rem; box-shadow: var(--shadow-sm); text-align: center;
}
.promo-badge { background: var(--primary-light); color: var(--text-heading); font-size: 0.7rem; font-weight: 800; padding: 0.2rem 0.6rem; border-radius: 99px; display: inline-block; margin-bottom: 0.75rem; }
.promo-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; color: var(--text-heading); margin-bottom: 0.35rem; }
.promo-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.45; }
.btn-sidebar-cta {
  display: block; width: 100%; background: var(--primary-gradient); color: #FFF;
  padding: 0.7rem 0.9rem; border-radius: 99px; font-family: var(--font-display);
  font-size: 0.84rem; font-weight: 800; text-align: center; box-shadow: 0 3px 10px rgba(15, 23, 42, 0.15);
}

/* FAQ Section */
.article-faq-section { margin-top: 2.5rem; border-top: 1px solid var(--border-color); padding-top: 1.75rem; }
.faq-item { border-bottom: 1px solid var(--border-color); padding: 0.85rem 0; }
.faq-q { font-family: var(--font-display); font-size: 0.98rem; font-weight: 700; color: var(--text-heading); margin-bottom: 0.35rem; }
.faq-a { font-size: 0.88rem; color: var(--text-muted); line-height: 1.55; }

/* Sticky CTA mobile */
.mobile-bottom-cta {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #FFFFFF; border-top: 1px solid var(--border-color);
  padding: 0.65rem 1rem; z-index: 1000; box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}
.mobile-bottom-cta a {
  display: block; width: 100%; text-align: center;
  background: var(--primary-gradient); color: #FFF;
  padding: 0.65rem; border-radius: 99px; font-family: var(--font-display);
  font-size: 0.86rem; font-weight: 700;
}

/* Footer */
.footer { background: var(--text-heading); color: #94A3B8; padding: 2.5rem 0 1.5rem; font-size: 0.82rem; text-align: center; }
.footer a { color: #E2E8F0; margin: 0 6px; }
.footer a:hover { color: #FFF; }

/* ── RESPONSIVE & MOBILE POLISH ── */
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: 200px 1fr; gap: 1.75rem; }
  .product-sidebar { display: none; }
}

@media (max-width: 768px) {
  .container { padding: 0 14px; }
  .navbar { padding: 0.6rem 0; }
  .brand-logo { font-size: 1.1rem; }
  .btn-nav { padding: 0.45rem 0.9rem; font-size: 0.78rem; }
  .article-header-section { padding: 1.4rem 0 1.1rem; }
  .article-title { font-size: 1.45rem; line-height: 1.25; margin-bottom: 0.75rem; }
  .article-meta { gap: 0.75rem; font-size: 0.76rem; }
  .author-avatar { width: 26px; height: 26px; font-size: 0.74rem; }
  .article-layout { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.25rem 0 4.5rem; }
  .toc-sidebar { position: static; }
  .article-body { padding: 1.35rem 1rem; border-radius: 10px; }
  .lead-paragraph { font-size: 0.98rem; margin-bottom: 1.2rem; }
  .article-body h2 { font-size: 1.22rem; margin: 1.5rem 0 0.65rem; }
  .article-body h3 { font-size: 1.02rem; margin: 1.15rem 0 0.5rem; }
  .article-body p, .article-body li { font-size: 0.92rem; line-height: 1.62; }
  .takeaways-box { padding: 1rem; margin: 1.25rem 0; }
  .before-after-card { margin: 1.4rem 0; }
  .ba-grid { grid-template-columns: 1fr; }
  .ba-before { border-right: none; border-bottom: 1px solid var(--border-color); }
  .ba-col { padding: 0.9rem; }
  .inline-cta-banner { padding: 1.4rem 1rem; margin: 1.6rem 0; border-radius: 10px; }
  .inline-cta-banner h3 { font-size: 1.15rem; }
  .btn-inline-cta { width: 100%; font-size: 0.84rem; padding: 0.7rem 1rem; }
  .article-table th, .article-table td { padding: 0.6rem 0.75rem; font-size: 0.8rem; }
  .mobile-bottom-cta { display: block; }
  .footer { padding: 2rem 1rem 4.5rem; }
}
