/* ============================================================
   Veille IA — Newsletter stylesheet
   Source of truth: used by all newsletter HTML pages.
   Loaded via <link> injected by scripts/inject_nav.py.
   ============================================================ */

* { box-sizing: border-box; }

html {
  background: #f5f5f5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  line-height: 1.6;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 20px;
  background: #f5f5f5;
  color: #1a1a1a;
}

/*
 * Topbar et toolbar : pleine largeur viewport, contenu centré à 1200px.
 * Le body est centré (max-width: 1200px, margin: 0 auto, padding: 0 20px).
 * Pour que topbar/toolbar "sortent" du body :
 *   - width: 100vw  (pleine largeur)
 *   - margin-left: calc(-20px + min(0px, (1200px - 100vw) / 2))
 *       → à 1440px : -20 - 120 = -140px (compense body left offset + padding)
 *       → à 800px  : -20 + 0  = -20px  (compense seulement le padding)
 *   - padding intérieur aligné avec max-w-[1200px] px-6 du dashboard
 */
#veille-topbar {
  width: 100vw !important;
  margin-left: calc(-20px + min(0px, (1200px - 100vw) / 2)) !important;
  padding: 0 max(24px, calc((100vw - 1200px) / 2 + 24px)) !important;
}
#veille-toolbar {
  width: 100vw !important;
  margin-left: calc(-20px + min(0px, (1200px - 100vw) / 2)) !important;
  padding-left:  max(24px, calc((100vw - 1200px) / 2 + 24px)) !important;
  padding-right: max(24px, calc((100vw - 1200px) / 2 + 24px)) !important;
}

h1 {
  color: #1a1a1a;
  border-bottom: 1px solid #e5e7eb;
  font-size: 1.25em;
  font-weight: 700;
  position: sticky;
  top: 90px;
  background: #f5f5f5;
  z-index: 990;
  margin: 0 -20px 20px;
  padding: 12px 20px;
}

/* ── Stats block ── */
.stats {
  background: white;
  padding: 25px;
  border-radius: 8px;
  margin: 20px 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  border: 1px solid #e0e0e0;
}

.overview-content {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}
.overview-content h3 {
  color: #2c3e50;
  margin-top: 0;
  font-size: 1.4em;
}
.overview-content p {
  font-size: 1.1em;
  color: #444;
  line-height: 1.8;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.stat-box {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  text-align: center;
}
/* Hide stat-boxes whose number is 0 */
.stat-box.stat-zero { display: none; }

.stat-number {
  font-size: 2em;
  font-weight: bold;
  color: #0066cc;
}
.stat-label {
  font-size: 0.9em;
  color: #666;
}

/* ── Urgency sections ── */
.urgence-section {
  background: white;
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.urgence-section h2 {
  margin-top: 0;
  font-size: 1.5em;
}

/* ── Article card ── */
.article {
  border: 1px solid #e0e0e0;
  padding: 20px;
  margin: 15px 0;
  border-radius: 8px;
  background: #fafafa;
  transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
}
.article:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-2px);
  background: #fff;
}

.article-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 15px;
}
.article-header h3 {
  margin: 0;
  color: #1a1a1a;
  font-size: 1.3em;
  flex: 1;
}

.article-badges {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.impact-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85em;
  color: white;
  font-weight: bold;
}

/* ── Meta row ── */
.meta {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.meta span {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85em;
}

.category {
  font-weight: bold;
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.85em;
}
.category.TECH       { background: #0066cc; }
.category.MARCHE     { background: #28a745; }
.category.GOUVERNANCE{ background: #dc3545; }
.category.ACTU       { background: #6c757d; }

.source { background: #e9ecef; color: #495057; }
.date   { background: #f8f9fa; color: #6c757d; }
.audience { background: #e7f3ff; color: #0066cc; }

/* ── Blocks inside article ── */
.urgence-box {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 12px;
  margin: 15px 0;
  border-radius: 4px;
}

.tldr {
  margin: 15px 0;
  padding: 15px;
  background: #f0f7ff;
  border-radius: 6px;
}
.tldr h4 {
  margin: 0 0 10px 0;
  color: #0066cc;
  font-size: 1em;
}
.tldr p { margin: 5px 0; color: #333; }

.editorial-take {
  margin: 15px 0;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 6px;
  color: white;
}
.editorial-take h4 {
  margin: 0 0 10px 0;
  font-size: 1em;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 5px;
}
.editorial-voice {
  font-style: italic;
  line-height: 1.7;
  margin: 0;
}

.impact {
  background: #e7f3ff;
  padding: 15px;
  margin: 15px 0;
  border-radius: 6px;
}
.impact h4 {
  margin: 0 0 10px 0;
  color: #0066cc;
  font-size: 1em;
}
.impact p { margin: 8px 0; }

.action-box {
  background: #d4edda;
  border-left: 4px solid #28a745;
  padding: 15px;
  margin: 15px 0;
  border-radius: 4px;
}
.action-box strong {
  display: block;
  margin-bottom: 8px;
  color: #155724;
}
.action-detail { margin: 8px 0 0 0; color: #155724; }

.cta {
  background: #d4edda;
  border-left: 4px solid #28a745;
  padding: 10px;
  margin: 15px 0;
  border-radius: 4px;
  font-weight: bold;
}

/* ── Article footer (tags + link) ── */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
  flex-wrap: wrap;
  gap: 10px;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  background: #6c757d;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85em;
}

.read-more {
  color: #0066cc;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.read-more:hover { text-decoration: underline; }

/* ── Page footer ── */
footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  color: #666;
  border-top: 2px solid #e0e0e0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .article-header { flex-direction: column; }
  .article-badges { width: 100%; justify-content: flex-start; }
  .stats-grid { grid-template-columns: 1fr; }
}
