/* ==========================================================================
   Direction artistique « Épuré »
   --------------------------------------------------------------------------
   Thème optionnel, chargé APRÈS les autres feuilles et avant print.css.
   Il garde la structure et l'UX de la V1 (sommaire latéral, colonne de
   lecture, composants) et retire ce qui faisait « gabarit » :
   - plus de libellés en capitales espacées ni de chiffres en police mono ;
   - plus de pastilles, de grand numéro rouge ni de filets à chaque ligne ;
   - plus de barres colorées à gauche des encadrés : des aplats doux ;
   - fond blanc, encre noire, un seul bleu franc ;
   - une grotesque actuelle (Instrument Sans) pour tout le texte ;
   - la mono (DM Mono) uniquement pour les commandes et leurs sorties.

   Pour revenir à la V1 : retirer la ligne
     <link rel="stylesheet" href="assets/css/theme-epure.css">
   dans index.html et fiche.html.
   ========================================================================== */

@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans-var.woff2') format('woff2');
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Mono';
  src: url('../fonts/dm-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'DM Mono';
  src: url('../fonts/dm-mono-500.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}

:root {
  /* Contrastes sur blanc : ink 19:1, ink-2 6.7:1, ink-3 5.3:1, accent 6.6:1.
     Sur --paper-2 : ink-3 4.8:1, accent 5.9:1. */
  --paper: #ffffff;
  --paper-2: #f2f2f0;       /* aplats : exemples, encadrés, exercices */
  --sheet: #ffffff;
  --ink: #0f0f0f;
  --ink-2: #5c5c58;
  --ink-3: #6b6b67;
  --rule: #e4e4e0;

  --accent: #2445f0;
  --accent-ink: #2445f0;
  --accent-soft: #e9edff;
  --focus: #2445f0;

  --font-text: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, Menlo, Consolas, monospace;

  --fs-display: clamp(2.75rem, 1.4rem + 5vw, 6rem);
  --fs-xl: clamp(1.875rem, 1.3rem + 1.8vw, 2.75rem);
  --lh-tight: 1;
}

body {
  font-feature-settings: normal;
}

strong {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Libellés : bas de casse, sans espacement forcé, jamais en mono
   -------------------------------------------------------------------------- */

.label,
.table th,
.facts__row dt,
.option__mark,
.index-row__status,
.term__sim-label,
.toc__toggle,
.term__badge {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* Plus de pastilles décoratives */
.ix__label::before,
.term__badge::before,
.site-header__square,
.toc__list a[aria-current] .toc__num::before {
  display: none;
}

/* Les chiffres sont dans la police du texte */
.toc__num,
.section-head__num,
.flow__num,
.keypoints li::before,
.home-method li::before,
.index-row__num,
.option__letter {
  font-family: var(--font-text);
  font-variant-numeric: tabular-nums;
}

/* Code en ligne : aplat léger, angles droits */
:not(pre, .console) > code {
  border-radius: 2px;
  padding: 0.08em 0.3em;
  font-size: 0.88em;
}

kbd {
  font-family: var(--font-text);
  font-size: 0.82em;
  font-weight: 500;
  border-color: var(--rule);
  border-bottom-color: var(--ink-3);
  background: var(--paper);
}

/* --------------------------------------------------------------------------
   Titres
   -------------------------------------------------------------------------- */

.home-hero__title,
.fiche-head__title {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.section-head__title {
  font-weight: 600;
  letter-spacing: -0.025em;
  max-width: 24ch;
}

.block-heading,
.index-group__title,
.ix__title,
.error-case__title,
.question__prompt,
.callout__title,
.flow__label,
.home-method strong,
.index-row__title,
.pager__link,
.definitions dt {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-head__title code,
.block-heading code {
  background: none;
  padding: 0;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   En-tête du site et progression
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header__mark {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.progress {
  height: 2px;
}

/* --------------------------------------------------------------------------
   Accueil
   -------------------------------------------------------------------------- */

.home-hero {
  border-top: 0;
}

.home-hero__kicker {
  color: var(--ink-2);
}

.home-method li {
  border-top: 0;
  padding: var(--space-4) var(--space-5) var(--space-5);
  background: var(--paper-2);
}

.home-method li::before {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
}

.home-index {
  border-top: 1px solid var(--rule);
}

.home-index__title {
  color: var(--ink);
}

.index-list {
  border-top: 0;
}

.index-row {
  border-bottom-color: var(--rule);
}

.index-row__num {
  color: var(--ink-3);
  font-weight: 500;
}

.index-row:has(a):hover {
  background: var(--paper-2);
}

.index-row:has(a):hover .index-row__num {
  color: var(--accent);
}

.index-row__commands code {
  color: var(--ink-2);
}

.index-row.is-planned .index-row__title {
  font-weight: 500;
}

.index-row__status {
  font-weight: 500;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   En-tête de fiche : le numéro rejoint la ligne de métadonnées,
   les repères (objectif, prérequis…) forment un aplat
   -------------------------------------------------------------------------- */

.fiche-head {
  border-top: 0;
  padding-block: var(--space-8) var(--space-8);
}

.fiche-head__num {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--accent);
}

.fiche-head__num::before {
  content: 'Fiche ';
}

.fiche-head__meta {
  color: var(--ink-2);
}

.fiche-facts {
  padding: var(--space-5);
  background: var(--paper-2);
  gap: var(--space-5) var(--space-6);
}

.fiche-facts__item {
  border-top: 0;
  padding-top: 0;
}

.fiche-facts__item dt {
  color: var(--ink-2);
}

.chips code {
  background: var(--paper);
}

@media (min-width: 60em) {
  /* Fiche 01 · Fondamentaux · … sur une seule ligne, au-dessus du titre */
  .fiche-head__num {
    grid-column: 4 / span 1;
    grid-row: 1;
  }

  .fiche-head__meta {
    grid-column: 5 / -1;
    grid-row: 1;
  }

  .fiche-head__title {
    grid-row: 2;
  }

  .fiche-head__subtitle {
    grid-row: 3;
  }

  .fiche-facts {
    grid-row: 4;
  }
}

/* --------------------------------------------------------------------------
   Sommaire latéral
   -------------------------------------------------------------------------- */

.toc {
  border-top: 0;
}

.toc__title {
  font-size: var(--fs-sm);
  color: var(--ink);
}

.toc__list a {
  grid-template-columns: 1.75rem 1fr;
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--rule);
}

.toc__num {
  font-size: var(--fs-sm);
  padding-top: 0;
  color: var(--ink-3);
}

.toc__list a[aria-current] {
  border-left-color: var(--accent);
  font-weight: 600;
}

.toc__list a[aria-current] .toc__num {
  color: var(--accent);
}

.toc__toggle {
  border-bottom-color: var(--rule);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.fiche-section {
  border-top: 1px solid var(--rule);
  padding-top: var(--space-6);
}

.section-head__meta {
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.section-head__num {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
}

.section-head__tag {
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Blocs statiques
   -------------------------------------------------------------------------- */

.prose-list li::marker {
  color: var(--ink-3);
}

/* Définitions : une grille sans filets */
.definitions {
  border-top: 0;
}

.definitions__row {
  border-bottom: 0;
  padding-block: var(--space-3);
}

/* Exemples et consoles : un aplat, sans cadre ni filet épais */
.example__head {
  border-bottom: 0;
  padding-bottom: var(--space-3);
}

.example__head .label {
  color: var(--ink);
}

.console {
  border-radius: 2px;
  background: var(--paper-2);
}

.console__prompt {
  color: var(--ink-3);
}

.console .console__cmd,
.term__log .console__cmd {
  font-size: inherit;
  font-weight: 500;
  background: none;
  padding: 0;
}

.console__out {
  color: var(--ink-2);
}

/* Copier : discret, sans cadre */
.copy {
  border: 0;
  border-radius: 2px;
  padding: 0.15em 0.5em;
  min-height: 1.75rem;
  font-weight: 500;
  color: var(--ink-2);
}

.copy:hover {
  background: var(--paper);
  color: var(--accent);
}

/* Encadrés : aplats, libellé coloré, pas de barre latérale */
.callout,
.callout--tip,
.callout--warning,
.callout--danger,
.callout--optional {
  max-width: 48rem;
  padding: var(--space-4) var(--space-5);
  border: 0;
  border-radius: 2px;
  background: var(--paper-2);
}

.callout__label {
  color: var(--ink-2);
}

.callout--tip {
  background: var(--accent-soft);
}

.callout--tip .callout__label {
  color: var(--accent);
}

.callout--warning {
  background: var(--warning-bg);
}

.callout--warning .callout__label {
  color: var(--warning);
}

.callout--danger {
  background: var(--error-bg);
}

.callout--danger .callout__label {
  color: var(--error);
}

.callout--optional {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--rule);
}

/* Compléments repliables */
.more {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* Tableaux */
.table caption {
  font-weight: 600;
}

.table th {
  color: var(--ink-2);
  border-bottom: 1px solid var(--ink);
}

.table td {
  border-bottom-color: var(--rule);
}

/* Schéma de flux : aplats juxtaposés */
.flow__steps {
  border-top: 0;
  gap: 2px;
}

.flow__step {
  padding: var(--space-4) var(--space-5);
  border: 0;
  background: var(--paper-2);
}

.flow__num {
  font-weight: 600;
  color: var(--accent);
}

@media (min-width: 48em) {
  .flow__steps {
    border-bottom: 0;
  }

  .flow__step,
  .flow__step + .flow__step {
    padding: var(--space-4) var(--space-5) var(--space-5);
    border-left: 0;
  }

  .flow__step + .flow__step::before {
    display: none;
  }

  .flow__num::after {
    content: ' →';
    color: var(--ink-3);
  }

  .flow__step:last-child .flow__num::after {
    content: '';
  }
}

/* Anatomie de l'invite */
.anatomy__line {
  border-radius: 2px;
}

.anatomy__part {
  border-bottom-color: var(--accent);
}

.anatomy__num,
.anatomy__legend-num {
  color: var(--accent);
}

@media (min-width: 48em) {
  .anatomy__legend li {
    border-top: 0;
    padding-top: 0;
  }
}

/* Erreurs courantes */
.error-case {
  border-top-color: var(--rule);
}

.console--error {
  border-left: 0;
  box-shadow: inset 3px 0 0 var(--error);
}

.console--fix {
  border-left: 0;
  box-shadow: inset 3px 0 0 var(--success);
}

.console--error .console__out--err {
  color: var(--error);
}

.error-case__body dt {
  color: var(--ink-2);
}

/* Points clés */
.keypoints {
  border-top: 0;
}

.keypoints li {
  border-bottom-color: var(--rule);
}

.keypoints li::before {
  font-weight: 600;
  color: var(--accent);
}

/* Navigation entre fiches */
.pager {
  border-top: 1px solid var(--rule);
}

/* --------------------------------------------------------------------------
   Composants interactifs : aplat gris, éléments blancs à l'intérieur
   -------------------------------------------------------------------------- */

.ix {
  border-top: 0;
  border-radius: 2px;
  background: var(--paper-2);
}

.ix__label {
  color: var(--accent);
}

.ix__intro {
  color: var(--ink);
}

.ix__toolbar {
  border-block: 0;
  padding-block: 0;
}

.question__context .console {
  background: var(--paper);
}

.question__cwd {
  color: var(--ink-2);
}

/* Options : rangées blanches séparées */
.options {
  display: grid;
  gap: 4px;
  border-top: 0;
}

.option {
  border-bottom: 0;
  border-radius: 2px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px transparent;
}

.option:hover:not(:has(input:disabled)) {
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--ink-3);
}

.option:has(input:checked) {
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.option__letter {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-3);
}

.checkbox input,
.option input {
  accent-color: var(--accent);
}

.option.is-correct {
  background: var(--success-bg);
  box-shadow: inset 0 0 0 2px var(--success);
}

.option.is-wrong {
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--error);
}

.feedback {
  border-left: 0;
  border-radius: 2px;
  background: var(--paper);
}

.question__answer {
  border-top: 1px solid var(--rule);
}

.question__result .console {
  background: var(--paper);
}

/* Boutons */
.btn {
  border-radius: 2px;
  font-weight: 600;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.btn:not(.btn--primary) {
  border-color: var(--rule);
  background: var(--paper);
}

.btn:not(.btn--primary):hover {
  border-color: var(--ink);
  background: var(--paper);
  color: var(--ink);
}

/* Arborescence : noms de fichiers en police du texte (pas de mono) */
.tree {
  font-family: var(--font-text);
  font-size: var(--fs-base);
}

.tree ul {
  border-left-color: var(--rule);
}

.tree__node {
  border-radius: 2px;
}

.tree__node:hover {
  background: var(--paper);
}

.tree__node.is-dir .tree__name {
  font-weight: 600;
}

.tree__node[aria-current='true'] {
  background: var(--accent);
  color: #fff;
}

.tree__here {
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  letter-spacing: 0;
}

.tree__panel {
  border-top: 0;
  border-radius: 2px;
  background: var(--paper);
}

.facts__row dt {
  color: var(--ink-2);
}

/* Terminal simulé : même aplat que les autres exercices, intitulé clair,
   écran blanc cadré */
.ix--terminal {
  border: 0;
  background: var(--paper-2);
}

.term__bar {
  background: transparent;
  color: var(--ink);
  padding-bottom: 0;
}

.term__badge {
  font-size: var(--fs-base);
  color: var(--accent);
}

.term__badge-sub {
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}

.term__disclaimer {
  color: var(--ink-2);
}

.btn--inverse {
  border-color: var(--rule);
  background: var(--paper);
  color: var(--ink);
}

.btn--inverse:hover {
  border-color: var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.btn--inverse:focus-visible {
  outline-color: var(--focus);
}

.term__goal {
  border-left: 0;
  border-radius: 2px;
  background: var(--paper);
}

.term__goal .label {
  color: var(--accent);
}

.term__screen {
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
}

.term__input {
  background: var(--paper);
  font-weight: 500;
  border-bottom-color: var(--ink-3);
}

.term__input:focus-visible {
  border-bottom-color: var(--accent);
}

.term__form .btn {
  font-family: var(--font-text);
}

.term__sim {
  border-left: 0;
  border-radius: 2px;
  background: var(--paper-2);
  font-family: var(--font-text);
}

.ix--terminal.is-achieved {
  box-shadow: inset 0 0 0 2px var(--success);
}

.term__supported {
  border-top-color: var(--rule);
}

.term__hints li::marker {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Respiration verticale : un peu plus d'air entre les blocs et les sections
   -------------------------------------------------------------------------- */

:root {
  --lh-text: 1.65;
}

.fiche-head {
  padding-bottom: var(--space-9);
}

.fiche-section {
  padding-top: var(--space-7);
}

.fiche-section + .fiche-section {
  margin-top: var(--space-10);
}

.section-head {
  margin-bottom: var(--space-7);
}

.section-body > * + * {
  margin-top: var(--space-6);
}

.section-body > :is(.ix, .example, .flow, .anatomy, .table-wrap, .error-case, .more),
.section-body > :is(.ix, .example, .flow, .anatomy, .table-wrap, .error-case, .more) + * {
  margin-top: var(--space-7);
}

.section-body > .block-heading {
  margin-top: var(--space-9);
}

.section-body > .error-case + .error-case {
  margin-top: var(--space-8);
}

.ix > * + * {
  margin-top: var(--space-5);
}

.ix {
  padding: var(--space-6);
}

.ix--terminal {
  padding: 0;
}

.definitions__row {
  padding-block: var(--space-4);
}

.keypoints li {
  padding-block: var(--space-5);
}

.prose-list li + li {
  margin-top: var(--space-3);
}

.example__note,
.figcaption {
  margin-top: var(--space-4);
}

.error-case__body {
  gap: var(--space-5);
  margin-top: var(--space-5);
}

@media (max-width: 30em) {
  .ix {
    padding: var(--space-5) var(--space-4);
  }

  .ix--terminal {
    padding: 0;
  }

  .fiche-section + .fiche-section {
    margin-top: var(--space-9);
  }
}

/* --------------------------------------------------------------------------
   Impression : aplats supprimés, contours fins à la place
   -------------------------------------------------------------------------- */

@media print {
  .fiche-facts,
  .flow__step,
  .callout,
  .callout--tip,
  .callout--warning,
  .callout--danger,
  .home-method li {
    background: none;
    box-shadow: inset 0 0 0 0.5pt #999;
  }

  .ix__label,
  .term__badge,
  .section-head__num,
  .fiche-head__num,
  .flow__num,
  .keypoints li::before {
    color: #000;
  }

  .option {
    background: none;
  }

  .tree__here {
    background: none;
    color: #000;
    box-shadow: inset 0 0 0 0.75pt #000;
  }
}
