/* ============================================================
   ACTH — Design tokens & base
   Direction : éditoriale / premium / terrain
   ============================================================ */

:root {
  /* Couleurs */
  --night:        #161E2A;   /* bleu nuit profond (hero, footer) */
  --night-2:      #1F2A3B;
  --ink:          #11151D;   /* texte principal sur clair */
  --steel:        #3A4759;   /* secondaire */
  --muted:        #6E727A;
  --rule:         #D8D2C3;   /* filets, séparateurs sur clair */
  --rule-dark:    rgba(255,255,255,.14);

  --terre:        #6B3F22;   /* marron primaire */
  --terre-deep:   #4A2A14;
  --terre-soft:   #8C5A33;

  --bone:         #F2ECDF;   /* fond principal — papier */
  --paper:        #F7F2E7;   /* fond plus clair */
  --canvas:       #EFE7D5;   /* léger contraste */

  --jaune:        #E8B81F;   /* accent chantier */
  --jaune-deep:   #B8900F;
  --rouge:        #B2362A;   /* alerte / "Ce que nous refusons" */

  /* Typo */
  --serif: "Newsreader", "Source Serif Pro", Georgia, serif;
  --sans:  "DM Sans", "Söhne", system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "Menlo", monospace;

  /* Échelle */
  --maxw: 1320px;
  --gutter: clamp(20px, 4vw, 56px);

  /* Ombres / radius */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

::selection { background: var(--jaune); color: var(--ink); }

/* Typo display */
.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.display-italic { font-style: italic; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--steel);
}

.ref {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Layout helpers */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: clamp(72px, 9vw, 140px) 0; }
.section-sm { padding: clamp(48px, 6vw, 88px) 0; }

.hr { height: 1px; background: var(--rule); border: 0; margin: 0; }
.hr-dark { height: 1px; background: var(--rule-dark); border: 0; margin: 0; }

/* CTAs */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  border-radius: var(--r-sm);
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--jaune);
  color: var(--ink);
  border: 1px solid var(--jaune-deep);
}
.btn-primary:hover { background: var(--jaune-deep); color: var(--ink); }

.btn-dark {
  background: var(--ink);
  color: var(--bone);
  border: 1px solid var(--ink);
}
.btn-dark:hover { background: var(--terre-deep); border-color: var(--terre-deep); }

.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  opacity: .85;
}
.btn-ghost:hover { opacity: 1; background: rgba(0,0,0,.04); }

.btn-ghost-dark {
  background: transparent;
  color: var(--bone);
  border: 1px solid rgba(255,255,255,.4);
}
.btn-ghost-dark:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.7); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.link-arrow .arr { transition: transform .2s ease; }
.link-arrow:hover .arr { transform: translateX(4px); }

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--terre-soft);
  box-shadow: 0 12px 32px -16px rgba(20,20,20,0.18);
}

/* Tags / chip */
.tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--steel);
  background: rgba(255,255,255,0.4);
  font-weight: 500;
}
.tag-dark {
  border-color: rgba(255,255,255,0.25);
  color: var(--bone);
  background: rgba(255,255,255,0.04);
}
.tag-warn {
  border-color: var(--rouge);
  color: var(--rouge);
  background: rgba(178,54,42,0.06);
}

/* Form */
.field {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  transition: border-color .2s ease, background .2s ease;
}
.field:focus { outline: none; border-color: var(--terre); background: #fff; }
.field-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 8px;
  font-weight: 500;
}

/* Image treatments */
.img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--steel);
}
.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-wrap.tint::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,30,42,0.0) 30%, rgba(22,30,42,0.7) 100%);
  pointer-events: none;
}

.dark { background: var(--night); color: var(--bone); }
.dark .eyebrow { color: rgba(245,240,225,0.7); }
.dark .hr { background: var(--rule-dark); }
.dark .muted { color: rgba(245,240,225,0.65); }

.muted { color: var(--muted); }

