/*
 * article.css — DCVisuals
 * CSS dédié aux pages articles
 * Conçu pour être lisible sur tous écrans, compatible avec main.css existant.
 *
 * Principes :
 * - Taille de texte body montée à 18px (19px sur desktop)
 * - Largeur de colonne 68ch max (optimum lecture ~600ms/ligne)
 * - Espacement généreux entre sections
 * - Hiérarchie typographique claire H1 > H2 > H3
 * - Tables, code, et notes de source stylés proprement
 */

/* ══════════════════════════════════════════
   CONTAINER ARTICLE
   ══════════════════════════════════════════ */

.article-body {
  max-width: 720px;
  font-size: 1.05rem;      /* ~19px sur base 18px */
  line-height: 1.82;
  color: var(--t1);
}

/* ══════════════════════════════════════════
   TYPOGRAPHIE — TITRES
   ══════════════════════════════════════════ */

.article-body h1 {
  font-family: var(--ffd);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--t1);
  margin: 0 0 1.2rem 0;
  letter-spacing: -.02em;
}

.article-body h2 {
  font-family: var(--ffd);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--t1);
  margin: 3rem 0 .9rem 0;
  padding-top: 0;
  letter-spacing: -.01em;
}

/* Ligne ambre avant les H2 */
.article-body h2::before {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: var(--amber);
  margin-bottom: .65rem;
  opacity: .7;
}

.article-body h3 {
  font-family: var(--ffd);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--t1);
  margin: 2rem 0 .6rem 0;
}

/* ══════════════════════════════════════════
   PARAGRAPHES ET LISTES
   ══════════════════════════════════════════ */

.article-body p {
  margin: 0 0 1.25rem 0;
  max-width: 68ch;        /* largeur optimale de lecture */
  color: var(--t2);
}

/* Premier paragraphe après H1 (réponse GEO directe) */
.article-body > p:first-of-type,
.article-body h1 + p {
  font-size: 1.08rem;
  color: var(--t1);
  line-height: 1.75;
  font-weight: 400;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4rem;
  margin: 0 0 1.25rem 0;
  max-width: 66ch;
}

.article-body li {
  margin-bottom: .45rem;
  color: var(--t2);
  line-height: 1.7;
}

.article-body li::marker {
  color: var(--amber);
}

/* ══════════════════════════════════════════
   EMPHASE ET CODE
   ══════════════════════════════════════════ */

.article-body strong {
  color: var(--t1);
  font-weight: 600;
}

.article-body em {
  color: var(--t2);
  font-style: italic;
}

.article-body code {
  font-family: var(--ffm);
  font-size: .85em;
  background: var(--s2);
  border: 1px solid var(--br);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--amber);
  white-space: nowrap;
}

.article-body pre {
  background: var(--s2);
  border: 1px solid var(--br);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--t1);
  font-size: .88rem;
  white-space: pre;
}

/* ══════════════════════════════════════════
   TABLEAUX
   ══════════════════════════════════════════ */

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  font-size: .9rem;
  border: 1px solid var(--br);
  border-radius: 10px;
  overflow: hidden;   /* arrondir les coins */
}

.article-body th {
  background: var(--s2);
  padding: 11px 16px;
  text-align: left;
  font-family: var(--ffm);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--t3);
  border-bottom: 1px solid var(--br);
}

.article-body td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--br);
  color: var(--t2);
  line-height: 1.55;
  vertical-align: top;
}

.article-body tr:last-child td {
  border-bottom: none;
}

.article-body tr:nth-child(even) td {
  background: rgba(255,255,255,.018);
}

/* ══════════════════════════════════════════
   SÉPARATEURS
   ══════════════════════════════════════════ */

.article-body hr {
  border: none;
  border-top: 1px solid var(--br);
  margin: 2.5rem 0;
  opacity: .5;
}

/* ══════════════════════════════════════════
   LIENS
   ══════════════════════════════════════════ */

