/* Tuto Mix : composants partagés (Button, Eyebrow, Pill, MediaFrame, CheckList, StatBlock, Icon).
   Un correctif propre à un bloc se fait dans le style.css du bloc, jamais ici. */

/* Icône : trait fin, couleur héritée */
.tm-icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* Bouton : primary = aplat accent (un seul par section), secondary = contour + halo au survol */
.tm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-body); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-button);
  text-transform: uppercase; text-align: center; text-decoration: none; line-height: 1.3;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}
.tm-btn--sm { font-size: var(--text-button-sm); padding: 12px 20px; }
.tm-btn--md { font-size: var(--text-button-sm); padding: 14px 24px; }
.tm-btn--lg { font-size: var(--text-button); padding: 16px 28px; }
.tm-btn--xl { font-size: var(--text-button); padding: 18px 36px; }
/* Bouton d'appel des sections (maquettes v4 : 18 / 32 en desktop ; 13 px, 16 / 20, pleine largeur en mobile) */
.tm-btn--cta { font-size: var(--text-button); padding: 18px 32px; }
.tm-btn--primary { background: var(--accent); color: var(--text-on-accent); }
.tm-btn--primary:hover, .tm-btn--primary:focus-visible { background: var(--accent-hover); color: var(--text-on-accent); }
.tm-btn--secondary { background: transparent; color: var(--text-primary); border-color: var(--border-default); }
.tm-btn--secondary:hover, .tm-btn--secondary:focus-visible { background: var(--surface-card); color: var(--text-primary); border-color: var(--border-strong); box-shadow: var(--glow-hover); }

/* Sur-titre mono en capitales (CSS), couleur accent */
.tm-eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--accent-ink); line-height: 1.4;
}
.tm-eyebrow--muted { color: var(--text-subtle); }

/* Pastille */
.tm-pill {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  border: 1px solid var(--border-default); background: var(--surface-card); border-radius: var(--radius-pill);
  padding: 8px 14px; font-family: var(--font-body); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); line-height: 1.3;
}
.tm-pill__dot { width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--accent-ink); flex-shrink: 0; }

/* Cadre média : image en cover, hachures + légende mono si vide, pastille play si vidéo */
.tm-media {
  position: relative; width: 100%; aspect-ratio: var(--tm-ratio, auto);
  border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
  overflow: hidden; background: var(--texture-hatch); min-height: 0;
}
.tm-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--tm-ox, 50%) var(--tm-oy, 50%); transform: scale(var(--tm-zoom, 1)); transform-origin: var(--tm-ox, 50%) var(--tm-oy, 50%); }
.tm-media--contain { background: #000; } /* vignette de vidéo verticale dans un cadre 16/9 : image entière, bandes noires */
.tm-media--contain img { object-fit: contain; }
.tm-media:has(img):not(.tm-media--contain) { background: none; } /* hachures réservées aux emplacements vides (PNG transparents) */
.tm-media__label {
  position: absolute; bottom: 12px; left: 12px; right: 12px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-subtle); line-height: 1.4;
}
.tm-media__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: var(--radius-pill); background: var(--accent); color: var(--text-on-accent);
  display: flex; align-items: center; justify-content: center;
}
.tm-media--xl .tm-media__play { width: 72px; height: 72px; }
.tm-media--xl .tm-media__play .tm-icon { width: 26px; height: 26px; }

/* Façade vidéo cliquable (remplacée par l'iframe au clic, assets/js/app.js) */
.tm-video { all: unset; display: block; width: 100%; cursor: pointer; border-radius: var(--radius-lg); }
.tm-video:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.tm-video:hover .tm-media__play { background: var(--accent-hover); }
.tm-video__iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-lg); display: block; }

/* Liste à coches (accent), points ou croix */
.tm-checklist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.tm-checklist li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.55; color: var(--text-secondary); }
.tm-checklist li .tm-icon { color: var(--accent-ink); margin-top: 2px; }
.tm-checklist--lg { gap: 16px; }
.tm-checklist--lg li { gap: 14px; font-size: 17px; }

/* Chiffre clé */
.tm-stat { display: flex; flex-direction: column; gap: 6px; }
.tm-stat__value {
  font-family: var(--font-display); font-stretch: var(--font-display-stretch); font-weight: var(--weight-black);
  font-size: var(--text-stat); line-height: 1; letter-spacing: -0.04em; color: var(--text-primary);
}
.tm-stat__value.is-highlight { color: var(--accent-ink); }
.tm-stat__label { font-size: var(--text-small); color: var(--text-muted); }

