/* Figures d'articles, recolorées Silex (maquette v3) */
/* Neth Académie · illustrations d'articles du blogue (blocs HTML insérés dans les articles Wix).
   Charte : rouge #097b99 dosé (≤ 10 %), encre, papier, ardoise ; Archivo (titres), IBM Plex Sans (texte), Plex Mono (étiquettes) ;
   pente de 7,8° des cases et boutons. Toutes les classes commencent par « nf » pour ne jamais entrer en conflit avec le site. */

.nf {
  --r: #097b99;
  --rt: #eaf6fb;
  --ink: #111114;
  --ink2: #2a2a30;
  --mut: #5a5a63;
  --line: #e1e8ee;
  --pap: #f4f9fb;
  --sl: #0a3a45;
  --chalk: #efede7;
  --rl: #3fb3d4;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink2);
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  margin: 32px 0;
  padding: 22px 22px 18px;
  box-sizing: border-box;
  line-height: 1.45;
  font-size: 16px;
}
.nf *,
.nf *::before,
.nf *::after {
  box-sizing: border-box;
}
.nf p,
.nf li {
  max-width: none;
}
.nf p {
  margin-top: 0;
}
.nf.pap {
  background: var(--pap);
}
.nf .nf-k {
  font-family: Inter, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--r);
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
}
.nf .nf-k::before {
  content: '';
  width: 12px;
  height: 12px;
  background: currentColor;
  clip-path: polygon(32% 0, 71% 0, 100% 100%, 0 100%);
  flex: none;
}
.nf .nf-t {
  font-family: Inter, sans-serif;
  font-weight: 850;
  font-size: clamp(19px, 3.2vw, 24px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 14px;
  text-wrap: balance;
}
.nf .nf-t em {
  font-style: normal;
  color: var(--r);
}
.nf .nf-d {
  font-size: 15px;
  color: var(--mut);
  margin: 0 0 14px;
}
.nf .nf-src {
  font-family: Inter, monospace;
  font-size: 11.5px;
  color: var(--mut);
  margin: 14px 0 0;
  letter-spacing: 0.02em;
}
.nf b,
.nf strong {
  color: var(--ink);
  font-weight: 600;
}
.nf .r {
  color: var(--r);
}

/* Ardoise : une seule par article, pour « À retenir » */
.nf.sl {
  background: var(--sl);
  border-color: var(--sl);
  color: var(--chalk);
}
.nf.sl .nf-t,
.nf.sl b,
.nf.sl strong {
  color: #fff;
}
.nf.sl .nf-k,
.nf.sl .nf-t em,
.nf.sl .r {
  color: var(--rl);
}
.nf.sl .nf-src,
.nf.sl .nf-d {
  color: #a9abb3;
}

/* Échelle de niveaux (4e année → sec. 5), cases en parallélogramme */
.nf-lv {
  display: grid;
  grid-template-columns: repeat(var(--n, 8), 1fr);
  gap: 4px;
  margin: 6px 0 2px;
}
.nf-lv span {
  font-family: Inter, sans-serif;
  font-weight: 800;
  font-size: clamp(12px, 2.6vw, 20px);
  text-align: center;
  padding: 10px 0;
  border: 2px solid var(--line);
  color: var(--ink);
  transform: skewX(-7.8deg);
  background: #fff;
}
.nf-lv span > i {
  display: inline-block;
  transform: skewX(7.8deg);
  font-style: normal;
}
.nf-lv .on {
  background: var(--r);
  border-color: var(--r);
  color: #fff;
}
.nf-lv .out {
  border-color: var(--r);
  color: var(--r);
}
.nf-lv .dim {
  color: #b5b5b0;
}
.nf-arc {
  display: block;
  width: 100%;
  height: 34px;
  margin-top: -2px;
}
.nf-lvcap {
  display: flex;
  justify-content: space-between;
  font-family: Inter, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--mut);
  text-transform: uppercase;
}

