/* W3 ART · training pages (/formation, /en/training and their detail pages).
 * Loaded only by those pages (after landing.css, sections.css, overrides.css).
 * Uses existing tokens only (colors_and_type.css + landing.css gradients).
 * Mobile first: base = phone, then ≥721px (tablet) and ≥1101px (desktop),
 * matching the 720px / 1100px breakpoints of landing.css. */

/* ───────── Language before hydration ─────────
 * The page content is rendered in one language; nav/footer carry FR + EN spans.
 * Until FormationInit sets body.w3-new-landing + data-lang, show the route's
 * language instead of the overrides.css default (FR). */
body:not(.w3-new-landing) .fpage[data-page-lang="en"] .lang-en { display: revert; }
body:not(.w3-new-landing) .fpage[data-page-lang="en"] .lang-fr { display: none; }

/* ───────── Language toggle as links (same look as the buttons) ───────── */
.lang-toggle a {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: normal;
  color: var(--fg-muted);
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}
.lang-toggle a:hover { color: var(--ink); }
.lang-toggle a[aria-current="page"] { background: var(--ink); color: var(--cream); }
.lang-toggle a[aria-current="page"]:hover { color: var(--cream); }
@media (max-width: 720px) {
  .lang-toggle a { padding: 10px 14px; font-size: 13px; }
}

/* Active nav item */
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.mnav__links a[aria-current="page"] { font-weight: 500; }

/* ───────── Utilities ───────── */
.fm-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ───────── Breadcrumb ───────── */
.fm-crumbs { padding-top: 24px; font-size: 13px; line-height: 1.45; color: var(--fg-muted); }
.fm-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.fm-crumbs li { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; }
.fm-crumbs a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--grey-25);
  text-underline-offset: 3px;
}
.fm-crumbs a:hover { text-decoration-color: currentColor; }

/* ───────── Page header ───────── */
.fm-hero { padding: 48px 0 56px; }
.fm-hero--detail { padding-top: 32px; }
.fm-eyebrow {
  margin: 0 0 20px;
  font-family: var(--font-body);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted);
}
.fm-title {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(44px, 7vw, 104px);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  max-width: 18ch;
  text-wrap: balance;
}
.fm-hero--detail .fm-title { font-size: clamp(40px, 5.6vw, 84px); max-width: 22ch; }
/* Highlight: same gradient + italic-overshoot fix as the home section titles. */
.fm-title em {
  background: linear-gradient(118deg, var(--grad-1) 0%, var(--grad-2) 50%, var(--grad-3) 100%);
  background-size: 200% 200%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  animation: grad-shift 14s ease-in-out infinite alternate;
  padding-inline-end: 0.08em;
  margin-inline-end: -0.06em;
}
.fm-lead {
  margin: 24px 0 0;
  max-width: 60ch;
  font-size: 18px;
  line-height: 1.55;
  color: var(--grey-80);
}
.fm-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.fm-ctas .btn { width: 100%; justify-content: center; text-align: center; line-height: 1.2; }

/* Key figures (detail header) */
.fm-figures {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.fm-figure {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 16px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-poster);
}
.fm-figure__value {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
}
.fm-figure__label { font-size: 13px; line-height: 1.45; color: var(--fg-muted); }

/* ───────── Sections ───────── */
.fm-section { padding: var(--section-pad) 0; border-top: 1px solid var(--border); }
.fm-section .section__head { margin-bottom: 32px; }
.fm-section .section__title { font-size: clamp(34px, 4.4vw, 60px); }

.fm-prose {
  margin: 0 0 14px;
  max-width: 62ch;
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg);
}
.fm-prose:last-child { margin-bottom: 0; }
.fm-prose a,
.fm-band__note a {
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

/* Dash list (same marker as the home service lists) */
.fm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 70ch;
  display: flex; flex-direction: column; gap: 12px;
}
.fm-list li {
  position: relative;
  padding-left: 28px;
  font-size: 17px;
  line-height: 1.55;
}
.fm-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.78em;
  width: 14px; height: 2px;
  background: var(--drop-color);
}
.fm-prose + .fm-list { margin-top: 4px; }

/* ───────── Cards (ink border + poster shadow) ───────── */
.fm-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.fm-grid > li { display: flex; min-width: 0; }
.fm-grid > li > .fm-card { flex: 1; min-width: 0; }

.fm-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px 20px 22px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-poster);
  color: var(--fg);
}
.fm-card__head {
  margin: 0;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  font-family: var(--font-body);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.fm-card__code {
  padding: 3px 9px;
  border: 1px solid var(--ink);
  border-radius: var(--r-pill);
  font-weight: 500;
}
.fm-card__cat { color: var(--fg-muted); }
.fm-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 2.3vw, 32px);
  line-height: 1.08;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
  color: var(--ink);
}
/* Accent highlight on cards: deep drop colour keeps text contrast on the wall bg. */
.fm-card__title em { font-style: italic; color: var(--drop-color-deep); }
.fm-card__lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--grey-80);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.fm-facts {
  list-style: none;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
  font-size: 14px;
  line-height: 1.4;
}
.fm-facts strong { font-weight: 500; }
.fm-facts span { color: var(--fg-muted); }
.fm-card__note {
  margin: 0;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--grad-1) 18%, var(--bg)),
    color-mix(in oklab, var(--grad-2) 14%, var(--bg)));
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}
.fm-card__links {
  margin-top: auto;
  padding-top: 8px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
}
.fm-card__more { font-size: 20px; }
.fm-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}
.fm-pill:hover { background: var(--ink); color: var(--cream); }

