/* Ma Trading — « Comment ça marche », le guide de l'élève débutant.
   Feuille séparée (jamais de style en ligne) : la CSP verrouillée sur 'self'
   bloquerait un <style> sans le moindre message d'erreur visible. */
@import url("/fonts/fonts.css");

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0a0b;
  --bg2: #0f0f11;
  --bg3: #141417;
  --line: rgba(255, 255, 255, .08);
  --txt: #f4f3f0;
  --muted: #86837c;
  --orange: #f37021;
  --glow: rgba(243, 112, 33, .30);
  --red: #d64836;
  --blue: #4d90e0;
}
body {
  background: var(--bg); color: var(--txt);
  font: 400 16px/1.7 "Schibsted Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px;
}

/* ---------- barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 22px; background: rgba(10, 10, 11, .92);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
}
.mark { font-family: "Fraunces", Georgia, serif; font-size: 19px; }
.mark i { color: var(--orange); font-style: italic; }
.topbar .back {
  margin-left: auto; color: var(--orange); text-decoration: none;
  border: 1px solid var(--orange); border-radius: 8px; padding: 6px 14px; font-size: 14px;
}
.topbar .back:hover { background: var(--orange); color: var(--bg); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 22px; }

/* ---------- ouverture ---------- */
.hero { padding: 56px 0 34px; text-align: center; border-bottom: 1px solid var(--line); }
.hero .kicker {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--orange);
}
.hero h1 {
  font-family: "Fraunces", Georgia, serif; font-weight: 500;
  font-size: clamp(30px, 6vw, 44px); line-height: 1.15; margin: 12px 0 14px;
}
.hero h1 i { color: var(--orange); font-style: italic; }
.hero p { color: var(--muted); max-width: 540px; margin: 0 auto; }

/* ---------- sommaire ---------- */
.toc { margin: 30px 0 10px; display: grid; gap: 8px; }
.toc a {
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg2); color: var(--txt); text-decoration: none;
}
.toc a:hover { border-color: var(--orange); }
.toc b { color: var(--orange); font-variant-numeric: tabular-nums; }
.toc small { color: var(--muted); margin-left: auto; text-align: right; }

/* ---------- sections ---------- */
section { padding: 42px 0 8px; scroll-margin-top: 70px; }
section + section { border-top: 1px solid var(--line); }
h2 {
  font-family: "Fraunces", Georgia, serif; font-weight: 500;
  font-size: clamp(23px, 4.5vw, 30px); line-height: 1.25; margin-bottom: 8px;
}
h2 .num { color: var(--orange); font-size: .6em; vertical-align: .35em; margin-right: 10px; }
h3 { font-size: 17px; margin: 26px 0 8px; color: var(--txt); }
p { margin-bottom: 14px; }
p.lead { color: var(--muted); margin-bottom: 22px; }
strong { color: #fff; font-weight: 600; }
a { color: var(--orange); }

/* ---------- étapes numérotées ---------- */
ol.steps { list-style: none; counter-reset: s; display: grid; gap: 14px; margin: 18px 0 24px; }
ol.steps li {
  counter-increment: s; position: relative; padding: 14px 16px 14px 54px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
}
ol.steps li::before {
  content: counter(s);
  position: absolute; left: 14px; top: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--orange); color: var(--bg);
  font-size: 13px; font-weight: 700; display: grid; place-items: center;
}
/* `> li > b` et non `b` : le titre de l'étape est un bloc, mais un <b> DANS
   la phrase (« reste sur Marché ») doit rester inline — sinon il casse le
   paragraphe en trois morceaux et la phrase devient illisible. */
ol.steps > li > b { display: block; color: #fff; margin-bottom: 2px; }
ol.steps p:last-child { margin-bottom: 0; }

/* ---------- lexique ---------- */
dl.lex { display: grid; gap: 2px; margin: 18px 0 24px; }
dl.lex > div {
  padding: 15px 17px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 10px;
}
dl.lex dt { color: var(--orange); font-weight: 600; margin-bottom: 4px; }
dl.lex dd { color: var(--muted); }
dl.lex dd .ex { display: block; margin-top: 7px; color: var(--txt); font-size: 14.5px; }

/* ---------- encadrés ---------- */
.note, .warn {
  padding: 15px 18px; border-radius: 10px; margin: 20px 0;
  border: 1px solid var(--line); background: var(--bg2);
}
.warn { border-color: rgba(214, 72, 54, .45); background: rgba(214, 72, 54, .07); }
/* même raison : seul le titre de l'encadré est un bloc */
.note > b, .warn > b { display: block; color: #fff; margin-bottom: 4px; }
.note p:last-child, .warn p:last-child { margin-bottom: 0; }

/* ---------- boutons cités dans le texte ---------- */
.k {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: var(--bg3); border: 1px solid var(--line);
  font-size: 13.5px; color: var(--txt); white-space: nowrap;
}
.k.buy { color: var(--blue); border-color: rgba(77, 144, 224, .4); }
.k.sell { color: var(--red); border-color: rgba(214, 72, 54, .4); }

/* ---------- tableau ---------- */
.tablewrap { overflow-x: auto; margin: 18px 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 420px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
td b { color: #fff; }

ul.plain { list-style: none; display: grid; gap: 9px; margin: 14px 0 20px; }
ul.plain li { padding-left: 20px; position: relative; color: var(--muted); }
ul.plain li::before { content: "—"; position: absolute; left: 0; color: var(--orange); }
ul.plain li b { color: var(--txt); }

/* ---------- pied ---------- */
footer {
  margin-top: 50px; padding: 26px 0 10px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13.5px; text-align: center;
}
footer .disclaim { margin-top: 10px; font-size: 12.5px; }

@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 16px; }
  .toc small { display: none; }
}
