/* ============================================================
   le-magnesium.fr - Redesign Claude Design "Limpide"
   Bleu clinique + Plus Jakarta Sans + Instrument Serif italic + Geist Mono
   Axe : editorial-clinique-grand public (lumineux, sobre, scientifique)
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --maxw: 1280px;
  --gutter: 28px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Bleu clinique */
  --bg:            #ffffff;
  --bg-2:          #f4f7fa;
  --bg-3:          #eef5e9;
  --surface:       #f4f7fa;
  --surface-2:     #e9eff5;
  --border:        #dde6ee;
  --border-strong: #b9c8d6;
  --line:          #dde6ee;
  --line-soft:     #ecf1f6;

  --text:          #0b1f2e;
  --text-2:        #324a5e;
  --text-mute:     #5e7689;
  --muted:         #8597a6;

  --accent:        #2b7cb8;
  --accent-2:      #d6ecf7;
  --accent-3:      #0e4a73;
  --accent-deep:   #0e4a73;
  --accent-ink:    #ffffff;
  --ink:           #0b1f2e;

  --mint:          #cfe8df;
  --warn:          #d97a3a;

  --good:          #2c8a5e;
  --bad:           #c54a3a;

  --font-sans:    "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --font-mono:    "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --display-tracking: -0.02em;

  --shadow-sm: 0 1px 0 rgba(11,31,46,.04);
  --shadow:    0 14px 44px -18px rgba(11,31,46,.18);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  letter-spacing: var(--display-tracking);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: clamp(38px, 5vw, 64px); line-height: 1.04; font-weight: 700; }
h2 { font-size: clamp(26px, 3.2vw, 40px); line-height: 1.12; font-weight: 700; }
h3 { font-size: clamp(20px, 1.7vw, 24px); line-height: 1.25; letter-spacing: -0.01em; font-weight: 600; }
h4 { font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }

.ital { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--accent-3); letter-spacing: 0; }
.ital-light { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: 0; }

p { color: var(--text-2); }
.lede { font-size: 19px; color: var(--text-2); max-width: 60ch; line-height: 1.65; }
.mono { font-family: var(--font-mono); font-size: 0.9em; letter-spacing: -0.01em; }

