/* Prod Watch blog - styles partagés pour les articles */

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2D2A6E;
  --primary-dark: #1F1D54;
  --primary-bg: #EDECF6;
  --accent: #F5A623;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --text: #1e293b;
  --text-light: #64748b;
  --text-lighter: #94a3b8;
  --border: #e2e8f0;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --nav-h: 64px;
  --sidebar-w: 240px;
}
html { scroll-behavior: smooth; }
body { font-family: "Inter", -apple-system, sans-serif; color: var(--text); background: var(--bg); line-height: 1.7; }

/* Nav */
nav { position: fixed; top: 0; width: 100%; height: var(--nav-h); background: rgba(255,255,255,0.92); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); z-index: 100; display: flex; align-items: center; padding-top: 4px; }
.nav-inner { max-width: 1280px; width: 100%; margin: 0 auto; padding: 0 2rem; display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 0.5rem; }
.nav-links a { color: var(--text-light); text-decoration: none; font-size: 0.9rem; padding: 0.5rem 0.8rem; border-radius: 6px; transition: color 0.2s; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-cta { background: var(--primary) !important; color: white !important; font-weight: 600; border-radius: 8px; }
.nav-cta:hover { background: var(--primary-dark) !important; }

/* Layout sidebar + content */
.doc-layout { display: flex; margin-top: var(--nav-h); min-height: calc(100vh - var(--nav-h)); }
.doc-sidebar { width: var(--sidebar-w); flex-shrink: 0; position: fixed; top: var(--nav-h); left: 0; bottom: 0; overflow-y: auto; border-right: 1px solid var(--border); background: var(--bg-soft); padding: 28px 0 40px; z-index: 50; }
.sidebar-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-lighter); padding: 0 24px; margin-bottom: 12px; }
.sidebar-nav a { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--text-light); padding: 7px 24px; text-decoration: none; transition: all 0.15s; border-left: 3px solid transparent; font-weight: 400; }
.sidebar-nav a:hover { color: var(--text); background: rgba(0,0,0,0.02); }
.sidebar-nav a.active { color: var(--primary-dark); font-weight: 700; border-left-color: var(--primary); background: rgba(45,42,110,0.04); }
.sidebar-nav a .nav-num { width: 20px; height: 20px; border-radius: 50%; background: var(--border); color: var(--text-lighter); font-size: 0.68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; }
.sidebar-nav a.active .nav-num { background: var(--primary-bg); color: var(--primary-dark); }

.doc-content { margin-left: var(--sidebar-w); flex: 1; max-width: 820px; padding: 40px 48px 80px; }

/* Breadcrumb */
.breadcrumb { font-size: 0.8rem; color: var(--text-lighter); margin-bottom: 1.25rem; }
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 0.4rem; color: var(--text-lighter); }

/* Article header */
.article-tag { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); background: var(--primary-bg); padding: 4px 10px; border-radius: 999px; margin-bottom: 1rem; }
h1.article-title { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 1rem; color: var(--text); }
.article-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.85rem; color: var(--text-light); margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.article-meta .author { display: flex; align-items: center; gap: 8px; }
.article-meta .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; }
.article-meta .dot { color: var(--text-lighter); }

/* Article body typography */
.lead { font-size: 1.1rem; color: var(--text-light); margin-bottom: 2rem; line-height: 1.65; }
h2 { font-size: 1.35rem; font-weight: 700; margin: 2.75rem 0 0.85rem; color: var(--text); scroll-margin-top: calc(var(--nav-h) + 24px); }
h2:first-of-type { margin-top: 0; }
h3 { font-size: 1rem; font-weight: 700; margin: 1.75rem 0 0.6rem; color: var(--text); }
.doc-content p { color: var(--text); font-size: 0.95rem; margin-bottom: 0.9rem; }
.doc-content ul, .doc-content ol { color: var(--text); font-size: 0.95rem; padding-left: 1.5rem; margin-bottom: 0.9rem; }
.doc-content ul li, .doc-content ol li { margin-bottom: 0.4rem; }
.doc-content a { color: var(--primary); text-decoration: none; font-weight: 500; }
.doc-content a:hover { text-decoration: underline; }
strong { color: var(--text); font-weight: 700; }

