/* ------------------------------------------------------------------------
   Introduction aux méthodes de Monte-Carlo — feuille de style
   Reprend l'identité visuelle de « Émergence et systèmes de particules en
   interactions » (fond #f7f9fc, encre #111827, bleu #006d9c) et ajoute les
   blocs propres à un cours : définitions, théorèmes, algorithmes.
   ------------------------------------------------------------------------ */

:root {
  --slide-bg: #f7f9fc;
  --ink: #111827;
  --muted: #475569;
  --faint: #94a3b8;
  --grid: #dfe5ee;
  --blue: #006d9c;
  --blue-pale: #d3e5ee;
  --blue-tint: rgba(0, 109, 156, 0.06);
  --accent-red: #d71920;
  --amber: #c98500;
}

.reveal-viewport,
.reveal .slide-background {
  background: var(--slide-bg);
}

.reveal {
  font-size: 30px;
  color: var(--ink);
}

.reveal .slides {
  text-align: left;
}

.reveal h1,
.reveal h2,
.reveal h3 {
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

.reveal h2 {
  font-size: 1.32em;
  line-height: 1.15;
  margin-bottom: 0.65em;
}

.reveal strong {
  color: var(--ink);
  font-weight: 700;
}

.reveal .slides section .fragment.semi-fade-out.visible {
  opacity: 0.35;
}

.reveal ul,
.reveal ol {
  margin-left: 1.1em;
}

.reveal li {
  margin: 0.25em 0;
}

.reveal li > ul,
.reveal li > ol {
  margin-top: 0.15em;
}

.reveal a {
  color: var(--blue);
}

/* --- Page de titre ------------------------------------------------------- */
.reveal #title-slide {
  text-align: center;
  color: var(--ink);
}

.reveal #title-slide h1 {
  font-size: 2em;
  line-height: 1.12;
  max-width: 1050px;
  margin-left: auto;
  margin-right: auto;
}

.reveal #title-slide .subtitle {
  color: var(--muted);
  font-size: 0.95em;
}

.reveal #title-slide .quarto-title-author-name {
  color: var(--muted);
  font-size: 0.8em;
}

/* --- Pied de page (en haut à gauche, comme dans l'exemple) --------------- */
/* sélecteur renforcé : le footer.css de Quarto est chargé après ce fichier */
.reveal-viewport .reveal .footer {
  top: 0.32rem;
  left: 0.6rem;
  bottom: auto;
  right: auto;
  width: auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.1;
  text-align: left;
}

.reveal-viewport .reveal .footer p {
  margin: 0;
}

/* --- Titres de parties (# …) ----------------------------------------------- */
.reveal section.level1 {
  text-align: center;
}

.reveal section.level1 h1 {
  font-size: 1.9em;
  line-height: 1.15;
  max-width: 1000px;
  margin: 0 auto;
}

.reveal section.level1 .kicker {
  display: block;
  font-size: 0.42em;
  font-weight: 400;
  color: var(--blue);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6em;
}

/* --- Diapositives « scène » (vidéo / image en fond) ----------------------- */
.reveal section.stage > h2 {
  display: none;
}

.stage-caption {
  position: absolute;
  top: 0.55rem;
  left: 1.2rem;
  right: 1.2rem;
  color: var(--muted);
  font-size: 0.74em;
  line-height: 1.25;
  z-index: 2;
}

.stage-caption.center {
  text-align: center;
}

.stage-caption strong {
  color: var(--ink);
}

.eq-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.4rem;
  text-align: center;
  font-size: 0.78em;
  line-height: 1.05;
  color: var(--ink);
  z-index: 2;
}

.eq-overlay .katex-display,
.eq-overlay .MathJax_Display,
.eq-overlay mjx-container[display="true"] {
  margin: 0;
}

/* Boîte de notes posée sur une scène */
.note-box {
  position: absolute;
  top: 3.2rem;
  width: 500px;
  padding: 0.65rem 0.9rem;
  background: rgba(247, 249, 252, 0.94);
  border-left: 4px solid var(--blue);
  color: var(--ink);
  font-size: 0.8em;
  line-height: 1.3;
  z-index: 2;
}

.note-box.right {
  right: 1.2rem;
}

.note-box.left {
  left: 1.2rem;
}

.note-box.wide {
  width: 560px;
}

.note-box p {
  margin: 0.35em 0;
}

