/* ============================================================
   articles.css — Composants Baselink
   Chargé sur toutes les pages via functions.php
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bl-bg:        #0a1620;
  --bl-bg2:       #0f1e2d;
  --bl-bg3:       #111f2e;
  --bl-border:    #1e3a52;
  --bl-accent:    #5bc0f8;
  --bl-text:      #c8d8e8;
  --bl-muted:     #5a7a94;
  --bl-ok:        #2a9a50;
  --bl-warn:      #d07000;
  --bl-err:       #c0392b;
  --bl-radius:    10px;
}

/* ── Inline code ────────────────────────────────────────────── */
.bl-ic {
  background: #162636;
  color: var(--bl-accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88em;
}

/* ── Badges (métadonnées article) ───────────────────────────── */
.bl-badges {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}
.bl-badges__inner {
  display: flex;
  gap: 16px;
  background: var(--bl-bg2);
  border: 1px solid var(--bl-border);
  border-radius: 8px;
  padding: 14px 18px;
  width: 100%;
  max-width: 600px;
}
.bl-badges__item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
}
.bl-badges__icon {
  min-width: 32px;
  height: 32px;
  background: #1a3a5c;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.bl-badges__sep {
  width: 1px;
  background: var(--bl-border);
  flex-shrink: 0;
}
.bl-badges__text {
  font-size: 0.9rem;
  color: var(--bl-text);
}
.bl-badges__label {
  color: var(--bl-muted);
  font-size: 0.8rem;
  display: block;
}
.bl-badges__value {
  color: var(--bl-accent);
  font-weight: 700;
}
@media (max-width: 580px) {
  .bl-badges__inner {
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
  }
  .bl-badges__item { justify-content: flex-start; }
  .bl-badges__sep  { width: 100%; height: 1px; }
}

/* ── Callouts ───────────────────────────────────────────────── */
.bl-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: 0 var(--bl-radius) var(--bl-radius) 0;
  padding: 14px 18px;
  margin: 20px 0;
}
.bl-callout__icon {
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}
.bl-callout__label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: .03em;
  margin-bottom: 6px;
  color: var(--bl-text);
}

.bl-callout__title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--bl-muted);
  margin-bottom: 4px;
}
.bl-callout__body {
  font-size: 0.93rem;
  color: var(--bl-text);
  line-height: 1.7;
}
.bl-callout--info {
  background: #1a3a5c;
  border-left: 3px solid var(--bl-accent);
}
.bl-callout--info .bl-callout__icon  { background: var(--bl-accent); color: #0a1620; }
.bl-callout--warn {
  background: #3a2800;
  border-left: 3px solid var(--bl-warn);
}
.bl-callout--warn .bl-callout__icon  { background: var(--bl-warn); }
.bl-callout--warn .bl-callout__body  { color: #f9c74f; }
.bl-callout--error {
  background: #2a0a0a;
  border-left: 3px solid var(--bl-err);
}
.bl-callout--error .bl-callout__icon { background: var(--bl-err); }
.bl-callout--error .bl-callout__body { color: #f08080; }

/* ── Timeline ───────────────────────────────────────────────── */
.bl-timeline {
  position: relative;
  padding-left: 44px;
  margin: 28px 0;
}
.bl-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--bl-border);
}
.bl-timeline__item {
  position: relative;
  margin-bottom: 20px;
}
.bl-timeline__num {
  position: absolute;
  left: -44px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a3a5c;
  border: 2px solid var(--bl-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--bl-accent);
}
.bl-timeline__item--warn .bl-timeline__num {
  background: #3a2800;
  border-color: var(--bl-warn);
  color: var(--bl-warn);
}
.bl-timeline__item--error .bl-timeline__num {
  background: #2a0a0a;
  border-color: var(--bl-err);
  color: var(--bl-err);
}
.bl-timeline__card {
  background: var(--bl-bg3);
  border: 0.5px solid var(--bl-border);
  border-radius: var(--bl-radius);
  padding: 16px 18px;
}
.bl-timeline__item--warn  .bl-timeline__card { border-left: 3px solid var(--bl-warn); border-radius: 0 var(--bl-radius) var(--bl-radius) 0; }
.bl-timeline__item--error .bl-timeline__card { border-left: 3px solid var(--bl-err);  border-radius: 0 var(--bl-radius) var(--bl-radius) 0; }
.bl-timeline__label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--bl-muted);
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.bl-timeline__text {
  font-size: 0.93rem;
  color: var(--bl-text);
  line-height: 1.7;
}