@media (max-width: 768px) {
  .tm-media { aspect-ratio: var(--tm-ratio-m, var(--tm-ratio, auto)); border-radius: var(--radius-md); }
  .tm-video, .tm-video__iframe { border-radius: var(--radius-md); }
  .tm-pill { gap: 8px; padding: 7px 12px; font-size: 11px; }
  .tm-pill__dot { width: 5px; height: 5px; }
  .tm-eyebrow { font-size: 10px; }
  .tm-checklist--lg li { font-size: 16px; }
}

/* ------------------------------------------------------------------ */
/* Titres de section (Heading du DS) et H2                             */
/* ------------------------------------------------------------------ */
.tm-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 640px; } /* maquettes v4 : 640 */
.tm-heading--wide { max-width: 900px; }
.tm-heading--center { align-self: center; align-items: center; text-align: center; }
.tm-heading__kicker { font-size: 20px; line-height: 1.55; font-weight: var(--weight-semibold); color: var(--text-primary); }
.tm-heading__lead { font-size: 17px; line-height: 1.6; color: var(--text-muted); }

.tm-h2 {
  font-family: var(--font-display); font-stretch: var(--font-display-stretch); font-weight: var(--weight-black);
  font-size: var(--tm-h2, 40px); line-height: 1.1; letter-spacing: var(--tracking-h2); color: var(--text-primary);
  text-wrap: wrap; /* maquettes v4 : pas d'équilibrage des H2 */
}
.tm-h2--xl { line-height: 1.08; letter-spacing: var(--tracking-display); }
.tm-h2--sm { line-height: 1.15; }
.tm-h2--bold { font-weight: var(--weight-bold); letter-spacing: var(--tracking-h3); }

/* Titre de carte (H3) */
.tm-h3 {
  font-family: var(--font-display); font-stretch: var(--font-display-stretch); font-weight: var(--weight-bold);
  font-size: var(--tm-h3, 22px); line-height: normal; letter-spacing: var(--tracking-h3); color: var(--text-primary); /* maquettes : interligne non fixé */
}

/* Numéro de carte (01, 1 /) */
.tm-num {
  font-family: var(--font-display); font-stretch: var(--font-display-stretch); font-weight: var(--weight-black);
  font-size: 14px; letter-spacing: 0.08em; color: var(--accent-ink); line-height: normal;
}

/* Carte de base : fond carte, filet, grand rayon, aucune ombre ; filet plus marqué au survol */
.tm-card {
  display: flex; flex-direction: column; gap: 16px; min-width: 0; height: 100%;
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 32px;
  transition: border-color var(--transition-fast);
}
.tm-card--page { background: var(--surface-page); }
.tm-card--tinted { background: var(--accent-surface); border-color: var(--accent-line); }

/* ------------------------------------------------------------------ */
/* Contenu riche (Content du DS) : HTML du champ texte riche           */
/* Taille et ton par défaut selon le contexte ; classes tm-fs-*, tm-tone-*, tm-display pour les exceptions. */
/* ------------------------------------------------------------------ */
.tm-prose { --tm-pfs: 18px; --tm-gap: 24px; --tm-ptone: var(--text-secondary); display: flex; flex-direction: column; gap: var(--tm-gap); min-width: 0; }
.tm-prose--card { --tm-pfs: 16px; --tm-gap: 16px; }
.tm-prose--note { --tm-pfs: 15px; --tm-gap: 10px; }
.tm-prose--faq { --tm-pfs: 16px; --tm-gap: 12px; }
.tm-prose--outro { --tm-pfs: 18px; --tm-gap: 12px; --tm-ptone: var(--text-muted); }
.tm-prose--highlight { --tm-pfs: 17px; --tm-gap: 24px; }
.tm-prose--result { --tm-pfs: 19px; --tm-gap: 12px; --tm-lh: 1.6; }
.tm-prose > * { margin: 0; }

