/* ============================================================
   blog-rich.css — Composants visuels enrichis pour articles blog
   À charger APRÈS blog.css.
   Aligne sur tokens.css (Sanalia design system).
   ============================================================ */

/* ─── 0. Listes ul/ol classiques (style par défaut Sanalia) ─── */

.blog-content > ul,
.blog-body > ul,
.blog-content > ol,
.blog-body > ol {
  margin: 24px 0;
  padding-left: 0;
  list-style: none;
}

.blog-content > ul > li,
.blog-body > ul > li {
  position: relative;
  padding: 6px 0 6px 28px;
  font-family: 'Uxum', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: #34285a;
}

.blog-content > ul > li::before,
.blog-body > ul > li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #635ddd;
}

.blog-content > ol > li,
.blog-body > ol > li {
  position: relative;
  padding: 6px 0 6px 36px;
  font-family: 'Uxum', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: #34285a;
  counter-increment: blog-ol;
}

.blog-content > ol,
.blog-body > ol {
  counter-reset: blog-ol;
}

.blog-content > ol > li::before,
.blog-body > ol > li::before {
  content: counter(blog-ol) ".";
  position: absolute;
  left: 4px;
  top: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 400;
  color: #635ddd;
  min-width: 24px;
}

.blog-content > ul > li > strong:first-child,
.blog-body > ul > li > strong:first-child,
.blog-content > ol > li > strong:first-child,
.blog-body > ol > li > strong:first-child {
  color: #0e052a;
  font-weight: 700;
}

/* Listes imbriquées : style plus discret */
.blog-content > ul ul,
.blog-content > ul ol,
.blog-content > ol ul,
.blog-content > ol ol,
.blog-body > ul ul,
.blog-body > ul ol,
.blog-body > ol ul,
.blog-body > ol ol {
  margin: 8px 0 8px 12px;
}

.blog-content > ul ul > li::before,
.blog-body > ul ul > li::before {
  width: 6px;
  height: 6px;
  background: #8781f3;
}

/* Surcharge stricte : .steps-list garde son rendu numéroté de l'item 4.
   Important : on remet counter-reset/-increment sur le compteur "steps"
   parce que les rules .blog-content > ol/li ci-dessus auraient écrasé
   les counter-reset:steps / counter-increment:steps de l'item 4. */
