/* =========================================================================
   Soutien Santé Mentale — socle : remise à zéro, jetons de design, typo
   ========================================================================= */

/* ---------- Jetons de design ---------- */

:root {
  /* Marques principales */
  --navy-900: #16203c;
  --navy-800: #1f2a4a;
  --navy-700: #2b3860;
  --navy-600: #3c4a75;

  /* Texte. Les quatre niveaux passent le contraste WCAG AA (4,5:1) sur fond blanc :
     ink 14,1 · ink-soft 7,4 · muted 5,2 · faint 4,6. Ne pas éclaircir ces valeurs
     sans recompter le rapport de contraste. */
  --ink: #1f2a4a;
  --ink-soft: #4a5570;
  --ink-muted: #5f6a85;
  --ink-faint: #6b7690;
  --on-dark: #ffffff;

  /* Surfaces */
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-mint: #eef7f2;
  --bg-lavender: #f4f1fc;
  --bg-peach: #fdf1ec;
  --surface: #ffffff;
  --surface-raised: #ffffff;

  /* Accents */
  --green: #2f8f6f;
  --green-dark: #22715a;
  --green-soft: #dff1e8;
  --teal: #1f7d8c;
  --teal-soft: #dcf0f2;
  --blue: #3f6fc4;
  --blue-soft: #e3ebfa;
  --purple: #6f5bc4;
  --purple-soft: #e9e4f8;
  --peach: #c8663f;
  --peach-soft: #fbe6dc;
  --red: #d8403f;
  --red-dark: #b93333;
  --red-soft: #fbe2e0;
  --green-border: #b9ddcd;

  /* Bordures & ombres */
  --border: #e5e9f2;
  --border-strong: #d3daE8;
  --border-soft: #eef1f7;
  --ring: 0 0 0 3px rgba(47, 143, 111, 0.28);
  --shadow-xs: 0 1px 2px rgba(22, 32, 60, 0.05);
  --shadow-sm: 0 2px 8px rgba(22, 32, 60, 0.06);
  --shadow-md: 0 6px 20px rgba(22, 32, 60, 0.08);
  --shadow-lg: 0 18px 44px rgba(22, 32, 60, 0.12);
  --shadow-focus: 0 0 0 4px rgba(111, 91, 196, 0.25);

  /* Typographie */
  --font-display: "Poppins", "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --step--2: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);
  --step--1: clamp(0.84rem, 0.81rem + 0.14vw, 0.92rem);
  --step-0: clamp(1rem, 0.97rem + 0.16vw, 1.08rem);
  --step-1: clamp(1.16rem, 1.09rem + 0.34vw, 1.36rem);
  --step-2: clamp(1.36rem, 1.22rem + 0.66vw, 1.78rem);
  --step-3: clamp(1.60rem, 1.36rem + 1.16vw, 2.32rem);
  --step-4: clamp(1.88rem, 1.48rem + 1.92vw, 3.02rem);
  --step-5: clamp(2.20rem, 1.60rem + 2.86vw, 3.90rem);

  /* Espacements */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* Rayons */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Gabarit */
  --container: 1180px;
  --container-narrow: 760px;
  --gutter: clamp(1rem, 0.6rem + 1.8vw, 2.25rem);
  --header-h: 76px;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Remise à zéro ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  /* Filet de sécurité : aucun débordement horizontal, même si un composant
     troisième party déborde. `clip` ne crée pas de contexte de défilement. */
  overflow-x: clip;
}

body.is-locked {
  overflow: hidden;
}

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

/* Les icônes SVG restent en ligne (elles apparaissent dans les titres et le
   texte), ne sont jamais compressées par un conteneur flex. */
svg {
  display: inline-block;
  vertical-align: -0.15em;
  flex: none;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: var(--green-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--navy-700);
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--sp-6) 0;
}

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

::selection {
  background: var(--green-soft);
  color: var(--navy-800);
}

/* ---------- Titres ---------- */

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: -0.018em;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
  font-weight: 700;
}

h2 {
  font-size: var(--step-3);
  font-weight: 700;
}

h3 {
  font-size: var(--step-2);
  font-weight: 650;
}

h4 {
  font-size: var(--step-1);
  font-weight: 650;
}

h5 {
  font-size: var(--step-0);
  font-weight: 650;
}

p {
  margin: 0 0 var(--sp-4);
}

p:last-child {
  margin-bottom: 0;
}

small {
  font-size: var(--step--1);
}

/* ---------- Utilitaires ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: clamp(2.75rem, 1.8rem + 4vw, 5.25rem);
}

.section--tight {
  padding-block: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
}

.section--mint {
  background: var(--bg-mint);
}

.section--soft {
  background: var(--bg-soft);
}

.section--lavender {
  background: var(--bg-lavender);
}

.stack > * + * {
  margin-top: var(--sp-4);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  z-index: 200;
  padding: 0.7rem 1.15rem;
  background: var(--navy-800);
  color: #fff;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

.text-center {
  text-align: center;
}

.lead {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--ink-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--sp-3);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-dark);
}

.eyebrow--purple {
  color: var(--purple);
}

.eyebrow--peach {
  color: var(--peach);
}

.eyebrow--red {
  color: var(--red);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.section-head__text {
  max-width: 56ch;
}

.section-head__text p {
  color: var(--ink-muted);
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: var(--sp-5);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

.divider {
  border-top: 1px solid var(--border);
  margin-block: var(--sp-6);
}

/* ---------- Mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Impression ---------- */

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .no-print {
    display: none !important;
  }

  body {
    font-size: 11pt;
    color: #000;
  }

  .prose a {
    text-decoration: underline;
  }
}
