:root {
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --text: #1c1e21;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-light: #eff4ff;
  --on-primary: #ffffff;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a;
    --card-bg: #1e2126;
    --text: #f0f1f3;
    --text-muted: #9aa0ab;
    --border: #2c3036;
    --primary: #5b8def;
    --primary-light: #1c2636;
    --on-primary: #0e1116;
  }
}

:root[data-theme="dark"] {
  --bg: #14161a;
  --card-bg: #1e2126;
  --text: #f0f1f3;
  --text-muted: #9aa0ab;
  --border: #2c3036;
  --primary: #5b8def;
  --primary-light: #1c2636;
  --on-primary: #0e1116;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ---------- Liste des articles ---------- */

.blog-header {
  text-align: center;
  margin-bottom: 28px;
}

.blog-header h1 {
  font-size: 1.8rem;
  margin: 0 0 6px;
}

.subtitle {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.post-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.post-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.post-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.post-title {
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.35;
}

.post-desc {
  color: var(--text-muted);
  font-size: 0.87rem;
  line-height: 1.45;
}

/* ---------- Article ---------- */

.article {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 32px;
  line-height: 1.7;
  font-size: 1.02rem;
}

.article-header h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0 0 8px;
}

.article-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 20px;
}

.article h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 32px 0 10px;
}

.article h3 {
  font-size: 1.08rem;
  margin: 24px 0 8px;
}

.article p,
.article ul,
.article ol {
  margin: 0 0 14px;
}

.article li {
  margin-bottom: 6px;
}

.article .intro {
  font-size: 1.08rem;
  color: var(--text);
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 18px;
  font-size: 0.92rem;
}

.article th,
.article td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.article th {
  color: var(--text-muted);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

.article .note {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 12px 16px;
}

/* ---------- Encart vers l'outil ---------- */

.cta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 28px 0;
  line-height: 1.4;
}

.cta-top {
  margin-top: 0;
}

.cta-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.cta-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 200px;
  min-width: 0;
}

.cta-lead {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cta-title {
  font-weight: 600;
}

.cta-btn {
  display: inline-block;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 10px;
  white-space: nowrap;
}

.cta-btn:hover {
  filter: brightness(1.08);
}

/* ---------- À lire aussi ---------- */

.related {
  margin-top: 28px;
}

.related h2 {
  font-size: 1.1rem;
  margin: 0 0 10px;
}

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

.related a {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
}

.related a:hover {
  border-color: var(--primary);
}

.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 28px;
}

.footer a {
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .article {
    padding: 22px 16px 26px;
  }

  .article-header h1 {
    font-size: 1.45rem;
  }

  .cta-btn {
    width: 100%;
    text-align: center;
  }
}