/* Page transitions */
.page-enter { animation: pageIn .45s ease both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Hero specifics */
.hero {
  position: relative;
  min-height: calc(100vh - 84px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--night);
  color: var(--bone);
}

/* Hero stats bar (bandeau bas du hero) */
.hero-stats {
  position: relative;
  border-top: 1px solid rgba(255,255,255,0.14);
  background: rgba(22,30,42,0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  color: rgba(245,240,225,0.78);
  font-size: 13px;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-stats-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
}
.hero-stat {
  white-space: nowrap;
}
.hero-stat b {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--bone);
  margin-right: 6px;
}
.hero-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .hero-stats-row {
    padding: 12px 0 14px;
    gap: 0;
    flex-direction: column;
    align-items: stretch;
  }
  .hero-stats-items {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  .hero-stat {
    display: block;
    font-size: 13px;
    white-space: normal;
    line-height: 1.4;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: rgba(245,240,225,0.72);
    text-align: center;
  }
  .hero-stat:first-child {
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .hero-stat b {
    font-size: 16px;
    margin: 0 8px 0 0;
    color: var(--jaune);
    letter-spacing: 0.01em;
  }
  .hero-stats-badge {
    font-size: 11.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(245,240,225,0.65);
    padding-top: 12px;
    width: 100%;
    justify-content: center;
  }
  .hero-stats-badge .dot {
    width: 5px;
    height: 5px;
  }
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(0.85) contrast(1.05);
}
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(22,30,42,0.65) 0%, rgba(22,30,42,0.25) 35%, rgba(22,30,42,0.35) 60%, rgba(22,30,42,0.85) 100%);
}

/* Marquee — message rappel */
.marquee {
  display: flex;
  gap: 4rem;
  white-space: nowrap;
  animation: marquee 38s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Grid utilities */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { min-height: calc(100vh - 72px); }
}

/* Accordion */
details.acc { border-bottom: 1px solid var(--rule); padding: 22px 0; }
details.acc[open] summary .acc-mark { transform: rotate(45deg); }
details.acc summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
details.acc summary::-webkit-details-marker { display: none; }
.acc-mark {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--steel);
  border-radius: 999px;
  font-size: 14px;
  flex-shrink: 0;
  transition: transform .25s ease;
}

/* Strike — Ce que nous refusons */
.refuse-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.refuse-row:last-child { border-bottom: 1px solid var(--rule); }
.refuse-x {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: rgba(178,54,42,0.08);
  color: var(--rouge);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600;
}