.tm-prose p, .tm-prose li { font-size: var(--tm-fs, var(--tm-pfs)); line-height: var(--tm-lh, 1.7); color: var(--tm-tone, var(--tm-ptone)); }
.tm-prose--card, .tm-prose--note, .tm-prose--faq { --tm-lh: 1.7; }
.tm-prose--highlight { --tm-lh: 1.6; }
/* Maquette Le Parcours : texte courant en 18 px avec un interligne de 1,75 (Accueil et Cours : 1,7) */
[data-theme="parcours"] .tm-prose--text { --tm-lh: 1.75; }
.tm-prose ul.tm-fs-18 li, .tm-prose ol.tm-fs-18 li { line-height: 1.6; }
[data-theme="parcours"] .tm-prose ul li, [data-theme="parcours"] .tm-prose ol li { line-height: 1.6; } /* maquette Le Parcours : listes à 1,6 */
.tm-prose a:not(.tm-btn) { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.tm-prose em { font-style: italic; }

/* Tailles (paragraphes, listes) */
.tm-fs-13 { --tm-fs: 13px; --tm-lh: 1.6; }
.tm-fs-14 { --tm-fs: 14px; --tm-lh: 1.6; }
.tm-fs-15 { --tm-fs: 15px; }
.tm-fs-16 { --tm-fs: 16px; }
.tm-fs-17 { --tm-fs: 17px; }
.tm-fs-18 { --tm-fs: 18px; }
.tm-fs-19 { --tm-fs: 19px; }
.tm-fs-20 { --tm-fs: 20px; }
.tm-fs-24 { --tm-fs: 24px; }
.tm-fs-32 { --tm-fs: 32px; }
.tm-fs-36 { --tm-fs: 36px; }

/* Tons */
.tm-tone-primary { --tm-tone: var(--text-primary); }
.tm-tone-secondary { --tm-tone: var(--text-secondary); }
.tm-tone-muted { --tm-tone: var(--text-muted); }
.tm-tone-subtle { --tm-tone: var(--text-subtle); }
.tm-tone-accent { --tm-tone: var(--accent-ink); }
.tm-prose .tm-strong { font-weight: var(--weight-semibold); }

/* Paragraphe « display » : chiffre ou accroche en Archivo */
.tm-prose p.tm-display { font-family: var(--font-display); font-stretch: var(--font-display-stretch); font-weight: var(--weight-black); line-height: 1; letter-spacing: var(--tracking-display); --tm-ptone: var(--text-primary); }
/* Chiffre suivi de sa légende : groupés à 8 px (maquette Le Parcours, « Tu rejoins une école… ») */
.tm-prose p.tm-display.tm-fs-32 + p:not(.tm-display) { margin-top: calc(8px - var(--tm-gap)); line-height: normal; }
.tm-prose p.tm-display.tm-fs-20, .tm-prose p.tm-display.tm-fs-24 { font-weight: var(--weight-semibold); line-height: 1.35; letter-spacing: normal; }

/* Intertitres */
.tm-prose h2 {
  font-weight: var(--weight-black); font-size: var(--tm-fs, 32px); line-height: 1.15; letter-spacing: var(--tracking-h2);
  color: var(--text-primary); scroll-margin-top: calc(var(--header-h) + 30px);
}
/* Intertitre H2 dans un texte long : nouveau groupe, 48 au-dessus (maquette Le Parcours) */
.tm-prose--text > * + h2 { margin-top: calc(48px - var(--tm-gap)); }
.tm-prose h3 { margin-top: 8px; font-weight: var(--weight-bold); font-size: var(--tm-fs, 22px); line-height: 1.25; letter-spacing: var(--tracking-h3); color: var(--tm-tone, var(--text-primary)); }
.tm-prose h4 { font-weight: var(--weight-bold); font-size: 18px; letter-spacing: -0.01em; color: var(--text-primary); }
.tm-prose .tm-eyebrow { font-size: var(--text-eyebrow); }

/* Listes : points accent (défaut), coches accent, croix grises, numéros */
.tm-prose ul, .tm-prose ol { padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; --tm-pfs-list: 17px; }
.tm-prose ul li, .tm-prose ol li { font-size: var(--tm-fs, var(--tm-pfs-list)); line-height: 1.55; position: relative; padding-left: 19px; }
.tm-prose ul li::before { content: ""; position: absolute; left: 0; top: calc(var(--tm-fs, var(--tm-pfs-list)) * 0.6); width: 5px; height: 5px; border-radius: var(--radius-pill); background: var(--accent-ink); }
.tm-prose ul.tm-list--check li, .tm-prose ul.tm-list--cross li { padding-left: 32px; }
.tm-prose ul.tm-list--check li::before, .tm-prose ul.tm-list--cross li::before {
  width: 18px; height: 18px; border-radius: 0; top: calc((var(--tm-fs, var(--tm-pfs-list)) * 1.55 - 18px) / 2);
  -webkit-mask: var(--tm-mask) center / 18px no-repeat; mask: var(--tm-mask) center / 18px no-repeat;
}
.tm-prose ul.tm-list--check li::before { background: var(--accent-ink); --tm-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E"); }
.tm-prose ul.tm-list--cross li { color: var(--text-muted); }
.tm-prose ul.tm-list--cross li::before { background: var(--text-subtle); --tm-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
.tm-prose ol { counter-reset: tm-ol; gap: 10px; }
.tm-prose ol li { counter-increment: tm-ol; padding-left: 24px; }
.tm-prose ol li::before { content: counter(tm-ol) "."; position: absolute; left: 0; color: var(--text-subtle); }

/* Citation en carte (accent = texte couleur accent) */
.tm-prose blockquote {
  padding: 24px 32px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  font-family: var(--font-display); font-stretch: var(--font-display-stretch); font-weight: var(--weight-semibold);
  font-size: 22px; line-height: 1.35; color: var(--text-primary);
}
.tm-prose blockquote p { font: inherit; color: inherit; line-height: inherit; }
.tm-prose blockquote.tm-quote--accent { border-color: var(--border-default); color: var(--accent-ink); }

/* Encadrés (card du DS) : carte, ou note sur fond de page */
.tm-prose .tm-box { display: flex; flex-direction: column; gap: 16px; padding: 32px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); --tm-pfs: 17px; --tm-lh: 1.7; }
.tm-prose .tm-box--note { gap: 10px; padding: 20px; background: var(--surface-page); border-radius: var(--radius-md); --tm-pfs: 15px; --tm-lh: 1.6; }
.tm-prose .tm-box > * { margin: 0; }

/* Image ou emplacement d'image dans le texte */
.tm-prose figure { margin: 0; }
.tm-prose figure img, .tm-prose > img { width: 100%; height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); }
.tm-prose figure.tm-figure--fixed { height: var(--tm-h, auto); }
.tm-prose figure.tm-figure img { width: auto; max-width: 100%; max-height: 520px; } /* image entière, jamais déformée ni recadrée */
.tm-prose figure.tm-figure--fixed img { height: 100%; object-fit: cover; }
.tm-prose .tm-media { height: var(--tm-h, auto); border-radius: var(--radius-md); }

/* Galerie d'images dans le texte (2 ou 3 colonnes, légendes) et texte + image côte à côte (Le Parcours, oct. 2026) */
.tm-prose .tm-gallery { display: grid; grid-template-columns: repeat(var(--tm-cols, 2), minmax(0, 1fr)); gap: 16px; }
.tm-prose .tm-gallery--3 { --tm-cols: 3; }
.tm-prose .tm-gallery figure { display: flex; flex-direction: column; gap: 10px; }
.tm-prose .tm-gallery img { aspect-ratio: var(--tm-ratio, 4 / 3); object-fit: cover; }
.tm-prose figcaption { font-size: 14px; line-height: 1.5; color: var(--text-muted); text-align: center; }
.tm-prose .tm-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.tm-prose .tm-split > div { display: flex; flex-direction: column; gap: var(--tm-gap); }
.tm-prose .tm-split--narrow { grid-template-columns: minmax(0, 1fr) minmax(0, 220px); }
@media (max-width: 768px) {
  .tm-prose .tm-gallery--3 { --tm-cols: 1; }
  .tm-prose .tm-gallery--3 img { aspect-ratio: 16 / 9; }
  .tm-prose .tm-split, .tm-prose .tm-split--narrow { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

/* Pastilles (liste en ligne) et citation centrée (Le Parcours, oct. 2026) */
.tm-prose ul.tm-chips { flex-direction: row; flex-wrap: wrap; gap: 12px; }
.tm-prose ul.tm-chips li { padding: 12px 20px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-page); font-size: 15px; font-weight: var(--weight-semibold); color: var(--text-primary); flex: 1 1 160px; text-align: center; }
.tm-prose ul.tm-chips li::before { display: none; }
.tm-prose blockquote.tm-quote--center { align-self: center; text-align: center; max-width: 560px; }
.tm-prose .tm-cta--center { justify-content: center; align-self: center; }

/* Bouton dans le texte */
.tm-prose .tm-cta { display: flex; }
.tm-prose .tm-cta--primary { margin-top: 8px; }

/* Vignette de logo (Qualiopi) */
.tm-prose .tm-logo-box { width: 96px; height: 60px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--surface-page); color: var(--text-subtle); font-size: 12px; }
.tm-prose .tm-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; border: 0; border-radius: 0; }

