/* =====================================================================
   Feuille de style des cours NSI (Quarto) — reprend le rendu des PDF
   Fonds semi-transparents : lisible aussi en thème sombre.
   ===================================================================== */

/* ---- Bloc de titre (équivalent de la boîte de titre du PDF) ---- */
#title-block-header {
  text-align: center;
  border: 1px solid rgba(40, 60, 140, .55);
  border-left: 10px solid #1f2f66;
  border-radius: 4px;
  background: rgba(60, 90, 220, .06);
  padding: .5rem 1rem .6rem;
  margin-bottom: 1.8rem;
}
#title-block-header .quarto-title h1.title { font-weight: 700; margin-bottom: .2rem; }
#title-block-header .subtitle { margin: 0; font-size: 1.3rem; }

/* ---- Boîtes de cours ---- */
.defin, .exemple, .remarque, .attention, .exo, .retenir, .activite {
  margin: 1.1rem 0;
  padding: .55rem 1rem;
  border-radius: 3px;
}
.defin > :first-child, .exemple > :first-child, .remarque > :first-child,
.attention > :first-child, .exo > :first-child, .retenir > :first-child,
.activite > :first-child { margin-top: 0; }
.defin > :last-child, .exemple > :last-child, .remarque > :last-child,
.attention > :last-child, .exo > :last-child, .retenir > :last-child,
.activite > :last-child { margin-bottom: 0; }

/* Définitions : filet vert, texte en italique */
.defin { border-left: 4px solid #1f8a3b; background: rgba(40, 160, 70, .06); font-style: italic; }
.defin strong, .defin code, .defin .bi { font-style: normal; }

/* Exemples : filet gris pointillé */
.exemple { border-left: 4px dotted #8a8a8a; background: rgba(128, 128, 128, .06); }

/* Remarques et mises en garde */
.remarque  { border-left: 3px solid #666; background: rgba(128, 128, 128, .06); }
.attention { border-left: 3px solid #e07b00; background: rgba(240, 140, 0, .08); }

/* Exercices : filet bleu ondulé (liseré dégradé) */
.exo {
  border-left: 5px solid #1f4fd0;
  background: rgba(31, 79, 208, .05);
}
.exo-titre { font-weight: 700; }
.niveau { color: #d99a00; margin-left: .3rem; }

/* À retenir : encadré jaune, filet orange */
.retenir {
  background: rgba(255, 200, 40, .10);
  border: 1px solid rgba(210, 130, 20, .7);
  border-left: 8px solid #d98a1f;
}
.retenir .bi:first-child { color: #d98a1f; }

/* Activité : encadré bleu */
.activite {
  background: rgba(60, 90, 220, .06);
  border: 1px solid rgba(50, 80, 170, .7);
  border-left: 8px solid #2f4fa8;
}

/* ---- Tableaux : en-tête bleu, quadrillage complet ----
main table.table, main table {
  width: auto;
  margin: 1.1rem auto;
  border-collapse: collapse;
}
main table > :not(caption) > * > *,
main table th, main table td {
  border: 1px solid rgba(128, 128, 128, .7) !important;
  padding: .3rem .6rem !important;
  background-clip: border-box;
}
main table thead th, main table thead td {
  background: rgba(60, 90, 220, .16) !important;
  font-weight: 600;
}
main table thead code { background: transparent; font-weight: 600; }
td.hl-r { background: rgba(255, 60, 60, .16) !important; }
td.hl-o { background: rgba(255, 150, 40, .18) !important; }
td.hl-g { background: rgba(60, 190, 80, .18) !important; } */

/* ---- Code ---- */
p code, li code, td code, th code, .remarque code, .attention code {
  color: inherit;
  background: rgba(128, 128, 128, .13);
  padding: 0 .25em;
  border-radius: 3px;
}
div.sourceCode {
  background: rgba(128, 128, 128, .08);
  border: 1px solid rgba(128, 128, 128, .45);
  border-radius: 4px;
  margin: .7rem 0;
}
div.sourceCode pre, pre.sourceCode {
  background: transparent;
  border: 0;
  margin: 0;
  padding: .45rem .9rem;
}
div.sourceCode code span.kw, div.sourceCode code span.fu,
div.sourceCode code span.dt { color: #1e4a9c !important; font-weight: 700; }
div.sourceCode code span.st { color: #1d6b32 !important; }
div.sourceCode code span.co { color: #7a7a7a !important; font-style: italic; }

/* ---- Figures (SVG issus des TikZ du PDF, sur fond blanc) ---- */
img.fig-nsi {
  display: block;
  margin: 1rem auto;
  width: 90%;
  max-width: 100%;
  height: auto;
  background: #fff;
  padding: 8px;
  border-radius: 4px;
}

/* ---- Sous-listes (a), (b), (c)… comme dans le PDF ---- */
ol[type="a"] {
  counter-reset: alpha;
  list-style: none;
  padding-left: 2.2rem;
}
ol[type="a"] > li {
  counter-increment: alpha;
  position: relative;
}
ol[type="a"] > li::before {
  content: "(" counter(alpha, lower-alpha) ")";
  position: absolute;
  left: -2.2rem;
}