/* Schemas */
.schema svg { width: 100%; height: auto; display: block; }
.schema text { font-family: var(--mono); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(242,236,223,0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.nav.is-dark {
  background: rgba(22,30,42,0.78);
  border-bottom-color: rgba(255,255,255,0.1);
  color: var(--bone);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  height: 84px;
  flex-wrap: nowrap;
  min-width: 0;
}
.nav-links {
  display: flex;
  gap: clamp(14px, 1.6vw, 28px);
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.nav-actions {
  display: flex; gap: 14px; align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
}
.nav-phone {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--terre);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(107,63,34,0.22);
  background: rgba(107,63,34,0.04);
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.nav-phone:hover {
  background: rgba(107,63,34,0.1);
  border-color: rgba(107,63,34,0.4);
}
.nav-phone-icon { flex: 0 0 auto; }
.nav.is-dark .nav-phone {
  color: var(--jaune);
  border-color: rgba(232,184,31,0.35);
  background: rgba(232,184,31,0.08);
}
.nav.is-dark .nav-phone:hover {
  background: rgba(232,184,31,0.18);
  border-color: rgba(232,184,31,0.6);
}
.nav-link {
  font-size: 14px; font-weight: 500;
  position: relative;
  padding: 4px 0;
  opacity: .82;
  transition: opacity .2s ease;
}
.nav-link:hover { opacity: 1; }
.nav-link.active { opacity: 1; }
.nav-link.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -22px;
  height: 2px; background: var(--terre);
}
.nav.is-dark .nav-link.active::after { background: var(--jaune); }

.logo {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.logo-mark {
  width: 36px; height: 36px;
  border: 1px solid currentColor;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
}
.logo small {
  display:block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: .65;
  font-weight: 500;
  margin-top: 2px;
}

/* Logo image (transparent PNG) */
.logo-img { gap: 0; }
.logo-img-wrap {
  display: inline-flex;
  align-items: center;
  height: 64px;
}
.logo-img-wrap img {
  height: 64px;
  width: auto;
  display: block;
}

/* Footer */
footer.foot {
  background: var(--night);
  color: var(--bone);
  padding: 80px 0 32px;
}
.foot a:hover { color: var(--jaune); }

/* Mobile nav */
.mobile-toggle { display: none; }
.nav-mobile { display: none; }
.nav-mobile-link {
  display: block; padding: 12px 0; font-weight: 500; font-size: 15px;
  border-bottom: 1px solid var(--rule);
}
.nav.is-dark .nav-mobile-link { border-bottom-color: rgba(255,255,255,0.1); }

/* Hide phone at intermediate widths to keep nav on one line. */
@media (max-width: 1280px) {
  .nav-phone { display: none !important; }
}

/* Shrink nav-link gap a touch on medium-large screens. */
@media (max-width: 1180px) {
  .nav-links { gap: 18px; }
  .nav-link { font-size: 13px; }
}

/* Collapse to burger menu before things start wrapping. */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .mobile-toggle { display: inline-flex; }
  .nav-mobile.is-open { display: block; padding: 12px var(--gutter) 20px; border-top: 1px solid var(--rule); }
  .nav.is-dark .nav-mobile.is-open { border-top-color: rgba(255,255,255,0.1); }
}

/* On very narrow screens, hide the CTA label — keep just the burger. */
@media (max-width: 520px) {
  .nav-cta { display: none; }
  .nav-inner { height: 72px; }
  .logo-img-wrap, .logo-img-wrap img { height: 48px; }
}

/* Small details */
.kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--steel);
}

.dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--jaune);
  display: inline-block;
  vertical-align: middle;
}

.divider-num {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 32px;
}
.divider-num .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--terre);
}
.divider-num .line { flex: 1; height: 1px; background: var(--rule); }
.dark .divider-num .num { color: var(--jaune); }
.dark .divider-num .line { background: var(--rule-dark); }

/* Image hover */
.photo-card { overflow: hidden; }
.photo-card img { transition: transform .8s ease; }
.photo-card:hover img { transform: scale(1.04); }

/* Formation card (text + media side-by-side) */
.formation-card {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  padding: 0;
  min-height: 380px;
}
.formation-card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}
.formation-card-media {
  position: relative;
  overflow: hidden;
  background: var(--ink);
}
.formation-card-media .photo-real,
.formation-card-media .photo-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}
.formation-card-media .photo-real img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 720px) {
  .formation-card {
    grid-template-columns: 1fr;
  }
  .formation-card-media {
    min-height: 260px;
    order: -1;
  }
}

/* Star/quote glyph */
.qmark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 96px;
  color: var(--terre);
  line-height: 0.6;
  display: inline-block;
}

/* ============================================================
   Responsive overrides (tablet → mobile)
   Cover inline-style grids used across templates by targeting
   exact attribute substrings. !important is required because
   inline styles otherwise win over class-level rules.
   ============================================================ */

/* ---------- ≤ 1024px : tablette paysage ---------- */
@media (max-width: 1024px) {
  /* CTA band : empile et centre */
  [style*="grid-template-columns: 1.5fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    text-align: center;
  }
  [style*="grid-template-columns: 1.5fr 1fr"] > *:last-child {
    justify-content: center !important;
  }

  /* Formations : module card image+texte */
  [style*="grid-template-columns: 1fr 1.4fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns: 1fr 1.4fr"] > [style*="order: 1"],
  [style*="grid-template-columns: 1fr 1.4fr"] > [style*="order: 2"] {
    order: 0 !important;
  }

  /* Home — formations card (1.05fr / 1fr) géré par .formation-card déjà */

  /* Méthode détaillée : 2 cols → 1 col, image en haut */
  [style*="grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  [style*="grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)"] > [style*="order: 1"],
  [style*="grid-template-columns: minmax(0, 1fr) minmax(0, 1fr)"] > [style*="order: 2"] {
    order: 0 !important;
  }
}