/* Rangée de chiffres séparée par un filet */
.tm-stat-row { display: grid; grid-template-columns: repeat(var(--tm-n, 3), minmax(0, 1fr)); gap: 16px; border-top: 1px solid var(--border-subtle); padding-top: 24px; }
.tm-stat-row__value { font-family: var(--font-display); font-stretch: var(--font-display-stretch); font-weight: var(--weight-black); font-size: 32px; letter-spacing: -0.03em; line-height: 1.1; color: var(--text-primary); }
.tm-stat-row__value.is-highlight { color: var(--accent-ink); }
.tm-stat-row__label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

@media (max-width: 768px) {
  .tm-heading { gap: 12px; }
  .tm-heading__kicker { font-size: 17px; }
  .tm-heading__lead { font-size: 15px; }
  .tm-h2 { font-size: var(--tm-h2-m, min(var(--tm-h2, 40px), var(--text-h2-mobile))); }
  .tm-h2--sm { font-size: var(--tm-h2-m, min(var(--tm-h2, 32px), 24px)); }
  .tm-h3 { font-size: min(var(--tm-h3, 22px), var(--text-h3-mobile)); }
  .tm-card { padding: 24px; }
  .tm-prose { --tm-gap: 16px; }
  .tm-prose--note { --tm-gap: 10px; }
  .tm-prose--faq { --tm-gap: 12px; }
  .tm-prose--result { --tm-pfs: 17px; --tm-gap: 10px; }
  .tm-prose--highlight ul { gap: 12px; }
  .tm-prose ul.tm-list--check li::before, .tm-prose ul.tm-list--cross li::before { width: 16px; height: 16px; -webkit-mask-size: 16px; mask-size: 16px; }
  .tm-prose ul.tm-list--check li, .tm-prose ul.tm-list--cross li { padding-left: 28px; }
  /* Échelle mobile relevée sur les maquettes v4 : 14→13, 16→15, 17→15, 18→16, 19/20→17, 24→19, 32/36→28 */
  .tm-prose--text, .tm-prose--outro { --tm-pfs: 16px; }
  .tm-prose--card, .tm-prose--faq, .tm-prose--highlight { --tm-pfs: 15px; }
  .tm-prose ul, .tm-prose ol { --tm-pfs-list: 15px; }
  .tm-fs-14 { --tm-fs: 13px; }
  .tm-fs-16, .tm-fs-17 { --tm-fs: 15px; }
  .tm-fs-18 { --tm-fs: 16px; }
  .tm-fs-19, .tm-fs-20 { --tm-fs: 17px; }
  .tm-fs-24 { --tm-fs: 19px; }
  .tm-fs-32, .tm-fs-36 { --tm-fs: 28px; }
  .tm-prose h2 { font-size: min(var(--tm-fs, 32px), 26px); } /* maquette mobile : 32 → 26 */
  .tm-prose h3 { font-size: min(var(--tm-fs, 22px), 20px); }
  .tm-prose p.tm-display.tm-fs-32 + p:not(.tm-display) { margin-top: calc(0px - var(--tm-gap)); --tm-fs: 14px; } /* maquette mobile : légende collée, en 14 */
  .tm-prose h3.tm-fs-24 { font-size: 21px; line-height: normal; } /* maquette Le Parcours mobile : 24 → 21 */
  .tm-prose blockquote { padding: 20px 24px; font-size: 18px; }
  .tm-prose .tm-box { padding: 24px; --tm-pfs: 15px; }
  .tm-prose .tm-box--note { padding: 20px; --tm-pfs: 14px; }
  .tm-prose .tm-box--note .tm-fs-15 { --tm-fs: 14px; } /* maquette mobile : échange en 14 */
  .tm-prose .tm-media, .tm-prose figure.tm-figure--fixed { height: var(--tm-h-m, var(--tm-h, auto)); }
  .tm-prose figure.tm-figure img { max-height: 320px; } /* hauteur mobile relevée (image-slot « -m ») */
  .tm-prose .tm-cta, .tm-prose .tm-cta .tm-btn { width: 100%; }
  .tm-stat-row__value { font-size: 24px; }
  .tm-btn--cta { width: 100%; font-size: 13px; padding: 16px 20px; }
}