/* ── Tables ─────────────────────────────────────────────────── */
.bl-table-wrap { overflow-x: auto; margin: 24px 0; }
.bl-table {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 0.93rem;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.bl-table table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
}
.bl-table thead tr { background: #1a2a3a; color: #fff; }
.bl-table th { padding: 11px 14px; text-align: left; font-weight: 700; }
.bl-table td { padding: 10px 14px; color: var(--bl-text); border-bottom: 1px solid #1a2a3a; }
.bl-table tbody tr:hover { background: rgba(91,192,248,.04); }
.bl-table tr.bl-table__row--ok   { background: rgba(42,154,80,.12);  border-left: 3px solid rgba(42,154,80,.4); }
.bl-table tr.bl-table__row--warn { background: rgba(208,112,0,.12); border-left: 3px solid rgba(208,112,0,.4); }
.bl-table tr.bl-table__row--err  { background: rgba(192,57,43,.12);  border-left: 3px solid rgba(192,57,43,.4); }
.bl-table tr.bl-table__row--ko   { background: rgba(192,57,43,.12);  border-left: 3px solid rgba(192,57,43,.4); }
.bl-table tr.bl-table__row--info { background: rgba(91,192,248,.08); border-left: 3px solid rgba(91,192,248,.4); }
.bl-table code { background: #162636; color: var(--bl-accent); padding: 2px 8px; border-radius: 4px; font-size: 0.92rem; }

/* ── Table des matières ─────────────────────────────────────── */
.bl-toc {
  background: var(--bl-bg2);
  border: 1px solid var(--bl-border);
  border-radius: var(--bl-radius);
  overflow: hidden;
  margin: 28px 0;
}
.bl-toc__header {
  background: #1a2a3a;
  padding: 16px 22px;
  border-bottom: 1px solid var(--bl-border);
  font-size: 0.95rem;
  text-transform: uppercase;
  color: var(--bl-accent);
  font-weight: 700;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bl-toc__list {
  list-style: none;
  padding: 18px 22px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bl-toc__item, .bl-toc__link {
  display: block;
  text-decoration: none;
  padding: 10px 14px;
  border-left: 3px solid transparent;
  border-radius: 0 4px 4px 0;
  font-size: 0.93rem;
  color: var(--bl-text);
  transition: border-color .2s, background .2s;
}
.bl-toc__item:hover, .bl-toc__link:hover {
  border-color: var(--bl-accent);
  background: #162636;
}
.bl-toc__num {
  color: var(--bl-accent);
  font-weight: 700;
  margin-right: 8px;
}

/* ── Glossaire ──────────────────────────────────────────────── */
.bl-glossary {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}
.bl-glossary__item {
  background: var(--bl-bg3);
  border: 1px solid var(--bl-border);
  border-radius: 8px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: start;
}
.bl-glossary__term {
  color: var(--bl-accent);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88rem;
  font-weight: 700;
}
.bl-glossary__def {
  color: var(--bl-text);
  font-size: 0.9rem;
  line-height: 1.6;
}
@media (max-width: 540px) {
  .bl-glossary__item { grid-template-columns: 1fr; }
}

/* ── Source / Référence ─────────────────────────────────────── */
.bl-source {
  margin: 32px 0 8px;
  padding: 12px 16px;
  background: var(--bl-bg2);
  border-left: 3px solid var(--bl-muted);
  border-radius: 0 6px 6px 0;
  font-size: 0.82rem;
  color: var(--bl-muted);
  font-family: 'IBM Plex Mono', monospace;
}
.bl-source a { color: var(--bl-accent); text-decoration: none; }
.bl-source a:hover { text-decoration: none; }

/* ── Image caption mobile ───────────────────────────────────── */
.bl-image-caption-mobile {
  font-size: 0.78rem;
  color: var(--bl-muted);
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}

/* ── Light mode overrides ───────────────────────────────────── */
[data-theme="light"] {
  --bl-bg:     #f4f6f9;
  --bl-bg2:    #ffffff;
  --bl-bg3:    #f8fafc;
  --bl-border: #d0dce8;
  --bl-text:   #1a2a3a;
  --bl-muted:  #607080;
}
[data-theme="light"] .bl-ic { background: #e8f0f8; }
[data-theme="light"] .bl-table thead tr { background: #dde8f0; color: #1a2a3a; }
[data-theme="light"] .bl-toc__header { background: #e8f0f8; }

/* ── Callouts — overrides mode clair ──────────────────────────── */
[data-theme=light] .bl-callout--info {
  background: #deeeff;
  border-left-color: #2563eb;
}
[data-theme=light] .bl-callout--info .bl-callout__icon {
  background: #2563eb;
  color: #fff;
}
[data-theme=light] .bl-callout--info .bl-callout__body { color: #1e3a5f; }

[data-theme=light] .bl-callout--warn {
  background: #fef3cd;
  border-left-color: #d97706;
}
[data-theme=light] .bl-callout--warn .bl-callout__icon { background: #d97706; }
[data-theme=light] .bl-callout--warn .bl-callout__body { color: #7c4a00; }

[data-theme=light] .bl-callout--error {
  background: #fde8e8;
  border-left-color: #dc2626;
}
[data-theme=light] .bl-callout--error .bl-callout__icon { background: #dc2626; }
[data-theme=light] .bl-callout--error .bl-callout__body { color: #7f1d1d; }

/* ── bl-table code — override mode clair ── */
[data-theme=light] .bl-table code {
  background: #e8ecf4;
  border: 1px solid #c8d0e0;
  color: #0055aa;
}

/* ── Wrapping texte long ── */
.entry-content {
  overflow-wrap: break-word;
}

/* ── H2 style articles — option B (fond + barre gauche) ── */
.entry-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e8f2ff;
  border-left: 3px solid var(--bl-accent);
  padding: 10px 16px;
  background: rgba(91,192,248,.06);
  border-radius: 0 6px 6px 0;
  margin: 32px 0 16px;
}

[data-theme=light] .entry-content h2 {
  color: #0f1e2d;
  background: rgba(37,99,235,.06);
  border-left-color: #2563eb;
}


/* ── bl-schema : image schéma dans le contenu article ── */
.bl-schema {
  margin: 24px 0;
  cursor: zoom-in;
}
.bl-schema img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}
.bl-schema__caption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--bl-muted);
  margin-top: 8px;
}