/* ---------- ≤ 900px : tablette portrait & gros mobile ---------- */
@media (max-width: 900px) {
  /* Pages légales / apropos / contact : sidebar + contenu */
  [style*="grid-template-columns: 1fr 2fr"],
  [style*="grid-template-columns: 1fr 1.4fr"] {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  /* Désactive le sticky du sommaire quand empilé */
  [style*="grid-template-columns: 1fr 2fr"] > aside[style*="position: sticky"],
  [style*="grid-template-columns: 1fr 2fr"] > div[style*="position: sticky"],
  [style*="grid-template-columns: 1fr 2fr"] > [style*="position: sticky"] {
    position: static !important;
    top: auto !important;
  }

  /* Home — manifeste : 120px + 1fr */
  [style*="grid-template-columns: 120px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Home — Ce que nous refusons : 5fr 7fr */
  [style*="grid-template-columns: 5fr 7fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  [style*="grid-template-columns: 5fr 7fr"] > div[style*="position: sticky"] {
    position: static !important;
    top: auto !important;
  }

  /* Formations — strip de progression (4 colonnes) → 2 colonnes */
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  [style*="grid-template-columns: repeat(4, 1fr)"] > div {
    border-right: none !important;
    border-bottom: 1px solid var(--rule);
  }
  [style*="grid-template-columns: repeat(4, 1fr)"] > div:nth-child(odd) {
    border-right: 1px solid var(--rule) !important;
  }
  [style*="grid-template-columns: repeat(4, 1fr)"] > div:nth-last-child(-n+2) {
    border-bottom: none;
  }

  /* Formations — dl tarif/durée/public (3 colonnes) */
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }

  /* Mentions / RGPD — dl à deux colonnes (label + valeur) */
  [style*="grid-template-columns: 220px 1fr"],
  [style*="grid-template-columns: 160px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 4px 0 !important;
  }
  [style*="grid-template-columns: 220px 1fr"] dt,
  [style*="grid-template-columns: 160px 1fr"] dt {
    margin-top: 12px;
  }
  [style*="grid-template-columns: 220px 1fr"] dt:first-of-type,
  [style*="grid-template-columns: 160px 1fr"] dt:first-of-type {
    margin-top: 0;
  }

  /* Conseil — jours de l'audit */
  [style*="grid-template-columns: 120px 1fr"] {
    gap: 12px !important;
  }

  /* Hero home — réduit l'espacement */
  .hero {
    padding-bottom: 0;
  }

  /* Section padding réduit */
  .section { padding: clamp(56px, 9vw, 100px) 0; }
  .section-sm { padding: clamp(40px, 6vw, 72px) 0; }

  /* Formation card maison (déjà à 720px) — assure ordre image en haut */
  .formation-card {
    grid-template-columns: 1fr;
  }
  .formation-card-media {
    order: -1;
    min-height: 240px;
  }
  .formation-card-body {
    padding: 24px;
  }

  /* Cookies table — scroll horizontal */
  .legal-content table {
    min-width: 480px;
  }

  /* Refuse-row : 60px + 1fr → 40px + 1fr */
  .refuse-row {
    grid-template-columns: 44px 1fr;
    gap: 16px;
    padding: 20px 0;
  }

  /* Admin — carte prospects */
  .map-wrapper {
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .map-filters {
    width: 100% !important;
  }
  #map {
    height: 60vh;
    min-height: 360px;
  }

  /* À propos — bloc stats (4 chiffres en bandeau dark) */
  section.dark .grid.grid-4 > div[style*="border-left"] {
    border-left: none !important;
    border-top: 1px solid var(--rule-dark);
    padding: 28px 24px !important;
    text-align: center;
  }
  section.dark .grid.grid-4 > div[style*="border-left"]:first-child {
    border-top: none;
  }
}

/* ---------- ≤ 640px : mobile ---------- */
@media (max-width: 640px) {
  /* Gutters plus serrés */
  :root { --gutter: 18px; }

  /* Hero — taille mini réduite, espacements compressés */
  .hero { min-height: auto; padding-top: 24px; }
  .hero .wrap { padding-top: 32px !important; padding-bottom: 56px !important; }

  /* Section padding */
  .section { padding: 56px 0; }
  .section-sm { padding: 40px 0; }

  /* Page banner — compresse */
  .page-banner-wrap {
    padding-top: 88px !important;
    padding-bottom: 64px !important;
  }

  /* CTA band padding */
  section[style*="padding: 80px 0"] {
    padding: 56px 0 !important;
  }

  /* Repeat(3,1fr) → 1 colonne */
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Formations — strip de progression → 1 colonne */
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns: repeat(4, 1fr)"] > div {
    border-right: none !important;
    border-bottom: 1px solid var(--rule) !important;
  }
  [style*="grid-template-columns: repeat(4, 1fr)"] > div:last-child {
    border-bottom: none !important;
  }

  /* Refuse-row : icône + texte empilés */
  .refuse-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* dl audience (auto 1fr) — empile */
  [style*="grid-template-columns: auto 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }

  /* Cards & formation-card padding */
  .formation-card-body,
  .card[style*="padding: 32px"],
  .card[style*="padding: 36px"],
  .card[style*="padding: 40px"],
  .card[style*="padding: 48px"],
  article.card > [style*="padding: 40px"] {
    padding: 22px !important;
  }
  .card[style*="padding: 28px"] {
    padding: 20px !important;
  }
  .card[style*="padding: 24px"] {
    padding: 18px !important;
  }

  /* Form card : grilles internes empilent */
  .card[style*="display: grid"] .grid.grid-2 {
    grid-template-columns: 1fr !important;
  }

  /* Réduit padding interne des dl encadrés (legal) */
  dl[style*="padding: 22px 26px"],
  dl[style*="padding: 24px 26px"] {
    padding: 18px 18px !important;
  }
  div[style*="padding: 24px 26px"] {
    padding: 18px 18px !important;
  }

  /* qmark plus petit */
  .qmark { font-size: 64px; }

  /* Marquee — texte serré */
  .marquee { font-size: 22px !important; gap: 2.5rem; }

  /* Footer — réduction de l'effet « hero text » */
  footer.foot { padding: 56px 0 24px; }

  /* Stats apropos : compresse padding + uniformise la taille des valeurs */
  section.dark .grid.grid-4 > div[style*="border-left"] {
    padding: 22px 0 !important;
  }
  section.dark .grid.grid-4 > div[style*="border-left"] > .display {
    font-size: 36px !important;
    line-height: 1.1 !important;
    margin-bottom: 6px !important;
  }

  /* Hero CTA buttons full-width */
  .hero .wrap [style*="display: flex; gap: 12px"] .btn,
  footer.foot [style*="display: flex; gap: 12px"] .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* Boutons généraux : un peu plus compacts */
  .btn { padding: 12px 18px; font-size: 13px; }

  /* Field-padding plus compact */
  .field { padding: 12px 14px; font-size: 14px; }

  /* Méthode timeline — masque la ligne horizontale en empilé */
  .grid.grid-4 + * { /* no-op */ }
  div[style*="position: absolute; top: 38px; left: 5%"] {
    display: none;
  }
}

/* ---------- ≤ 420px : très petit mobile ---------- */
@media (max-width: 420px) {
  :root { --gutter: 14px; }

  /* Logo plus discret */
  .logo-img-wrap, .logo-img-wrap img { height: 42px !important; }

  /* Boutons : empilage */
  .hero .wrap [style*="display: flex; gap: 12px"],
  footer.foot [style*="display: flex; gap: 12px"] {
    flex-direction: column;
    align-items: stretch;
  }
  .hero .wrap [style*="display: flex; gap: 12px"] .btn,
  footer.foot [style*="display: flex; gap: 12px"] .btn {
    width: 100%;
  }

  /* Réduit encore les paddings de section */
  .section { padding: 40px 0; }
  .section-sm { padding: 32px 0; }
}
