/* Les cinq études (21 nov. 2026). Jonathan : « ça fait très plat… ils sont tous comme ça, l'un après l'autre »,
   puis : « que la page soit la moins longue possible », au téléphone et à l'ordinateur, des grilles plutôt que des
   cartes pleine largeur empilées, en gardant les tableaux utiles. D'où : la figure-clé en tête (écrite par le
   générateur de chaque étude, scripts/etude_figure.py), les blocs deux par deux à l'ordinateur (.et-duo, .et-pile),
   « Pour aller plus loin » en tuiles. Feuille liée par les dix pages d'étude seulement.
   La teinte d'une épreuve va SEULEMENT dans la tuile du picto (option C) : jamais un texte, une barre, une bordure. */

/* La page, plus large à l'ordinateur : les blocs s'y rangent deux par deux. */
main.pg-main { --maxw: 1040px; }

/* Les titres de section de l'appli : 20 px, comme l'index des sujets. */
.pg-main .bl-bloc > h2 { font-size: 20px; line-height: 1.3; margin: 0 0 0.55rem; }

/* ── La tuile du picto (34 px, 32 au téléphone) : l'encre, ou le voile de son épreuve ── */
.pg-main .et-ic {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: inline-grid; place-items: center; background: var(--fp-creux); color: var(--fp-encre);
}
.pg-main .et-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pg-main .et-ic.ep-ecoute { background: var(--fp-ep-ecoute-voile); color: var(--fp-ep-ecoute); }
.pg-main .et-ic.ep-lecture { background: var(--fp-ep-lecture-voile); color: var(--fp-ep-lecture); }
.pg-main .et-ic.ep-ecrit { background: var(--fp-ep-ecrit-voile); color: var(--fp-ep-ecrit); }
.pg-main .et-ic.ep-oral { background: var(--fp-ep-oral-voile); color: var(--fp-ep-oral); }
@media (max-width: 719px) { .pg-main .et-ic { width: 32px; height: 32px; } }

/* ── La tête : la figure-clé, puis la réponse courte (à côté, à l'ordinateur) ── */
.pg-main .reponse.et-tete { padding: 12px; margin: 0 0 1.2rem; }
.pg-main .et-tete-texte { padding: 12px 6px 2px; min-width: 0; }
.pg-main .et-tete-texte .reponse-q { margin: 0 0 0.45rem !important; }
.pg-main .et-tete-texte .et-phrase { margin: 0 0 0.6rem !important; }
.pg-main .et-tete-texte > p:not(.et-phrase):not(.reponse-q) { margin: 0 0 0.45rem; font-size: 0.9rem; line-height: 1.55; color: var(--fp-encre-2); }
.pg-main .et-tete-texte > p:last-child { margin-bottom: 0; }
.pg-main .et-tete-texte .et-echantillon { padding: 0.5rem 0.7rem; }
@media (min-width: 900px) {
  .pg-main .reponse.et-tete { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 0 22px; align-items: center; padding: 12px 20px 12px 12px; }
  .pg-main .et-tete-texte { padding: 6px 0; }
}