/* Barres horizontales (comparaisons chiffrées) */
.nf-bars {
  display: grid;
  gap: 10px;
  margin: 4px 0;
}
.nf-bar {
  display: grid;
  grid-template-columns: minmax(96px, 34%) 1fr;
  gap: 12px;
  align-items: center;
}
.nf-bar > span:first-child {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.2;
}
.nf-bar .tr {
  position: relative;
  height: 26px;
  background: var(--pap);
}
.nf.pap .nf-bar .tr {
  background: #fff;
}
.nf-bar .fl {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--a, 0%);
  width: var(--w, 50%);
  background: var(--ink);
}
.nf-bar .fl.r {
  background: var(--r);
}
.nf-bar .fl.g {
  background: #b5b5b0;
}
.nf-bar .v {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 6px;
  font-family: Inter, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

/* Étapes numérotées */
.nf-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 3px solid var(--ink);
  counter-reset: s;
}
.nf-steps li {
  counter-increment: s;
  position: relative;
  padding: 12px 0 12px 48px;
  border-bottom: 2px solid var(--line);
  margin: 0;
  font-size: 15.5px;
}
.nf-steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 14px;
  font-family: Inter, monospace;
  font-weight: 600;
  font-size: 14px;
  color: var(--r);
}
.nf-steps li b {
  display: block;
  font-family: Inter, sans-serif;
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 2px;
}
.nf.sl .nf-steps {
  border-top-color: #fff;
}
.nf.sl .nf-steps li {
  border-bottom-color: #2e3139;
}

/* Deux ou trois colonnes à comparer */
.nf-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.nf-col {
  border: 1px solid var(--line);
  padding: 14px;
  background: #fff;
}
.nf-col h4 {
  font-family: Inter, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mut);
  margin: 0 0 8px;
}
.nf-col.no {
  border-top: 3px solid #b5b5b0;
}
.nf-col.ok {
  border-top: 3px solid var(--r);
}
.nf-col.ok h4 {
  color: var(--r);
}
.nf-col p {
  margin: 0 0 6px;
  font-size: 15px;
}
.nf-col ul {
  margin: 0;
  padding-left: 18px;
}
.nf-col li {
  font-size: 15px;
  margin: 0 0 4px;
}

/* Liste à cocher */
.nf-ck {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nf-ck li {
  position: relative;
  padding: 8px 0 8px 34px;
  border-bottom: 1px solid var(--line);
  margin: 0;
  font-size: 15.5px;
}
.nf-ck li:last-child {
  border-bottom: 0;
}
.nf-ck li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 20px;
  height: 20px;
  background: var(--r)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='square'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center/16px no-repeat;
}
.nf-ck.x li::before {
  background: #b5b5b0
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='square'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E")
    center/14px no-repeat;
}

/* Calcul ou démarche (maths lisibles) */
.nf-calc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-family: Inter, sans-serif;
  font-weight: 800;
  color: var(--ink);
}
.nf-calc .b {
  border: 2px solid var(--ink);
  padding: 10px 14px;
  text-align: center;
  min-width: 92px;
  background: #fff;
}
.nf-calc .b small {
  display: block;
  font-family: Inter, monospace;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mut);
}
.nf-calc .b.r {
  border-color: var(--r);
  color: var(--r);
}
.nf-calc .op {
  font-size: 26px;
  color: var(--mut);
}
.nf-calc .big {
  font-size: clamp(26px, 5vw, 36px);
  line-height: 1;
}
.nf-work {
  font-family: Inter, monospace;
  font-size: 15px;
  line-height: 1.7;
  background: var(--pap);
  padding: 12px 14px;
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink);
}
.nf-work .x {
  color: var(--r);
  text-decoration: line-through;
}
.nf-work .ok {
  color: var(--r);
  font-weight: 600;
}
.nf-note {
  font-size: 14px;
  color: var(--mut);
  margin: 8px 0 0;
}