pre { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 18px 20px; font-size: 0.82rem; overflow-x: auto; margin: 0.9rem 0 1.4rem; line-height: 1.7; font-family: "JetBrains Mono", "SF Mono", "Fira Code", "Consolas", monospace; }
code { font-family: "JetBrains Mono", "SF Mono", "Fira Code", "Consolas", monospace; font-size: 0.85em; }
p code, li code, td code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; color: var(--primary-dark); font-weight: 500; }
.token { color: #fbbf24; }
.comment { color: #64748b; }
.string { color: #34d399; }
.key { color: #93c5fd; }
.keyword { color: #c084fc; font-weight: 600; }
.tag { color: #f87171; }
.attr { color: #fbbf24; }

/* Callouts */
.callout { border-left: 3px solid var(--primary); background: var(--primary-bg); border-radius: 0 8px 8px 0; padding: 14px 18px; margin: 1.25rem 0; font-size: 0.9rem; color: var(--text); }
.callout strong { color: var(--primary-dark); }
.callout.warn { border-left-color: var(--accent); background: #fff7ed; }
.callout.warn strong { color: #b45309; }
.callout.good { border-left-color: var(--green); background: var(--green-bg); }
.callout.good strong { color: #047857; }
.callout.info { border-left-color: #3b82f6; background: #eff6ff; }
.callout.info strong { color: #1d4ed8; }

/* Comparaison good vs bad */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 1.25rem 0 1.5rem; }
.compare-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--bg); }
.compare-card.bad { border-color: #fecaca; background: var(--red-bg); }
.compare-card.good { border-color: #a7f3d0; background: var(--green-bg); }
.compare-card .head { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.compare-card.bad .head { color: var(--red); }
.compare-card.good .head { color: var(--green); }
.compare-card pre { margin: 0; font-size: 0.78rem; }

/* Tableau */
.article-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 1rem 0 1.5rem; }
.article-table th { background: var(--bg-soft); padding: 10px 14px; text-align: left; font-weight: 700; color: var(--text); border: 1px solid var(--border); font-size: 0.85rem; }
.article-table td { padding: 10px 14px; color: var(--text); border: 1px solid var(--border); vertical-align: top; }
.article-table tr:nth-child(even) td { background: #fafbfc; }
.article-table .pos { color: var(--green); font-weight: 600; }
.article-table .neg { color: var(--red); font-weight: 600; }

/* Image figure */
.fig { margin: 1.5rem 0; }
.fig img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); display: block; }
.fig figcaption { font-size: 0.82rem; color: var(--text-lighter); text-align: center; margin-top: 8px; font-style: italic; }

/* Steps numérotés */
.step-list { counter-reset: step; padding-left: 0 !important; list-style: none !important; }
.step-list li { counter-increment: step; position: relative; padding-left: 42px; margin-bottom: 1rem !important; }
.step-list li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-bg); color: var(--primary-dark); font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; }

/* Mobile TOC */
.mobile-toc { display: none; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin-bottom: 2rem; }
.mobile-toc-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-lighter); margin-bottom: 8px; }
.mobile-toc a { display: block; font-size: 0.86rem; color: var(--text-light); padding: 3px 0; font-weight: 400; }

/* CTA bottom */
.cta-card { margin: 3rem 0 1rem; padding: 28px 32px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; border-radius: 14px; }
.cta-card h3 { color: white; font-size: 1.2rem; margin-bottom: 0.5rem; }
.cta-card p { color: rgba(255,255,255,0.85); margin-bottom: 1rem; font-size: 0.92rem; }
.cta-card .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.cta-card a { display: inline-block; padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 0.88rem; text-decoration: none; transition: transform 0.15s; }
.cta-card a:hover { transform: translateY(-1px); text-decoration: none; }
.cta-card .btn-primary { background: var(--accent); color: var(--primary-dark); }
.cta-card .btn-ghost { background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.25); }

/* Share */
.share { display: flex; align-items: center; gap: 12px; margin: 2rem 0 0.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-light); flex-wrap: wrap; }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btns a, .share-btns button { background: var(--bg-soft); border: 1px solid var(--border); padding: 6px 12px; border-radius: 6px; font-size: 0.82rem; color: var(--text-light); cursor: pointer; font-family: inherit; text-decoration: none; transition: all 0.15s; }
.share-btns a:hover, .share-btns button:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

/* Footer */
footer { padding: 2.5rem 2rem; text-align: center; color: var(--text-lighter); font-size: 0.85rem; border-top: 1px solid var(--border); margin-left: var(--sidebar-w); }
footer a { color: var(--text-light); text-decoration: none; margin: 0 0.5rem; }
footer a:hover { color: var(--primary); }

/* Responsive */
@media (max-width: 860px) {
  .doc-sidebar { display: none; }
  .doc-content { margin-left: 0; padding: 24px 20px 60px; }
  footer { margin-left: 0; }
  .mobile-toc { display: block; }
  .nav-inner { padding: 0 1rem; }
  h1.article-title { font-size: 1.6rem; }
  .compare { grid-template-columns: 1fr; }
  .article-table { font-size: 0.8rem; }
  .article-table th, .article-table td { padding: 8px 10px; }
}