.note-box ul {
  margin: 0;
  padding-left: 1.05em;
}

/* --- Titres seuls (« Merci », questions…) ------------------------------- */
.reveal section.title-only {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.reveal section.title-only > h2 {
  font-size: 1.9em;
  line-height: 1.12;
  color: var(--ink);
  max-width: 1050px;
}

.big-quote {
  font-size: 1.15em;
  line-height: 1.35;
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

.big-quote .em {
  color: var(--blue);
  font-weight: 700;
}

/* --- Blocs de cours ------------------------------------------------------- */
.def,
.thm,
.algo,
.key,
.rem {
  position: relative;
  margin: 0.55em 0;
  padding: 0.55em 0.85em 0.55em 0.9em;
  line-height: 1.35;
}

.def::before,
.thm::before,
.algo::before,
.key::before,
.rem::before {
  display: block;
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25em;
}

.def {
  background: var(--blue-tint);
  border-left: 4px solid var(--blue);
}

.def::before {
  content: "Définition";
  color: var(--blue);
}

.thm {
  background: rgba(17, 24, 39, 0.04);
  border-left: 4px solid var(--ink);
}

.thm::before {
  content: "Théorème";
  color: var(--ink);
}

.thm.prop::before {
  content: "Proposition";
}

.key {
  background: rgba(215, 25, 32, 0.05);
  border-left: 4px solid var(--accent-red);
}

.key::before {
  content: "À retenir";
  color: var(--accent-red);
}

.rem {
  border-left: 4px solid var(--grid);
  color: var(--muted);
}

.rem::before {
  content: "Remarque";
  color: var(--muted);
}

.algo {
  background: #ffffff;
  border: 1px solid var(--grid);
  border-radius: 6px;
  font-size: 0.9em;
}

.algo::before {
  content: "Algorithme";
  color: var(--blue);
}

.algo ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.algo ul ul {
  padding-left: 1.4em;
  border-left: 2px solid var(--grid);
  margin-left: 0.35em;
}

.algo li {
  margin: 0.12em 0;
}

.def p,
.thm p,
.algo p,
.key p,
.rem p {
  margin: 0.25em 0;
}

.def > :first-child,
.thm > :first-child,
.key > :first-child,
.rem > :first-child {
  margin-top: 0;
}

/* --- Utilitaires ----------------------------------------------------------- */
.small {
  font-size: 0.8em;
}

.tiny {
  font-size: 0.62em;
}

.muted {
  color: var(--muted);
}

.blue {
  color: var(--blue);
}

.red {
  color: var(--accent-red);
}

.amber {
  color: var(--amber);
}

.center {
  text-align: center;
}

.reveal img.figure-wide {
  display: block;
  margin: 0 auto;
}

.reveal .columns {
  align-items: center;
}

.reveal table {
  font-size: 0.85em;
  margin: 0.6em auto;
}

.reveal table th {
  color: var(--muted);
  font-weight: 600;
}

.reveal table td,
.reveal table th {
  padding: 0.35em 0.9em;
}

.reveal pre {
  font-size: 0.6em;
  box-shadow: none;
  width: 100%;
}

.reveal pre code {
  background: #ffffff;
  border: 1px solid var(--grid);
  border-radius: 6px;
  padding: 0.6em 0.8em;
  max-height: 520px;
}

.reveal code {
  color: var(--ink);
}

.timeline ul {
  list-style: none !important;
  margin-left: 0 !important;
  padding-left: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 4.2em 1fr;
  gap: 0.6em;
  margin: 0.45em 0;
}

.timeline .year {
  color: var(--blue);
  font-weight: 700;
}

/* --- Simulations interactives -------------------------------------------- */
.mc-sim {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  justify-content: center;
  font-size: 0.8em;
  color: var(--ink);
}

.mc-sim canvas {
  display: block;
  background: var(--slide-bg);
}

.mc-sim .panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 480px;
}

.mc-sim .readout {
  font-size: 1.25em;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.mc-sim .readout .label {
  color: var(--muted);
  display: inline-block;
  min-width: 5.4em;
}

.mc-sim .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mc-sim button {
  font: inherit;
  font-size: 0.95em;
  padding: 6px 12px;
  border: 1px solid var(--grid);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.mc-sim button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.mc-sim button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

.mc-sim input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.mc-sim .history {
  color: var(--muted);
  font-size: 0.9em;
  line-height: 1.4;
  min-height: 3em;
}