/* Bandes de fractions (partage d'un tout) */
.nf-fr {
  display: grid;
  gap: 8px;
}
.nf-frow {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
}
.nf-frow > b {
  font-family: Inter, sans-serif;
  font-size: 20px;
  font-weight: 800;
  text-align: right;
}
.nf-frow > div {
  display: grid;
  grid-template-columns: repeat(var(--d), 1fr);
  height: 30px;
  border: 2px solid var(--ink);
  background: #fff;
}
.nf-frow > div > i {
  border-right: 1px solid var(--ink);
}
.nf-frow > div > i:last-child {
  border-right: 0;
}
.nf-frow > div > i.f {
  background: var(--ink);
}
.nf-frow > div > i.f.r {
  background: var(--r);
}

/* Droite numérique */
.nf-nl {
  position: relative;
  height: 74px;
  margin: 8px 10px 0;
}
.nf-nl::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 30px;
  height: 3px;
  background: var(--ink);
}
.nf-nl span {
  position: absolute;
  top: 22px;
  left: var(--x);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: Inter, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.nf-nl span::before {
  content: '';
  width: 3px;
  height: 19px;
  background: var(--ink);
  margin-bottom: 6px;
}
.nf-nl span.r {
  color: var(--r);
}
.nf-nl span.r::before {
  background: var(--r);
  width: 4px;
  height: 26px;
  margin-top: -7px;
}
.nf-nl span.up {
  top: -4px;
  flex-direction: column-reverse;
}
.nf-nl span.up::before {
  margin: 6px 0 0;
}

/* Tableau */
.nf-tb {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.nf-tb th {
  font-family: Inter, monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mut);
  text-align: left;
  border-bottom: 3px solid var(--ink);
  padding: 8px 8px 8px 0;
}
.nf-tb td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px 9px 0;
  vertical-align: top;
  color: var(--ink2);
}
.nf-tb td:first-child {
  color: var(--ink);
  font-weight: 600;
}
.nf-tb tr.hl td {
  background: var(--rt);
}
.nf-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Grand chiffre */
.nf-num {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}
.nf-num > b {
  font-family: Inter, sans-serif;
  font-weight: 900;
  font-size: clamp(44px, 9vw, 72px);
  letter-spacing: -0.06em;
  line-height: 0.9;
  color: var(--r);
}
.nf-num > p {
  margin: 0;
  font-size: 16px;
}

/* Encadré « En bref » (réponse directe en tête d'article) */
.nf.brief {
  border-top-color: var(--r);
}
.nf.brief ul {
  margin: 0;
  padding-left: 18px;
}
.nf.brief li {
  margin: 0 0 6px;
  font-size: 16px;
}

@media (max-width: 520px) {
  .nf {
    padding: 18px 14px 14px;
    margin: 26px -4px;
  }
  .nf-bar {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .nf-frow {
    grid-template-columns: 44px 1fr;
  }
  .nf-lv {
    gap: 2px;
  }
  .nf-lv span {
    padding: 8px 0;
    border-width: 1.5px;
  }
}

/* Axe sous les barres (échelle en $ ou en %) */
.nf-axis {
  display: grid;
  grid-template-columns: minmax(96px, 34%) 1fr;
  gap: 12px;
  margin-top: 6px;
}
.nf-axis > div {
  display: flex;
  justify-content: space-between;
  font-family: Inter, monospace;
  font-size: 11px;
  color: var(--mut);
  border-top: 1px solid var(--ink);
  padding-top: 4px;
}
@media (max-width: 520px) {
  .nf-axis {
    grid-template-columns: 1fr;
  }
  .nf-axis > span {
    display: none;
  }
}
@media (max-width: 520px) {
  .nf-calc {
    gap: 8px;
  }
  .nf-calc .b {
    min-width: 0;
    padding: 8px 10px;
  }
  .nf-calc .op {
    font-size: 20px;
  }
}