.blog-content > ol.steps-list,
.blog-body > ol.steps-list {
  list-style: none;
  counter-reset: steps;
}
.blog-content > ol.steps-list > li,
.blog-body > ol.steps-list > li {
  padding-left: 80px;  /* override de l'OL classique */
  counter-increment: steps;
}
.blog-content > ol.steps-list > li::before,
.blog-body > ol.steps-list > li::before {
  content: counter(steps);  /* override : le styling .steps-list reprend la main */
  left: 20px;
  top: 20px;
  width: 44px;
  height: 44px;
  min-width: auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #635ddd 0%, #8781f3 100%);
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ─── 1. Variantes callout ─────────────────────────────────── */

.callout-warning {
  background: linear-gradient(135deg, #FFF3E7 0%, #FFE5CF 100%);
  border-left: 3px solid #F66C24;
  padding: 20px 24px;
  border-radius: 8px;
  margin: 32px 0;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  color: #34285a;
  font-family: 'Uxum', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
.callout-warning::before {
  content: '⚠️';
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1.2;
}

.callout-danger {
  background: linear-gradient(135deg, #FFD4CF 0%, #FFECE9 100%);
  border-left: 3px solid #d9442d;
  padding: 20px 24px;
  border-radius: 8px;
  margin: 32px 0;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  color: #5d1a14;
  font-family: 'Uxum', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
.callout-danger::before {
  content: '🚨';
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1.2;
}
.callout-danger strong { color: #5d1a14; }

.callout-tip {
  background: linear-gradient(135deg, #E1F7F1 0%, #ABE0D1 100%);
  border-left: 3px solid #2e8a73;
  padding: 20px 24px;
  border-radius: 8px;
  margin: 32px 0;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  color: #1f4a3e;
  font-family: 'Uxum', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
.callout-tip::before {
  content: '💡';
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1.2;
}

/* ─── 2. Bandeau urgence (intent=urgency) ──────────────────── */

.emergency-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 40px;
  padding: 20px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7f5 0%, #ffd4cf 100%);
  border: 2px solid #d9442d;
  color: #5d1a14;
  font-family: 'Uxum', sans-serif;
}
.emergency-banner__text {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 280px;
  min-width: 0;
}
.emergency-banner__icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}
.emergency-banner__title {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 2px;
  color: #5d1a14;
}
.emergency-banner__desc {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  color: #7a2d24;
}
.emergency-banner__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  background: #d9442d;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: background .2s ease;
  white-space: nowrap;
}
.emergency-banner__cta:hover { background: #b8341f; }
.emergency-banner__cta svg { width: 18px; height: 18px; }

/* ─── 3. Tableau comparatif ────────────────────────────────── */

.comparison-table-wrap {
  margin: 32px 0;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e8e4da;
  background: #fff;
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Uxum', sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
/* Sur petits écrans, on garantit le scroll horizontal du wrap pour les
   tableaux à 4+ colonnes (sinon les cellules se compressent et deviennent
   illisibles). Le wrap a déjà overflow-x: auto.
   On force display: table pour restaurer l'algo de layout natif
   (un reset global `table { display: block; overflow-x: auto; }` est
   appliqué à 768px sur tout le site mais casse max-content). */
@media (max-width: 640px) {
  .comparison-table-wrap { -webkit-overflow-scrolling: touch; }
  .comparison-table {
    display: table;
    width: max-content;
    min-width: 100%;
    overflow-x: visible;
    font-size: 14px;
  }
  .comparison-table thead th,
  .comparison-table tbody td { padding: 12px 14px; white-space: nowrap; }
  /* La première colonne reste en wrap pour ne pas dépasser 220px */
  .comparison-table tbody td:first-child,
  .comparison-table thead th:first-child { white-space: normal; max-width: 220px; }
}
.comparison-table caption {
  caption-side: top;
  text-align: left;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: #999;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 0 16px 12px;
}
.comparison-table thead th {
  background: #f6f5f0;
  color: #0e052a;
  font-family: 'Uxum', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .02em;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 2px solid #e8e4da;
}
.comparison-table thead th:not(:first-child) {
  text-align: center;
}
.comparison-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0ede5;
  vertical-align: top;
  color: #34285a;
}
.comparison-table tbody td:first-child {
  font-weight: 700;
  color: #0e052a;
  background: #fbf9f3;
}
.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table .cell-positive { color: #2e8a73; }
.comparison-table .cell-negative { color: #d9442d; }
.comparison-table .cell-neutral { color: #6b6478; }

/* ─── 4. Liste d'étapes ordonnée (steps-list) ──────────────── */

.steps-list {
  margin: 32px 0;
  padding: 0;
  counter-reset: steps;
  list-style: none;
}
.steps-list > li {
  position: relative;
  margin: 0 0 24px;
  padding: 20px 20px 20px 80px;
  background: #fbf9f3;
  border-radius: 12px;
  border: 1px solid #f0ede5;
  counter-increment: steps;
  font-family: 'Uxum', sans-serif;
  color: #34285a;
}
.steps-list > li::before {
  content: counter(steps);
  position: absolute;
  left: 20px;
  top: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #635ddd 0%, #8781f3 100%);
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps-list > li strong:first-child {
  /* Inline pour supporter les 2 patterns :
     - <strong>Titre</strong> Description (legacy rats article)
     - <strong>Titre</strong> : Description (ChatSEO actuel)
     Le numéro à gauche assure déjà la hiérarchie visuelle.
     Pas de margin-right : l'espace naturel " : " ou " " suffit
     (sinon double-espacement visible). */
  font-size: 17px;
  font-weight: 700;
  color: #0e052a;
}
.steps-list > li > *:last-child { margin-bottom: 0; }
.steps-list--danger > li::before {
  background: linear-gradient(135deg, #d9442d 0%, #f66c24 100%);
}

/* ─── 5. Checklist (cases à cocher visuelles) ──────────────── */

.checklist {
  margin: 24px 0;
  padding: 20px 24px;
  background: #fbf9f3;
  border-radius: 12px;
  border: 1px solid #e8e4da;
  list-style: none;
}
.checklist-title {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: #6b6478;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.checklist li {
  position: relative;
  padding: 8px 0 8px 36px;
  font-family: 'Uxum', sans-serif;
  color: #34285a;
  font-size: 16px;
  line-height: 1.5;
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 22px;
  height: 22px;
  border: 2px solid #635ddd;
  border-radius: 6px;
  background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23635ddd' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 16px;
  background-position: center;
  background-repeat: no-repeat;
}
.checklist li.checklist-title { padding-left: 0; }
.checklist li.checklist-title::before { display: none; }
.checklist--danger li::before { border-color: #d9442d; }
.checklist--danger li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9442d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}

/* ─── 6. Quiz symptômes interactif ─────────────────────────── */

.symptom-quiz {
  margin: 40px 0;
  padding: 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fbf2ff 0%, #efdff6 100%);
  border: 1px solid #cecbfc;
  font-family: 'Uxum', sans-serif;
}
.symptom-quiz__label {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: #6b6478;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.symptom-quiz__title {
  font-family: 'Uxum', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #0e052a;
  margin: 0 0 8px;
  line-height: 1.3;
}
.symptom-quiz__desc {
  font-size: 15px;
  color: #34285a;
  margin: 0 0 20px;
  line-height: 1.5;
}
.symptom-quiz__options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.symptom-quiz__options li {
  padding: 0;
}
.symptom-quiz__options label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8e4da;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
  font-size: 15px;
  color: #34285a;
  line-height: 1.4;
}
.symptom-quiz__options label:hover {
  border-color: #8781f3;
  background: #fafaff;
}
.symptom-quiz__options input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin: 0;
  accent-color: #635ddd;
  cursor: pointer;
}
.symptom-quiz__options input[type="checkbox"]:checked + .symptom-quiz__option-text {
  font-weight: 700;
  color: #0e052a;
}
.symptom-quiz__result {
  margin: 0;
  padding: 18px 20px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.5;
  font-family: 'Uxum', sans-serif;
  display: none;
}
.symptom-quiz__result.is-active { display: block; }
.symptom-quiz__result[data-level="low"] {
  background: #E1F7F1;
  border: 1px solid #2e8a73;
  color: #1f4a3e;
}
.symptom-quiz__result[data-level="medium"] {
  background: #FFF3E7;
  border: 1px solid #F66C24;
  color: #5d3f22;
}
.symptom-quiz__result[data-level="high"] {
  background: #FFD4CF;
  border: 1px solid #d9442d;
  color: #5d1a14;
}
.symptom-quiz__result-title {
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 6px;
}
.symptom-quiz__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 18px;
  border-radius: 8px;
  background: #0e052a;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: background .2s ease;
}
.symptom-quiz__cta:hover { background: #34285a; }
.symptom-quiz__result[data-level="high"] .symptom-quiz__cta { background: #d9442d; }
.symptom-quiz__result[data-level="high"] .symptom-quiz__cta:hover { background: #b8341f; }

/* ─── Mobile tweaks ─────────────────────────────────────────── */

@media (max-width: 640px) {
  .emergency-banner { flex-direction: column; align-items: stretch; padding: 16px; }
  .emergency-banner__cta { justify-content: center; }
  .steps-list > li { padding-left: 76px; }
  .symptom-quiz { padding: 20px; }
  .symptom-quiz__title { font-size: 20px; }
}
