/*
 * article-content.css — Styles de contenu article blog (plan 008b RC8b-4).
 *
 * Chargé par :
 *   - blog/article.php          (rendu public)
 *   - admin/blog/edit.php       (éditeur admin)
 *   - admin/blog/preview.php    (aperçu live HTMX)
 *
 * Sélecteur commun : .art-body, .blog-preview-content
 * Chaque règle est préfixée par ce sélecteur pour s'appliquer aux deux contextes.
 */

/* ── Variables sémantiques callouts ────────────────────────────────────────── */
:root {
  --callout-info:         #0284C7;
  --callout-info-bg:      rgba(2, 132, 199, 0.05);
  --callout-tip:          var(--color-gold, #FFC107);
  --callout-tip-bg:       rgba(255, 193, 7, 0.08);
  --callout-warning:      #f59e0b;
  --callout-warning-bg:   rgba(245, 158, 11, 0.08);
  --callout-danger:       var(--color-red, #D32F2F);
  --callout-danger-bg:    rgba(211, 47, 47, 0.05);
  --callout-success:      #16a34a;
  --callout-success-bg:   rgba(22, 163, 74, 0.06);
  --callout-muted:        var(--text-muted, #666);
  --callout-muted-bg:     var(--bg-surface-2, #f5f5f5);
  --tech-specs-border:    rgba(14, 165, 233, 0.3);
  --tech-specs-bg:        rgba(14, 165, 233, 0.04);
}

/* Override dark mode : ton plus doux pour ne pas saturer */
[data-theme="dark"] {
  --callout-info-bg:      rgba(2, 132, 199, 0.10);
  --callout-tip-bg:       rgba(255, 193, 7, 0.10);
  --callout-warning-bg:   rgba(245, 158, 11, 0.10);
  --callout-danger-bg:    rgba(211, 47, 47, 0.10);
  --callout-success-bg:   rgba(22, 163, 74, 0.10);
  --tech-specs-bg:        rgba(14, 165, 233, 0.08);
}

/* ── Titres de section (style magazine, identique à l'original .bak) ──────── */
/* Override des règles faibles de .art-body h2/h3/h4 du <style> inline d'article.php. */

.art-body h2,
.blog-preview-content h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.2rem);
  color: var(--color-red, #D32F2F);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.6rem;
  margin: 3rem 0 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.art-body h3,
.blog-preview-content h3 {
  font-size: clamp(1.25rem, 2vw, 1.45rem);
  color: var(--text-main);
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  line-height: 1.25;
}

.art-body h4,
.blog-preview-content h4 {
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  color: var(--text-main);
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}

/* ── Tables Varkhana ──────────────────────────────────────────────────────── */

.art-body .data-table-wrapper,
.blog-preview-content .data-table-wrapper {
  overflow-x: auto;
  margin: 2.5rem 0;
  border-radius: 12px;
  box-shadow: var(--shadow, 0 4px 24px rgba(0,0,0,.08));
  border: 1px solid var(--border-color);
}

.art-body table,
.blog-preview-content table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface-2);
  color: var(--text-main);
  font-size: .95rem;
  min-width: 600px;
}

.art-body th,
.blog-preview-content th {
  /* #fff sur fond rouge : exception acceptée, rapport de contraste AA OK */
  background: var(--color-red, #D32F2F);
  color: #fff;
  padding: 14px 18px;
  text-align: left;
  font-weight: 700;
  border-bottom: 3px solid var(--color-gold, #FFC107);
}

.art-body td,
.blog-preview-content td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  color: var(--text-main);
}

.art-body tr:last-child td,
.blog-preview-content tr:last-child td {
  border-bottom: none;
}

.art-body tr:hover td,
.blog-preview-content tr:hover td {
  background: rgba(211, 47, 47, 0.03);
}

/* ── Callouts ────────────────────────────────────────────────────────────── */

.art-body .callout,
.blog-preview-content .callout {
  background: var(--callout-muted-bg);
  border-left: 5px solid var(--callout-muted);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
  color: var(--text-main);
  box-shadow: var(--shadow);
}

.art-body .callout-info,
.blog-preview-content .callout-info {
  border-left-color: var(--callout-info);
  background: var(--callout-info-bg);
}

.art-body .callout-tip,
.blog-preview-content .callout-tip {
  border-left-color: var(--callout-tip);
  background: var(--callout-tip-bg);
}

.art-body .callout-warning,
.blog-preview-content .callout-warning {
  border-left-color: var(--callout-warning);
  background: var(--callout-warning-bg);
}

.art-body .callout-danger,
.blog-preview-content .callout-danger {
  border-left-color: var(--callout-danger);
  background: var(--callout-danger-bg);
}

.art-body .callout-success,
.blog-preview-content .callout-success {
  border-left-color: var(--callout-success);
  background: var(--callout-success-bg);
}

/* Réinitialiser les marges des éléments à l'intérieur d'un callout */
.art-body .callout > *:first-child,
.blog-preview-content .callout > *:first-child {
  margin-top: 0;
}

.art-body .callout > *:last-child,
.blog-preview-content .callout > *:last-child {
  margin-bottom: 0;
}

/* ── Tech Specs ──────────────────────────────────────────────────────────── */

.art-body .tech-specs,
.blog-preview-content .tech-specs {
  background: var(--tech-specs-bg);
  border: 1px solid var(--tech-specs-border);
  padding: 2rem;
  border-radius: 12px;
  margin: 2.5rem 0;
  color: var(--text-main);
}

.art-body .tech-specs > *:first-child,
.blog-preview-content .tech-specs > *:first-child {
  margin-top: 0;
}

/* ── Pro Tip ─────────────────────────────────────────────────────────────── */

.art-body .pro-tip,
.blog-preview-content .pro-tip {
  background: var(--callout-tip-bg);
  border: 1px solid rgba(255, 193, 7, 0.3);
  padding: 1.5rem;
  border-radius: 12px;
  margin: 2rem 0;
  color: var(--text-main);
}

/* ── Listes check-list / cross-list ──────────────────────────────────────── */
/* La classe peut être sur <ul> directement ou sur un <div> wrapper (via directive :::check-list) */

.art-body ul.check-list,
.art-body .check-list ul,
.blog-preview-content ul.check-list,
.blog-preview-content .check-list ul {
  list-style: none;
  padding-left: 0;
}

.art-body ul.cross-list,
.art-body .cross-list ul,
.blog-preview-content ul.cross-list,
.blog-preview-content .cross-list ul {
  list-style: none;
  padding-left: 0;
}

.art-body ul.check-list li::before,
.art-body .check-list li::before,
.blog-preview-content ul.check-list li::before,
.blog-preview-content .check-list li::before {
  content: "✓";
  color: var(--callout-success, #16a34a);
  font-weight: 700;
  margin-right: .6rem;
}

.art-body ul.cross-list li::before,
.art-body .cross-list li::before,
.blog-preview-content ul.cross-list li::before,
.blog-preview-content .cross-list li::before {
  content: "✗";
  color: var(--callout-danger, #D32F2F);
  font-weight: 700;
  margin-right: .6rem;
}

/* ── Colonnes ────────────────────────────────────────────────────────────── */

.art-body .columns-2,
.blog-preview-content .columns-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

.art-body .columns-3,
.blog-preview-content .columns-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

@media (max-width: 700px) {
  .art-body .columns-2,
  .blog-preview-content .columns-2,
  .art-body .columns-3,
  .blog-preview-content .columns-3 {
    grid-template-columns: 1fr;
  }
}

/* ── Badges inline ───────────────────────────────────────────────────────── */

.art-body .badge,
.blog-preview-content .badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: .8em;
  font-weight: 600;
  vertical-align: middle;
}

.art-body .badge-red,
.blog-preview-content .badge-red {
  background: rgba(211, 47, 47, 0.15);
  color: var(--color-red);
}

.art-body .badge-gold,
.blog-preview-content .badge-gold {
  background: rgba(255, 193, 7, 0.15);
  color: #996600;
}

[data-theme="dark"] .art-body .badge-gold,
[data-theme="dark"] .blog-preview-content .badge-gold {
  color: var(--color-gold);
}

.art-body .badge-info,
.blog-preview-content .badge-info {
  background: rgba(2, 132, 199, 0.12);
  color: var(--callout-info);
}

/* ── Highlight ───────────────────────────────────────────────────────────── */

.art-body .highlight,
.blog-preview-content .highlight {
  background: rgba(255, 193, 7, 0.2);
  border-radius: 3px;
  padding: 0 3px;
}

/* ── Pastilles FAI (plan 008d) — complète badge-red/gold/info existants ─────── */
/* RC8d-18 : .badge de base existe déjà ci-dessus, ne pas le redéfinir */

.art-body .badge-yas,
.blog-preview-content .badge-yas {
  background: #FFD700; color: #000;
}
.art-body .badge-orange,
.blog-preview-content .badge-orange {
  background: #FF6B00; color: #fff;
}
.art-body .badge-blueline,
.blog-preview-content .badge-blueline {
  background: #0066CC; color: #fff;
}
.art-body .badge-airtel,
.blog-preview-content .badge-airtel {
  background: #E60012; color: #fff;
}
.art-body .badge-starlink,
.blog-preview-content .badge-starlink {
  background: #000; color: #fff;
}
.art-body .badge-success,
.blog-preview-content .badge-success {
  background: rgba(22, 163, 74, 0.15); color: #16a34a;
}
.art-body .badge-warning,
.blog-preview-content .badge-warning {
  background: rgba(245, 158, 11, 0.15); color: #b45309;
}
.art-body .badge-danger,
.blog-preview-content .badge-danger {
  background: rgba(211, 47, 47, 0.15); color: var(--color-red);
}

[data-theme="dark"] .art-body .badge-success,
[data-theme="dark"] .blog-preview-content .badge-success {
  color: #4ade80;
}
[data-theme="dark"] .art-body .badge-warning,
[data-theme="dark"] .blog-preview-content .badge-warning {
  color: #fbbf24;
}

/* ── CTA button (plan 008d) ─────────────────────────────────────────────────── */

.art-body .cta-button,
.blog-preview-content .cta-button {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .15s, transform .15s;
}
.art-body .cta-button:hover,
.blog-preview-content .cta-button:hover {
  opacity: .9; transform: translateY(-2px);
}
.art-body .cta-button-primary,
.blog-preview-content .cta-button-primary {
  background: var(--color-red); color: #fff;
}
.art-body .cta-button-secondary,
.blog-preview-content .cta-button-secondary {
  background: var(--bg-surface-2, #f5f5f5);
  color: var(--text-main);
  border: 1px solid var(--border-color, #e0e0e0);
}

/* ── Alert-box legacy (plan 008d, équivalent callout pour imports HTML) ─────── */

.art-body .alert-box,
.blog-preview-content .alert-box {
  background: var(--callout-tip-bg);
  border-left: 5px solid var(--callout-tip);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
  color: var(--text-main);
}
.art-body .alert-box-info,
.blog-preview-content .alert-box-info {
  background: var(--callout-info-bg); border-left-color: var(--callout-info);
}
.art-body .alert-box-warning,
.blog-preview-content .alert-box-warning {
  background: var(--callout-warning-bg); border-left-color: var(--callout-warning);
}
.art-body .alert-box-success,
.blog-preview-content .alert-box-success {
  background: var(--callout-success-bg); border-left-color: var(--callout-success);
}
.art-body .alert-box-danger,
.blog-preview-content .alert-box-danger {
  background: var(--callout-danger-bg); border-left-color: var(--callout-danger);
}