.article-body a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(200,145,42,.3);
  transition: border-color .15s;
}

.article-body a:hover {
  border-color: var(--amber);
}

/* ══════════════════════════════════════════
   META ARTICLE (auteur, date, catégorie)
   ══════════════════════════════════════════ */

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 2.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--br);
}

.article-meta span {
  font-family: var(--ffm);
  font-size: .62rem;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .09em;
}

.article-meta .meta-author {
  color: var(--amber);
  font-weight: 500;
}

.article-meta .meta-date::before { content: ''; }

/* ══════════════════════════════════════════
   BLOC SOURCES (en bas d'article)
   ══════════════════════════════════════════ */

.article-sources {
  margin-top: 3rem;
  padding: 16px 20px;
  background: var(--s2);
  border: 1px solid var(--br);
  border-radius: 10px;
  font-family: var(--ffm);
  font-size: .68rem;
  color: var(--t3);
  line-height: 1.7;
}

.article-sources strong {
  color: var(--t2);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

/* ══════════════════════════════════════════
   ARTICLES LIÉS
   ══════════════════════════════════════════ */

.article-related {
  margin-top: 3rem;
  padding: 22px 26px;
  background: var(--raised);
  border: 1px solid var(--br);
  border-radius: 12px;
}

.article-related h3 {
  font-family: var(--ffm);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--t3);
  margin: 0 0 16px 0;
}

.article-related h3::before { display: none; } /* désactiver le ::before des H3 */

.article-related ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-related li {
  margin: 0;
}

.article-related a {
  color: var(--t1);
  font-size: .9rem;
  font-weight: 500;
  border-bottom: none;
  transition: color .15s;
}

.article-related a:hover {
  color: var(--amber);
  border-bottom: none;
}

/* ══════════════════════════════════════════
   OUTILS LIÉS
   ══════════════════════════════════════════ */

.article-tools {
  margin-top: 1.5rem;
  padding: 22px 26px;
  background: var(--raised);
  border: 1px solid var(--br);
  border-radius: 12px;
}

.article-tools h3 {
  font-family: var(--ffm);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--t3);
  margin: 0 0 16px 0;
}

.article-tools h3::before { display: none; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.tool-card {
  padding: 14px 16px;
  background: var(--s2);
  border: 1px solid var(--br);
  border-radius: 10px;
  transition: border-color .15s;
}

.tool-card:hover {
  border-color: rgba(200,145,42,.3);
}

.tool-card-name {
  display: block;
  font-family: var(--ffd);
  font-size: .9rem;
  color: var(--t1);
  font-weight: 600;
  margin-bottom: 5px;
  text-decoration: none;
  border-bottom: none;
}

.tool-card-name:hover {
  color: var(--amber);
}

.tool-card-reason {
  font-size: .75rem;
  color: var(--t3);
  margin: 0;
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   BLOC AUTEUR
   ══════════════════════════════════════════ */

.article-author-block {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-top: 3rem;
  padding: 20px 22px;
  background: var(--raised);
  border: 1px solid var(--br);
  border-radius: 12px;
}

.article-author-block img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--br);
}

.article-author-info strong {
  display: block;
  font-family: var(--ffd);
  font-size: .95rem;
  color: var(--t1);
  margin-bottom: 3px;
}

.article-author-info span {
  font-family: var(--ffm);
  font-size: .65rem;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.article-author-info p {
  font-size: .82rem;
  color: var(--t2);
  margin: 8px 0 0 0;
  line-height: 1.6;
  max-width: 480px;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 720px) {
  .article-body {
    font-size: 1rem;
  }

  .article-body h1 {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .article-body h2 {
    font-size: 1.25rem;
    margin-top: 2.2rem;
  }

  .article-body table {
    font-size: .82rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .article-author-block {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .article-body h1 { font-size: 1.55rem; }
  .article-body th, .article-body td { padding: 9px 12px; }
}