/* ---------- Layout ---------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { width: 100%; max-width: 840px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(56px, 7vw, 112px) 0; }
.section-sm { padding: clamp(36px, 4vw, 56px) 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; letter-spacing: 0;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
  border: 1px solid transparent; white-space: nowrap; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: var(--accent-3); border-color: var(--accent-3); color: #fff; }
.btn-accent  { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 6px 18px -8px rgba(43,124,184,.6); }
.btn-accent:hover { background: var(--accent-3); border-color: var(--accent-3); color: #fff; }
.btn-secondary, .btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover, .btn-ghost:hover { background: var(--bg-2); border-color: var(--border-strong); }
.btn-soft { background: var(--surface); color: var(--text); }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.invert .btn-primary { background: var(--bg); color: var(--text); border-color: var(--bg); }
.invert .btn-primary:hover { background: #fff; border-color: #fff; }

/* ---------- Cards & surfaces ---------- */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.card-hover { transition: border-color .18s, transform .18s, box-shadow .18s; }
.card-hover:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.surface-2 { background: var(--surface-2); }
.hairline { border: 1px solid var(--border); }
.divider { height: 1px; background: var(--border); width: 100%; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-family: var(--font-sans);
}
.pill-mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.04em; text-transform: none; }
.pill-accent { background: var(--accent-2); color: var(--accent-3); border-color: #b8dcf0; }
.pill-good { background: #d6f0e3; color: var(--good); border-color: #b8e3cb; }
.pill-warn { background: #fbe9d6; color: var(--warn); border-color: #f1cfa8; }
.pill-bad  { background: #f6d8d2; color: var(--bad); border-color: #ecbab1; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow .2s, background .2s;
}
.nav.is-scrolled { box-shadow: 0 1px 0 var(--border); background: rgba(255,255,255,.95); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.nav-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; letter-spacing: -0.02em;
  color: var(--text);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 800;
  letter-spacing: -0.04em; flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 6px 16px -6px rgba(43,124,184,.55);
}
.brand-name { white-space: nowrap; }
.nav-links { display: flex; gap: 4px; flex: 1; justify-content: center; }
.nav-links a {
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-2); cursor: pointer; font-weight: 500;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-cta { display: flex; gap: 10px; align-items: center; }
.nav-burger { display: none; }

/* ---------- Footer ---------- */
.footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--text); color: #cbd6e0; padding: 72px 0 36px; }
.footer .nav-logo { color: #fff; }
.footer .brand-name { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 36px; }
.footer h5 { font-size: 11px; font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: #8da4b8; margin-bottom: 16px; font-weight: 500; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.footer ul a { color: #cbd6e0; font-size: 14px; }
.footer ul a:hover { color: #fff; }
.footer .text-mute { color: #8da4b8 !important; }
.footer-base { margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #8da4b8; font-family: var(--font-mono); gap: 16px; flex-wrap: wrap; }
.footer-disclaimer { margin-top: 18px; padding: 14px 16px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius-sm); font-size: 11.5px; color: #a5b7c8; line-height: 1.55; }
.footer-disclaimer strong { color: #d8e1ea; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); padding: 18px 0 0; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span.sep { opacity: .5; }

/* ---------- Score / bars ---------- */
.score { display: inline-flex; align-items: baseline; gap: 4px; font-weight: 700; }
.score-big { font-size: 44px; line-height: 1; color: var(--accent-3); font-family: var(--font-sans); font-weight: 700; }
.score-med { font-size: 26px; color: var(--accent-3); font-family: var(--font-sans); font-weight: 700; }
.score-denom { color: var(--text-mute); font-size: .42em; font-weight: 500; font-family: var(--font-mono); }
.rank { font-family: var(--font-display); font-style: italic; font-size: 26px; font-weight: 500; color: var(--accent); }
.bar { position: relative; height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 999px; }

/* ---------- Placeholder image ---------- */
.placeholder {
  position: relative;
  background: repeating-linear-gradient(135deg, #e8f1f8 0 14px, #f4f7fa 14px 28px);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute); font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; overflow: hidden;
}

/* ---------- Stat block ---------- */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-family: var(--font-sans); font-size: clamp(28px, 3vw, 34px); font-weight: 700; color: var(--text); line-height: 1; letter-spacing: -0.02em; }
.stat-num .unit { font-size: .5em; color: var(--text-mute); margin-left: 4px; font-weight: 500; font-family: var(--font-mono); }
.stat-lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--text-mute); }

/* ---------- helpers ---------- */
.accent { color: var(--accent); }
.text-mute { color: var(--text-mute); }
.text-2 { color: var(--text-2); }
.mono-num { font-family: var(--font-mono); font-feature-settings: "tnum"; }

.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 56px; gap: 24px; flex-wrap: wrap; }
.section-head .left { max-width: 64ch; }
.section-head h2 { margin-top: 16px; }

.banner { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 32px; }

/* ============================================================
   Easy TOC injecte (#ez-toc-container) - Restyle DA Limpide.
   Masque sur les articles (la sidebar .toc le remplace).
   ============================================================ */
.lmag-redesign #ez-toc-container { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px 24px; margin:0 0 32px; max-width:760px; width:auto; float:none; box-shadow:none; }
.lmag-redesign .ez-toc-title-container { margin:0 0 12px; }
.lmag-redesign .ez-toc-title { font-family:var(--font-mono); font-size:11px; text-transform:uppercase; letter-spacing:.1em; color:var(--text-mute); font-weight:500; }
.lmag-redesign #ez-toc-container nav > ul, .lmag-redesign .ez-toc-list { list-style:none; margin:0; padding:0; }
.lmag-redesign .ez-toc-list ul { list-style:none; margin:4px 0 0 16px; padding:0; }
.lmag-redesign .ez-toc-list li { margin:0 0 7px; }
.lmag-redesign .ez-toc-link { color:var(--text-2); text-decoration:none; border:0; font-size:14.5px; line-height:1.5; }
.lmag-redesign .ez-toc-link:hover { color:var(--accent); }
.lmag-redesign .ez-toc-toggle, .lmag-redesign .ez-toc-js-icon-con, .lmag-redesign .ez-toc-title-toggle .ez-toc-pull-right { display:none !important; }

/* ============================================================
   OVERLAY pages WP rendues par Astra (passthrough)
   ============================================================ */
body.lmag-redesign .prose { color: var(--text-2); font-size: 17px; line-height: 1.75; }
body.lmag-redesign .prose p { margin-bottom: 18px; }
body.lmag-redesign .prose h2 { margin: 40px 0 16px; font-size: clamp(26px, 2.4vw, 34px); color: var(--text); }
body.lmag-redesign .prose h3 { margin: 32px 0 12px; color: var(--text); }
body.lmag-redesign .prose ul, body.lmag-redesign .prose ol { margin: 0 0 18px 24px; color: var(--text-2); }
body.lmag-redesign .prose li { margin-bottom: 8px; }
body.lmag-redesign .prose blockquote { margin: 24px 0; padding: 18px 22px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; color: var(--text); }
body.lmag-redesign .prose strong { color: var(--text); }
body.lmag-redesign .prose a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-2); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
body.lmag-redesign .prose a:hover { color: var(--accent-3); text-decoration-color: var(--accent); }

/* Callout */
.callout { padding: 18px 22px; border-radius: var(--radius); background: var(--accent-2); border: 1px solid #b8dcf0; color: var(--text); margin: 22px 0; }
.callout .lbl { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-3); margin-bottom: 6px; font-weight: 600; }

/* Quiz */
.quiz-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius-lg); padding: clamp(28px,4vw,48px); box-shadow: 0 30px 80px -30px rgba(11,31,46,.12); }
.quiz-progress { height:4px; background:var(--line); border-radius:4px; overflow:hidden; margin-bottom: 32px; }
.quiz-progress-fill { height:100%; background:var(--accent); border-radius:4px; transition: width .3s ease-out; }
.quiz-option { display:flex; align-items:center; gap:16px; padding:18px 22px; border:1px solid var(--line); background:#fff; border-radius:12px; font-size:16px; text-align:left; cursor:pointer; color:var(--text); width:100%; transition: border-color .15s, background .15s; }
.quiz-option:hover { border-color: var(--accent); background: var(--accent-2); }
.quiz-option.active { border-color: var(--accent); background: var(--accent-2); }
.quiz-radio { width:24px; height:24px; border-radius:50%; border:2px solid var(--line); background: transparent; display:grid; place-items:center; flex-shrink:0; }
.quiz-option.active .quiz-radio { border-color: var(--accent); background: var(--accent); }
.quiz-option.active .quiz-radio::after { content:""; width:10px; height:10px; border-radius:50%; background:#fff; }

/* ---------- Mobile (390px-ish) ---------- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: 28px; }
}
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-links { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; background: #fff; border-bottom: 1px solid var(--border); padding: 8px var(--gutter) 16px; gap: 2px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; border-radius: var(--radius-sm); }
  .nav-burger { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
  .brand-name { display: none; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
