/* Composants des fiches de cours générées par scripts/build-courses.js (Python, C, Java, HTML, CSS, JavaScript).
   Le reste de la mise en page vient de style.css et de css/brand-hv2.css (py-card, py-rows, py-code-win, py-callout, csp-table). */

/* ---------- Affichage attendu : accroché au bas de la fenêtre de code ---------- */
.py-code-win__out {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.7rem 1.1rem 0.85rem;
  background: #0a101c;
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
  color: #bbf7d0;
}

.py-code-win__out-k {
  flex: none;
  padding-top: 0.22rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #a5b4c8;
}

.py-code-win__out-body {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font-mono, ui-monospace, Consolas, monospace);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- « À éviter » / « Correct » côte à côte ---------- */
.course-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.25rem;
  align-items: start;
}

.course-compare__col {
  min-width: 0;
}

.course-compare__col .py-code-win {
  margin-top: 0.45rem;
}

.course-tag {
  display: inline-block;
  padding: 0.14rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.course-tag--bad {
  background: #fdecea;
  border-color: #f1b9b3;
  color: #a4221a;
}

.course-tag--good {
  background: #e4f5ec;
  border-color: #9fd3b5;
  color: #14683f;
}

/* Un lien « page.html#ancre » (ex. python.html -> importation.html#py-stdlib) ne doit pas cacher le titre sous la barre de navigation. */
.page-topic .cheatsheet-content h3[id],
.page-topic .cheatsheet-content h4[id] {
  scroll-margin-top: 5.5rem;
}

/* Les tableaux d'un cours défilent dans leur cadre sur téléphone au lieu d'élargir la page. */
.page-topic .cheatsheet-content .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.page-topic .cheatsheet-content .csp-table code {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .course-compare {
    grid-template-columns: minmax(0, 1fr);
  }
}