/* ── La figure-clé ── */
.pg-main .et-cle { margin: 0; padding: 14px 16px 12px; background: var(--fp-creux); border-radius: 12px; min-width: 0; }
.pg-main .et-cle p { margin: 0; }
/* Sur le creux de la figure, la tuile à l'encre prend la carte. */
.pg-main .et-cle .et-ic:not([class*="ep-"]) { background: var(--fp-carte); }
.pg-main .et-cle-tete { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: var(--fp-t-5); font-weight: 600; line-height: 1.3; color: var(--fp-encre-2); }
.pg-main .et-cle-tete > span:last-child { margin-left: 2px; }
.pg-main .et-cle-n b {
  display: block; font-size: 2.6rem; line-height: 1; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap;
  color: var(--fp-titre); font-variant-numeric: lining-nums tabular-nums;
}
.pg-main .et-cle-n span { display: block; margin-top: 5px; font-size: 0.95rem; line-height: 1.35; font-weight: 600; color: var(--fp-encre); }
/* Le chiffre et son visuel côte à côte (les cent cases de l'écrit). */
.pg-main .et-cle-duo { display: grid; grid-template-columns: minmax(0, 1fr) 122px; gap: 14px; align-items: center; }
.pg-main svg.et-gaufre { display: block; width: 100%; height: auto; }
.pg-main svg.et-points { display: block; width: 100%; max-width: 250px; height: auto; margin: 10px 0 0; }
.pg-main .et-gaufre .et-plein, .pg-main .et-points .et-plein { fill: var(--fp-encre); }
.pg-main .et-gaufre .et-vide, .pg-main .et-points .et-vide { fill: var(--fp-trait); }
/* Une part en barre : le plein à l'encre, le reste en creux. */
.pg-main .et-cle-barre { height: 12px; margin: 10px 0 0; border-radius: 6px; background: var(--fp-carte); box-shadow: inset 0 0 0 1px var(--fp-trait); overflow: hidden; }
.pg-main .et-cle-barre > span { display: block; height: 100%; background: var(--fp-encre); }
/* La légende d'un visuel. */
.pg-main .et-cle-leg { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: 7px 0 0; font-size: 0.8rem; line-height: 1.35; color: var(--fp-encre-2); }
.pg-main .et-cle-leg > span { display: inline-flex; align-items: center; gap: 6px; }
.pg-main .et-cle-leg b { color: var(--fp-titre); }
.pg-main .et-pt { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--fp-encre); }
.pg-main .et-pt.et-pt-trait { background: var(--fp-trait); }
.pg-main .et-pt.et-pt-creux { background: var(--fp-carte); box-shadow: inset 0 0 0 1px var(--fp-trait); }
.pg-main .et-pt.et-pt-exam { background: var(--fp-trait-fort); }
/* Le retour d'un sujet d'oral : premier relevé, le délai médian, le retour. */
.pg-main .et-cle-delai { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 0.8rem; line-height: 1.3; color: var(--fp-encre-2); }
.pg-main .et-cle-delai > span { flex: none; display: inline-flex; align-items: center; gap: 5px; }
.pg-main .et-cle-delai > span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--fp-encre); }
.pg-main .et-cle-delai > i { flex: 1 1 12px; min-width: 12px; height: 2px; background: var(--fp-trait-fort); }
.pg-main .et-cle-delai > b { flex: none; color: var(--fp-titre); font-size: 0.95rem; white-space: nowrap; }
/* Le temps de parole : la voix de l'élève dans le temps de la tâche, les trois tâches à la même échelle. */
.pg-main ol.et-cle-temps { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 9px; }
.pg-main .et-cle-temps li { margin: 0; display: grid; grid-template-columns: 58px minmax(0, 1fr); column-gap: 10px; align-items: center; }
.pg-main .et-cle-t { font-size: 0.82rem; font-weight: 700; color: var(--fp-titre); white-space: nowrap; }
.pg-main .et-cle-piste { display: flex; height: 14px; border-radius: 4px; background: var(--fp-carte); box-shadow: inset 0 0 0 1px var(--fp-trait); overflow: hidden; }
.pg-main .et-cle-voix { background: var(--fp-encre); }
.pg-main .et-cle-exam { background: var(--fp-trait-fort); }
.pg-main .et-cle-tv { grid-column: 2; margin-top: 3px; font-size: 0.8rem; line-height: 1.35; color: var(--fp-encre-2); }
.pg-main .et-cle-tv b { color: var(--fp-titre); font-size: 0.95rem; }
/* La faute n° 1 : la faute en terre cuite (une faute, et rien d'autre), la forme juste en sauge. */
.pg-main .et-cle-k { font-size: 0.85rem; line-height: 1.35; color: var(--fp-encre-2); }
.pg-main .et-cle-k b { color: var(--fp-titre); }
.pg-main .et-cle-ex { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; margin: 6px 0 2px !important; font-size: 2.1rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.pg-main .et-cle-ex s { color: var(--fp-faute); font-weight: 600; text-decoration-thickness: 3px; }
.pg-main .et-cle-ex i { font-style: normal; font-weight: 400; color: var(--fp-encre-2); }
.pg-main .et-cle-ex b { color: var(--fp-juste); }
.pg-main .et-cle-nom { font-size: 0.95rem; line-height: 1.35; font-weight: 600; color: var(--fp-titre); }
.pg-main .et-cle-sep { margin: 12px 0 0 !important; padding: 10px 0 0; border-top: 1px solid var(--fp-trait); }
/* Les deux épreuves des pièges, côte à côte. */
.pg-main .et-cle-ep2 { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 0 !important; font-size: 0.85rem; color: var(--fp-encre-2); }
.pg-main .et-cle-ep2 b { color: var(--fp-titre); font-size: 1rem; }
/* Les chiffres des anciennes tuiles, en une rangée sous le visuel. */
.pg-main ul.et-cle-plus {
  list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--fp-trait);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px 14px;
}
.pg-main .et-cle-plus li { margin: 0; font-size: 0.8rem; line-height: 1.35; color: var(--fp-encre-2); }
.pg-main .et-cle-plus b { display: block; font-size: 1.1rem; line-height: 1.15; font-weight: 700; color: var(--fp-titre); font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 719px) {
  .pg-main .et-cle { padding: 12px 12px 10px; }
  .pg-main .et-cle-n b { font-size: 2.3rem; }
  .pg-main .et-cle-ex { font-size: 1.75rem; }
  .pg-main .et-cle-duo { grid-template-columns: minmax(0, 1fr) 108px; gap: 12px; }
}