.fm-card--short .fm-card__title { font-size: clamp(24px, 2vw, 28px); }
.fm-all { margin: 32px 0 0; }

/* Detail § 04: programme */
.fm-program { display: grid; grid-template-columns: 1fr; gap: 24px; }
.fm-card--program { padding: 24px 20px; }
.fm-card--program .fm-card__title { font-size: clamp(24px, 2.1vw, 30px); }
.fm-modules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fm-modules li {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.fm-modules li:last-child { padding-bottom: 0; }
.fm-modules strong { font-weight: 500; font-size: 16px; line-height: 1.35; }
.fm-modules span { font-size: 15px; line-height: 1.55; color: var(--grey-80); }

/* ───────── § 02 comparison table (stacked cards on mobile) ───────── */
.fm-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.fm-table,
.fm-table tbody,
.fm-table tr,
.fm-table th,
.fm-table td { display: block; }
.fm-table thead {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.fm-table tbody { display: flex; flex-direction: column; gap: 16px; }
.fm-table tbody tr {
  padding: 4px 18px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-poster);
}
.fm-table th,
.fm-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.fm-table tbody tr > :last-child { border-bottom: 0; }
.fm-table td::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 4px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted);
}
.fm-table tbody th { font-weight: 400; }
.fm-table tbody th a {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.15;
  text-decoration: underline;
  text-decoration-color: var(--grey-25);
  text-underline-offset: 4px;
}
.fm-table tbody th a:hover { text-decoration-color: currentColor; }
.fm-table__code {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted);
}
.fm-table td strong { font-weight: 500; }
.fm-table__muted { display: block; font-size: 13px; color: var(--fg-muted); }

/* ───────── § 03 approach (reuses the home .service cards) ───────── */
.fm-approach .service { min-height: 0; }
.fm-approach .service__name { font-size: clamp(26px, 2.4vw, 34px); }

/* ───────── Results ───────── */
.fm-results {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.fm-stat {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 10px;
  padding: 20px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.fm-stat__value {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
}
.fm-stat__detail {
  display: block;
  margin-top: 8px;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--fg-muted);
}
.fm-stat__label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted);
}
.fm-footnote {
  margin: 20px 0 0;
  max-width: 80ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-muted);
}

/* ───────── Final ink band + legal notice ───────── */
.fm-band .contact__inner { grid-template-columns: 1fr; }
.fm-band .contact__title { max-width: 16ch; }
.fm-band .contact__ctas .btn { justify-content: center; }
.fm-band__note { margin: 32px 0 0; font-size: 14px; line-height: 1.5; color: var(--grey-15); }
.fm-band__note a { color: var(--cream); }
.fm-band__note a:hover { color: var(--drop-color); }

.fm-legal {
  margin: 0;
  padding: 28px 0;
  max-width: 110ch;
  font-size: 12px;
  line-height: 1.6;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
}

/* ───────── ≥ 541px ───────── */
@media (min-width: 541px) {
  .fm-ctas .btn { width: auto; }
}

/* ───────── ≥ 721px (tablet) ───────── */
@media (min-width: 721px) {
  .fm-hero { padding: 80px 0 88px; }
  .fm-hero--detail { padding-top: 40px; }
  .fm-lead { font-size: 20px; }
  .fm-crumbs { padding-top: 32px; }

  /* Text sections line up with the section title column (60px index + 48px gap). */
  .fm-section__body > .fm-prose,
  .fm-section__body > .fm-list { margin-left: 108px; }

  .fm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .fm-card { padding: 28px 26px 24px; }
  .fm-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fm-stat { padding: 28px 24px; }
  .fm-program--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Real table from tablet up */
  .fm-table { display: table; }
  .fm-table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: table-header-group; }
  .fm-table tbody { display: table-row-group; }
  .fm-table tr { display: table-row; }
  .fm-table th,
  .fm-table td { display: table-cell; padding: 18px 20px; }
  .fm-table tbody tr { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .fm-table td::before { content: none; }
  .fm-table tbody tr > :last-child { border-bottom: 1px solid var(--border); }
  .fm-table tbody tr:last-child > * { border-bottom: 0; }
  .fm-table thead th {
    font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
    font-weight: 500;
    color: var(--fg-muted);
    border-bottom: 1.5px solid var(--ink);
  }
  .fm-table tbody th a { font-size: 20px; }
  .fm-table td:nth-child(3) { white-space: nowrap; }
  .fm-table-wrap {
    background: var(--bg-elevated);
    border: 1.5px solid var(--ink);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-poster);
    overflow-x: auto;
  }
}

/* ───────── ≥ 1101px (desktop) ───────── */
@media (min-width: 1101px) {
  .fm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fm-figures { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .fm-figure { padding: 22px 20px; }
  .fm-figure__value { font-size: 36px; }
  .fm-program--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fm-card--program { padding: 28px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .fm-title em { animation: none; }
}
