/* L'épreuve de PSE au CAP — style de l'espace (mapse.fr)
   Une page = un écran : pas de défilement sur ordinateur, défilement court sur téléphone. */
:root {
  --encre: #15213a;
  --doux: #5b6578;
  --fond: #f5f6fa;
  --papier: #ffffff;
  --trait: #e2e6ef;
  --bleu: #000091;      /* bleu des pictogrammes FALC */
  --bleu-clair: #ececfb;
  --vert: #237f52;      /* vert du panneau ISO 7010 E003 */
  --vert-clair: #e6f3ec;
  --accent: #b45309;
  --accent-clair: #fdf3e3;
  --rayon: 16px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: inherit; }
.cadre { width: min(980px, calc(100% - 32px)); margin: 0 auto; }

/* Bandeau : toujours un chemin de retour */
.nav { background: var(--papier); border-bottom: 1px solid var(--trait); }
.nav .cadre { display: flex; align-items: center; gap: 10px; min-height: 52px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; font-weight: 700; font-size: .88rem;
  padding: 6px 12px; border-radius: 999px; background: var(--fond); border: 1px solid var(--trait);
}
.nav a:hover, .nav a:focus-visible { background: var(--bleu-clair); border-color: var(--bleu); }
.nav .titre-nav { margin-left: auto; font-size: .85rem; color: var(--doux); font-weight: 700; }

/* Sommaire en pastilles numérotées */
.etapes { display: flex; gap: 6px; justify-content: center; padding: 14px 0 0; flex-wrap: wrap; }
.etapes a {
  text-decoration: none; font-weight: 700; font-size: .85rem;
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--papier); border: 1px solid var(--trait); color: var(--doux);
}
.etapes a[aria-current="page"] { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.etapes a:hover, .etapes a:focus-visible { border-color: var(--bleu); }

/* Contenu de la page */
main { flex: 1; display: flex; align-items: center; padding: 18px 0; }
.page {
  background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon);
  box-shadow: 0 10px 30px rgba(21, 33, 58, .06);
  padding: clamp(20px, 4vw, 36px);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 4vw, 40px); align-items: center;
}
.page.pleine { grid-template-columns: 1fr; }
.sur { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 700; color: var(--bleu); }
h1 { margin: 0 0 14px; font-size: clamp(1.45rem, 3.6vw, 2rem); line-height: 1.2; }
.page ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.page li { padding-left: 18px; position: relative; }
.page li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--bleu); }
.page strong { color: var(--bleu); }
.visuel { display: flex; justify-content: center; }
.visuel svg { width: 100%; height: auto; max-height: 52vh; }
.picto { width: clamp(110px, 18vw, 170px); height: auto; }

/* Cartes des thématiques */
.thematiques { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 6px; }
.thema {
  border: 1px solid var(--trait); border-radius: 14px; padding: 14px 12px; text-align: center;
  background: var(--papier); position: relative;
}
.thema img { width: 64px; height: 64px; display: block; margin: 0 auto 8px; }
.thema .lettre { font-weight: 700; font-size: 1.3rem; color: var(--bleu); display: block; }
.thema p { margin: 4px 0 0; font-size: .9rem; line-height: 1.35; }
.thema.obligatoire { border: 2px solid var(--bleu); background: var(--bleu-clair); }
.thema .etiquette {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--bleu); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .05em;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.regle { margin: 18px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--accent-clair); border-left: 4px solid var(--accent); }

/* Chaîne des compétences C1 → C5, C6 transversale */
.page ol.chaine { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; counter-reset: none; }
.page li.comp {
  padding: 12px; margin: 0; border-radius: 12px; background: var(--bleu-clair); border: 1px solid #c9c6f2;
  display: flex; flex-direction: column; gap: 6px; font-size: .9rem; line-height: 1.35; position: relative;
}
.page li.comp::before { display: none; }
.page li.comp:not(:last-child)::after {
  content: "→"; position: absolute; right: -10px; top: 50%; transform: translate(50%, -50%);
  color: var(--bleu); font-weight: 700; font-size: 1.1rem;
}
.code {
  align-self: flex-start; font-weight: 700; color: #fff; background: var(--bleu);
  border-radius: 8px; padding: 1px 9px; font-size: .95rem;
}
.transversale {
  margin: 14px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--accent-clair);
  border: 2px solid var(--accent); display: flex; gap: 12px; align-items: center;
}
.transversale .code { background: var(--accent); align-self: center; }
.transversale strong { color: var(--accent); }

/* Bas de page : précédent / suivant */
.pager { padding: 0 0 12px; }
.pager .cadre { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pager a, .pager span.vide {
  text-decoration: none; font-weight: 700; padding: 10px 18px; border-radius: 999px;
  background: var(--papier); border: 1px solid var(--trait); min-width: 130px; text-align: center;
}
.pager a.suivant { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.pager a:hover, .pager a:focus-visible { box-shadow: 0 0 0 3px var(--bleu-clair); }
.pager span.vide { visibility: hidden; }
.sources { text-align: center; color: var(--doux); font-size: .75rem; padding: 0 16px 14px; margin: 0; }

/* Téléphone */
@media (max-width: 760px) {
  body { font-size: 17px; }
  main { align-items: flex-start; }
  .page { grid-template-columns: 1fr; }
  .page .visuel { order: -1; }
  .visuel svg { max-height: 34vh; }
  .thematiques { grid-template-columns: 1fr 1fr; gap: 16px 10px; }
  .thema img { width: 48px; height: 48px; }
  .page ol.chaine { grid-template-columns: 1fr; gap: 14px; }
  .page li.comp { flex-direction: row; align-items: center; padding: 10px 12px; }
  .page li.comp:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -12px; transform: translate(-50%, 50%); }
  .pager a, .pager span.vide { min-width: 0; padding: 10px 14px; }
  .nav .titre-nav { display: none; }
}

@media print {
  .nav, .etapes, .pager { display: none; }
  .page { box-shadow: none; }
}