/* ── La signature, plus serrée ── */
.pg-main .byline { margin: 0 0 0.4rem; padding: 0.7rem 0; }

/* ── Deux par deux à l'ordinateur ; au téléphone, l'ordre de lecture ── */
@media (min-width: 900px) {
  .pg-main .et-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin: 16px 0 0; }
  .pg-main .et-pile { display: grid; gap: 16px; align-content: start; min-width: 0; }
  .pg-main .et-duo > *, .pg-main .et-pile > * { margin: 0; min-width: 0; }
  .pg-main .et-duo .cta-block { padding: 1.35rem 1.4rem 1.4rem; }
  .pg-main .et-duo .cta-block h3 { font-size: 1.2rem; }
  /* Dans une colonne, la méthode et les limites se lisent un peu plus serrées. */
  .pg-main .et-duo .et-methode > li, .pg-main .et-duo section[id] > ul > li { font-size: 0.94rem; line-height: 1.6; }
  .pg-main .et-duo .et-themes { grid-template-columns: 1fr; }
}

/* Les huit pièges : le texte d'ouverture à gauche, leur graphique à droite (les huit replis restent dessous, deux par
   rangée, comme le veut blocs.css pour quatre replis et plus). */
@media (min-width: 1000px) {
  .pg-main section:has(> h2#huit-pieges) { grid-template-rows: auto auto 1fr; column-gap: 16px; }
  .pg-main section:has(> h2#huit-pieges) > p:not(.et-note) { grid-column: 1; margin: 0 0 0.6rem; }
  .pg-main section:has(> h2#huit-pieges) > figure { grid-column: 2; grid-row: 2 / span 2; margin: 0 0 0.4rem; }
  .pg-main section:has(> h2#huit-pieges) > p.et-note { grid-column: 1; align-self: start; margin: 0 0 0.6rem; }
}

/* Au téléphone, le même écart de 16 px entre toutes les cartes (l'appel et « Demander à une IA » en avaient 40). */
@media (max-width: 899px) {
  .pg-main .et-duo .cta-block, .pg-main .et-pile > .ask-ai { margin-top: 16px; }
}

/* ── La méthode : au téléphone, une rangée de cartes qui défile (tout reste lisible, rien n'est replié) ── */
@media (max-width: 899px) {
  .pg-main ul.et-methode {
    display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 10px; align-items: start;
    margin: 0 -18px 0.6rem; padding: 2px 18px 10px; list-style: none;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 18px; overscroll-behavior-x: contain;
  }
  .pg-main ul.et-methode > li { margin: 0; padding: 12px 14px; scroll-snap-align: start; background: var(--fp-creux); border-radius: 12px; font-size: 0.9rem; line-height: 1.5; }
  .pg-main ul.et-methode > li > strong:first-child { display: block; margin-bottom: 3px; }
}

/* ── Le tableau des fautes au téléphone : la part sur la ligne du nom ── */
@media (max-width: 560px) {
  .pg-main table.et-fautes tr { position: relative; }
  .pg-main table.et-fautes td:first-child { padding-right: 3.4rem; }
  .pg-main table.et-fautes td[data-l] { position: absolute; top: 0.6rem; right: 0.2rem; margin: 0; font-weight: 700; color: var(--fp-titre); font-size: 0.86rem; }
  .pg-main table.et-fautes td[data-l]::before { content: none; }
}

/* ── « Pour aller plus loin » : une tuile par lien, le picto de l'épreuve de la page visée ── */
.pg-main .related.et-liens { margin-top: 1.4rem; padding-top: 0; border-top: 0; }
.pg-main .et-liens h3 { margin: 0 0 0.55rem; font-size: 1rem; }
.pg-main .et-liens ul { display: grid; gap: 8px; }
.pg-main .et-liens li { margin: 0; }
.pg-main .et-liens a {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 7px 12px 7px 8px;
  background: var(--fp-carte); border: 1px solid var(--fp-trait); border-radius: 12px;
  color: var(--fp-encre); font-weight: 600; font-size: 0.92rem; line-height: 1.35; text-decoration: none;
}
.pg-main .et-liens a:hover { border-color: var(--fp-trait-fort); box-shadow: inset 0 0 0 1px var(--fp-trait-fort); }
.pg-main .et-liens a > span:last-child { text-decoration: underline; text-decoration-color: var(--fp-trait-fort); text-underline-offset: 3px; }
.pg-main .et-liens a:hover > span:last-child { text-decoration-color: currentColor; }
@media (min-width: 900px) { .pg-main .et-duo .ask-ai { padding: 0.9rem 1rem; } }
