.custom-numbered-block {
  margin: 1em 0;
  padding: 0.8em 1em;
  border-left: 4px solid #555;
  background-color: #f8f8f8;
}

.custom-numbered-block > p:first-child {
  margin-top: 0;
}

.custom-numbered-block > p:first-child strong {
  font-size: 1.05em;
}



/* ========== Navigation entre chapitres (colorée) ========== */
.chap-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8em;
  margin-top: 3em;
  padding: 1.1em 1.2em;
  border-radius: 14px;
  background: linear-gradient(120deg, #e8f7f2, #eaf4fd, #fdf0f0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* 3 zones égales : gauche / centre / droite */
.chap-nav p { margin: 0; flex: 1 1 0; min-width: 160px; }
.chap-nav p:nth-child(1) { text-align: left; }
.chap-nav p:nth-child(2) { text-align: center; }
.chap-nav p:nth-child(3) { text-align: right; }

/* Boutons colorés */
.chap-nav a {
  display: inline-block;
  padding: 0.5em 1.2em;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.chap-nav a.prev { background: linear-gradient(135deg, #5bc0de, #2a9fd8); } /* bleu */
.chap-nav a.home { background: linear-gradient(135deg, #78c2ad, #4aa58b); } /* vert minty */
.chap-nav a.next { background: linear-gradient(135deg, #f3969a, #e66a6f); } /* corail */

.chap-nav a:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
  filter: brightness(1.07);
}

/* Flèches animées + icône du menu central */
.chap-nav a.prev::before,
.chap-nav a.next::after {
  display: inline-block;
  font-size: 1.2em;
  vertical-align: middle;
  transition: transform 0.2s ease;
}
.chap-nav a.prev::before { content: "⟵"; margin-right: 0.5em; }
.chap-nav a.next::after  { content: "⟶"; margin-left: 0.5em; }
.chap-nav a.prev:hover::before { transform: translateX(-5px); }
.chap-nav a.next:hover::after  { transform: translateX(5px); }
.chap-nav a.home::before { content: "📚 "; }





/* ===== Icônes vectorielles en filigrane sur les cartes ===== */
.card-home {
  position: relative;
  overf/* ========== Bulles des cartes de filières ========== */
.card-home {
  position: relative;
  overflow: hidden;
  display: block;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  padding: 1.4em 1.2em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-home:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.card-home h2, .card-home h3 {
  margin-top: 0.4em;
}low: hidden;
}

.card-home::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 92px;
  height: 92px;
  background: no-repeat center / contain;
  opacity: 0.16;          /* intensité du filigrane */
  pointer-events: none;
}

/* MPSI : symbole somme */
.grid > :nth-child(1) .card-home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f42c1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 5H7l6 7-6 7h11'/%3E%3C/svg%3E");
}

/* MP : intégrale */
.grid > :nth-child(2) .card-home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f42c1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 4c-2.5 0-4 1.7-4 4v8c0 2.3-1.5 4-4 4'/%3E%3C/svg%3E");
}

/* PCSI : atome */
.grid > :nth-child(3) .card-home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a9fd8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='1.8'/%3E%3Cellipse cx='12' cy='12' rx='9' ry='3.8'/%3E%3Cellipse cx='12' cy='12' rx='9' ry='3.8' transform='rotate(60 12 12)'/%3E%3Cellipse cx='12' cy='12' rx='9' ry='3.8' transform='rotate(-60 12 12)'/%3E%3C/svg%3E");
}

/* PSI : engrenage */
.grid > :nth-child(4) .card-home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a9fd8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3.5'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.2 2.2M16.9 16.9l2.2 2.2M19.1 4.9l-2.2 2.2M7.1 16.9l-2.2 2.2'/%3E%3C/svg%3E");
}

/* TSI 1re : processeur */
.grid > :nth-child(5) .card-home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8590c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='6' width='12' height='12' rx='2'/%3E%3Crect x='10' y='10' width='4' height='4'/%3E%3Cpath d='M12 2v4M12 18v4M2 12h4M18 12h4'/%3E%3C/svg%3E");
}

/* TSI 2e : curseurs de réglage */
.grid > :nth-child(6) .card-home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8590c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3Ccircle cx='9' cy='6' r='2'/%3E%3Ccircle cx='15' cy='12' r='2'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3C/svg%3E");
}

/* ECT 1re : diagramme en barres */
.grid > :nth-child(7) .card-home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2320a17a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16M7 20v-6M12 20V8M17 20v-9'/%3E%3C/svg%3E");
}

