/* ==========================================================================
   Code Promo Africa — couche finale « restructuration septembre 2026 »
   Chargée en dernier : harmonise les couleurs, la hiérarchie et rend les
   tableaux lisibles sur petits écrans (transformation en cartes).
   ========================================================================== */

:root {
  --cpa2-ink: #0f1b2d;
  --cpa2-ink-soft: #46566e;
  --cpa2-brand: #0f4fc4;
  --cpa2-brand-dark: #093a97;
  --cpa2-brand-soft: #eaf1ff;
  --cpa2-gold: #f0a11a;
  --cpa2-gold-dark: #a15c07;
  --cpa2-green: #0d8f57;
  --cpa2-line: #dde7f3;
  --cpa2-surface: #ffffff;
  --cpa2-surface-soft: #f6f9fd;
  --cpa2-radius: 16px;
  --cpa2-shell: 1120px;
  --cpa2-shadow: 0 16px 38px -24px rgba(12, 40, 90, .5);
}

/* ---------- Rythme général ---------- */
body {
  font-size: 16.5px !important;
  letter-spacing: .1px;
}
main { max-width: var(--cpa2-shell); }
p, li { color: var(--cpa2-ink-soft) !important; }
h1, h2, h3, h4 { text-wrap: balance; }
h1 { color: var(--cpa2-ink) !important; }
h2 { color: var(--cpa2-brand-dark) !important; }
h3 { color: var(--cpa2-ink) !important; }
a { color: var(--cpa2-brand-dark); }
a:hover { color: var(--cpa2-brand); }
.content-section { margin-bottom: clamp(18px, 3vw, 30px); }
.content-section + .content-section { margin-top: 0; }

/* ---------- Bloc « code promo officiel » ---------- */
.cpa-official {
  width: min(var(--cpa2-shell), calc(100% - 28px));
  margin: 20px auto 26px;
  padding: clamp(16px, 2.6vw, 26px);
  border: 1px solid #cfe0f5;
  border-left: 6px solid var(--cpa2-gold);
  border-radius: var(--cpa2-radius);
  background: linear-gradient(140deg, #fffaf0 0%, #ffffff 55%, #f2f7ff 100%);
  box-shadow: var(--cpa2-shadow);
}
.cpa-official-kicker {
  display: inline-flex; align-items: center; gap: 7px;
  margin-bottom: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--cpa2-green);
  color: #fff !important;
  font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
}
.cpa-official h2,
.cpa-official p:first-of-type {
  margin-top: 0 !important;
}
.cpa-official p { margin-bottom: 10px; }
.cpa-official p:last-child { margin-bottom: 0; }
.cpa-official strong { color: var(--cpa2-ink) !important; }
.cpa-official .cpa-official-code {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  background: #0b1f45;
  color: #ffd66b !important;
  font-weight: 900;
  letter-spacing: 3px;
}

/* ---------- Codes en évidence ---------- */
td .code-pill, .code-pill {
  display: inline-block !important;
  width: auto !important;
  max-width: max-content;
  text-align: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--cpa2-brand-soft);
  border: 1px solid #c7dbff;
  color: var(--cpa2-brand-dark) !important;
  font-weight: 900;
  letter-spacing: 2px;
  white-space: nowrap;
}

/* ---------- Tableaux : lisibles sur PC ---------- */
.seo-table-wrap {
  border: 1px solid var(--cpa2-line) !important;
  border-radius: var(--cpa2-radius) !important;
  background: var(--cpa2-surface) !important;
  overflow: hidden;
}
table.seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .97rem;
}
table.seo-table caption {
  caption-side: top;
  padding: 14px 16px;
  background: var(--cpa2-surface-soft);
  border-bottom: 1px solid var(--cpa2-line);
  color: var(--cpa2-brand-dark) !important;
  font-weight: 800;
  font-size: .95rem;
  text-align: left;
}
table.seo-table thead th {
  background: linear-gradient(135deg, var(--cpa2-brand-dark), var(--cpa2-brand));
  color: #fff !important;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-align: left;
  padding: 11px 14px;
  border: 0;
}
table.seo-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--cpa2-line);
  vertical-align: top;
  color: var(--cpa2-ink-soft) !important;
}
table.seo-table tbody tr:nth-child(even) td { background: #f9fbff; }

/* ---------- Tableaux : cartes empilées sur téléphone ---------- */
@media (max-width: 720px) {
  .seo-table-wrap {
    background: transparent !important;
    border: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  table.seo-table {
    display: block;
    width: 100%;
    font-size: .92rem;
  }
  table.seo-table caption {
    display: block;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--cpa2-line);
    border-radius: 12px;
    font-size: .9rem;
    line-height: 1.45;
  }
  table.seo-table thead {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  table.seo-table tbody { display: block; }
  table.seo-table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--cpa2-line);
    border-radius: 14px;
    background: var(--cpa2-surface) !important;
    box-shadow: 0 10px 24px -20px rgba(12, 40, 90, .6);
    overflow: hidden;
  }
  table.seo-table tbody tr:last-child { margin-bottom: 0; }
  table.seo-table tbody tr td,
  table.seo-table tbody tr:nth-child(even) td {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px 13px;
    border: 0;
    border-top: 1px solid #eef3fa;
    background: transparent !important;
    text-align: left;
    overflow-wrap: anywhere;
  }
  table.seo-table tbody tr td:first-child {
    border-top: 0;
    background: #f6f9fd !important;
  }
  table.seo-table tbody tr td::before {
    content: attr(data-label);
    display: block;
    color: var(--cpa2-brand-dark);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  table.seo-table tbody tr td:not([data-label])::before { content: none; }
  table.seo-table tbody tr td[data-label=""]::before { content: none; }
}

/* ---------- Bandeau de mise à jour ---------- */
.site-update-stamp {
  border-color: #cfe0f5 !important;
  background: var(--cpa2-brand-soft) !important;
  font-size: .8rem !important;
  font-weight: 600;
}

/* ---------- Cartes bookmaker (accueil) ---------- */
.bookmaker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.bookmaker { transition: transform .2s ease, box-shadow .2s ease; }
.bookmaker:hover { transform: translateY(-3px); }

/* ---------- FAQ ---------- */
.faq-item { padding: clamp(14px, 2.4vw, 20px) !important; margin-bottom: 10px; }
.faq-item h3 { color: var(--cpa2-brand-dark) !important; }

/* ---------- Petits écrans : confort de lecture ---------- */
@media (max-width: 480px) {
  body { font-size: 16px !important; }
  main { padding-inline: 14px !important; }
  .content-section { padding: 15px !important; }
  .code-widget { width: 100%; justify-content: center; }
  .cpa-official { width: calc(100% - 20px); }
  .hero, .home-hero { padding-inline: 16px !important; }
}