/* ECT 2e : courbe de croissance */
.grid > :nth-child(8) .card-home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2320a17a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17l6-6 4 4 8-8'/%3E%3Cpath d='M14 7h7v7'/%3E%3C/svg%3E");
}

/* ECS 1re : mallette */
.grid > :nth-child(9) .card-home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9534f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='8' width='18' height='12' rx='2'/%3E%3Cpath d='M9 8V6a3 3 0 0 1 6 0v2M3 13h18'/%3E%3C/svg%3E");
}

/* ECS 2e : banque */
.grid > :nth-child(10) .card-home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9534f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-6 9 6'/%3E%3Cpath d='M5 9v10M19 9v10M9 12v5M12 12v5M15 12v5'/%3E%3Cpath d='M3 20h18'/%3E%3C/svg%3E");
}







/* ============================================================
   BOÎTES MATHÉMATIQUES (Version Quarto / custom-numbered-block)
   ============================================================ */

/* Structure commune : espace suffisant pour le titre flottant */
.custom-numbered-block {
  position: relative;
  margin: 2.5em 0 1.5em 0; /* Marge haute importante pour le titre */
  padding: 1.2em 1em 1em 1em;
  border-radius: 5pt;
  border: 2px solid #555;
  background-color: #f8f8f8;
  page-break-inside: avoid;
}

/* Le titre (premier paragraphe en gras) : bien positionné au-dessus */
.custom-numbered-block > p:first-child {
  position: absolute;
  top: -0.9em;
  left: 1em;
  margin: 0;
  padding: 0.1em 0.6em;
  border-radius: 5pt;
  border: 1px solid #999;
  background: #fff;
  font-size: 0.95em;
  z-index: 10;
}

/* --- Couleurs spécifiques par type (reproduction de boite.sty) --- */

/* Théorème : fond blue!5, bordure orange */
.custom-theorem { background-color: #f2f7ff; border-color: #ff8c00; }
.custom-theorem > p:first-child { background-color: #cce0ff; border-color: #ff8c00; }

/* Proposition : fond blue!5, bordure bleue */
.custom-proposition { background-color: #f2f7ff; border-color: #0055cc; }
.custom-proposition > p:first-child { background-color: #cce0ff; border-color: #0055cc; }

/* Définition : fond purple!5, bordure brune */
.custom-definition { background-color: #faf5ff; border-color: #8b4513; }
.custom-definition > p:first-child { background-color: #e6ccff; border-color: #8b4513; }

/* Exemple : fond blanc, bordure grise */
.custom-example { background-color: #ffffff; border-color: #cccccc; }
.custom-example > p:first-child { background-color: #e8e8e8; border-color: #999; }

/* Remarque : fond blanc, bordure cyan */
.custom-remark { background-color: #ffffff; border-color: #00cccc; }
.custom-remark > p:first-child { background-color: #ccf5f5; border-color: #00cccc; }

/* Preuve (Démonstration) : fond blanc, bordure bleue pointillée */
.custom-proof { background-color: #ffffff; border-color: #3377cc; border-style: dashed; }
.custom-proof > p:first-child { background-color: #cce0ff; border-color: #3377cc; }
/* Symbole QED à la fin */
.custom-proof::after { content: "∎"; float: right; font-size: 1.2em; font-weight: bold; margin-top: -1.5em; }

/* Corollaire : fond gris clair, bordure rouge */
.custom-corollary { background-color: #f7f7f7; border-color: #cc0000; }
.custom-corollary > p:first-child { background-color: #cce0ff; border-color: #cc0000; }

/* Exercice : fond green!10, bordure noire */
.custom-exercise { background-color: #f0fff0; border-color: #000000; }
.custom-exercise > p:first-child { background-color: #ccffcc; border-color: #000000; }

/* Solution / Réponse : fond green!10, bordure noire pointillée */
.custom-solution { background-color: #f0fff0; border-color: #000000; border-style: dashed; }
.custom-solution > p:first-child { background-color: #ccffcc; border-color: #000000; }

/* Bloc libre (callout-note) : géré nativement par Quarto, mais on peut ajuster */
.callout-note { margin-top: 2em; }
