/* ==========================================================================
   FD Stratégies — Base : reset, typographie, layout, accessibilité
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Décalage d'ancre pour la barre collante. */
  scroll-padding-top: 6.5rem;
}

/* Lenis pilote le défilement en JS : on neutralise le smooth natif pour
   éviter la double interpolation. */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

body {
  margin: 0;
  background-color: var(--fds-bg);
  color: var(--fds-text);
  font-family: var(--fds-font-body);
  font-size: var(--fds-fs-body);
  font-weight: 400;
  line-height: var(--fds-lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Verrou de défilement (menu mobile ouvert) sans saut de mise en page. */
body.fds-locked { overflow: hidden; }

/* --- Titres ---------------------------------------------------------------
   Spectral pour l'éditorial, Montserrat pour l'interface (charte 04). */
h1, h2, .fds-display {
  font-family: var(--fds-font-title);
  font-weight: var(--fds-weight-title);
  color: var(--fds-heading);
  letter-spacing: var(--fds-ls-display);
  line-height: var(--fds-lh-heading);
  margin: 0 0 var(--fds-space-sm);
  text-wrap: balance;
}

h3, h4, h5, h6 {
  font-family: var(--fds-font-body);
  font-weight: 700;
  color: var(--fds-heading);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 var(--fds-space-2xs);
  text-wrap: balance;
}

.fds-display { font-size: var(--fds-fs-display); line-height: var(--fds-lh-tight); }
h1 { font-size: var(--fds-fs-h1); }
h2 { font-size: var(--fds-fs-h1); }
h3 { font-size: var(--fds-fs-h2); }
h4 { font-size: var(--fds-fs-h3); }
h5, h6 { font-size: 1.0625rem; }

/* L'italique Spectral en orange : l'accent éditorial signature de la marque. */
h1 em, h2 em, .fds-display em {
  font-style: italic;
  color: var(--fds-accent);
}

p { margin: 0 0 var(--fds-space-sm); }
p:last-child { margin-bottom: 0; }

.fds-lead {
  font-size: var(--fds-fs-body-lg);
  font-weight: 500;
  color: var(--fds-text-muted);
  line-height: 1.65;
  max-width: 60ch;
  text-wrap: pretty;
}

.fds-caption {
  font-size: var(--fds-fs-caption);
  font-weight: 500;
  color: var(--fds-text-muted);
}

/* Eyebrow : capitales espacées orange (charte 04). */
.fds-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  font-family: var(--fds-font-body);
  font-size: var(--fds-fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--fds-ls-eyebrow);
  text-transform: uppercase;
  color: var(--fds-accent);
  margin: 0 0 var(--fds-space-sm);
}
.fds-invert .fds-eyebrow { color: var(--fds-orange-light); }

/* Le filet orange qui précède l'eyebrow : rappel du séparateur de la
   signature e-mail (charte 07). */
.fds-eyebrow--rule::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--fds-accent);
  flex: 0 0 auto;
}

/* --- Liens ---------------------------------------------------------------- */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--fds-dur-fast) var(--fds-ease);
}
a:hover { color: var(--fds-accent); }

.fds-prose a {
  color: var(--fds-marine);
  text-decoration: underline;
  text-decoration-color: rgba(242, 101, 34, .45);
  text-underline-offset: .2em;
  text-decoration-thickness: 1.5px;
}
.fds-prose a:hover { color: var(--fds-accent); text-decoration-color: currentColor; }

/* --- Médias --------------------------------------------------------------- */
img, svg, video, canvas, iframe { display: block; max-width: 100%; height: auto; }
img { border-style: none; }

figure { margin: 0 0 var(--fds-space-md); }
figcaption { font-size: var(--fds-fs-caption); color: var(--fds-text-muted); margin-top: var(--fds-space-2xs); }

/* --- Listes --------------------------------------------------------------- */
ul, ol { margin: 0 0 var(--fds-space-sm); padding-left: 1.25rem; }
.fds-list-reset { list-style: none; margin: 0; padding: 0; }

/* Liste à puce « point médian » reprise des maquettes. */
.fds-list-dot { list-style: none; margin: 0; padding: 0; display: grid; gap: .625rem; }
.fds-list-dot > li {
  position: relative;
  padding-left: 1.375rem;
  font-size: var(--fds-fs-body);
  color: var(--fds-text-muted);
  line-height: 1.5;
}
.fds-list-dot > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .6em;
  width: 6px;
  height: 6px;
  background: var(--fds-accent);
  /* Angle net plutôt que rond : rappel du motif « plans tranchés ». */
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

/* --- Formulaires (héritage global, détails dans components.css) ---------- */
button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { background: none; border: 0; cursor: pointer; }

/* --- Tableaux ------------------------------------------------------------- */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--fds-line); }
th { font-weight: 700; color: var(--fds-heading); }

/* --- Sélection & barre de défilement ------------------------------------- */
::selection { background: var(--fds-orange); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--fds-givre); }
::-webkit-scrollbar-thumb { background: var(--fds-brume); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--fds-acier); }

/* ==========================================================================
   Layout
   ========================================================================== */

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

.fds-section {
  position: relative;
  padding-block: var(--fds-section);
}
.fds-section--tight { padding-block: calc(var(--fds-section) * .6); }

.fds-section-head {
  max-width: 44rem;
  margin-bottom: clamp(2.5rem, 1.8rem + 2.6vw, 4rem);
}
/* Le clamp ci-dessus descend jusqu'à ~2.3rem sur les petits écrans (sa
   composante vw compte peu à cette largeur) : un plancher fixe et plus
   généreux évite que le titre de section paraisse collé au contenu qui
   suit une fois la mise en page repliée sur une colonne. */
@media (max-width: 640px) {
  .fds-section-head { margin-bottom: 3rem; }
}
.fds-section-head--center { margin-inline: auto; text-align: center; }
.fds-section-head--center .fds-eyebrow { justify-content: center; }
.fds-section-head--center .fds-lead { margin-inline: auto; }

/* Bandeau de section : en-tête à gauche, action à droite. */
.fds-section-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--fds-space-lg);
  flex-wrap: wrap;
  margin-bottom: clamp(2.5rem, 1.8rem + 2.6vw, 4rem);
}
.fds-section-bar .fds-section-head { margin-bottom: 0; }

/* Grille utilitaire : auto-fit avec plancher paramétrable. */
.fds-grid {
  display: grid;
  gap: var(--fds-space-md);
  grid-template-columns: repeat(auto-fit, minmax(min(var(--fds-col, 260px), 100%), 1fr));
}
.fds-grid--2 { --fds-col: 420px; }
.fds-grid--3 { --fds-col: 300px; }
.fds-grid--4 { --fds-col: 240px; }

.fds-stack { display: grid; gap: var(--fds-space-sm); }
.fds-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--fds-space-xs); }

/* --- Contenu éditorial (pages / articles WordPress) ---------------------- */
.fds-prose {
  max-width: var(--fds-container-text);
}
.fds-prose > * + * { margin-top: var(--fds-space-sm); }
.fds-prose h2 { font-size: var(--fds-fs-h2); margin-top: var(--fds-space-xl); }
.fds-prose h3 { font-size: var(--fds-fs-h3); margin-top: var(--fds-space-lg); }
.fds-prose blockquote {
  margin: var(--fds-space-lg) 0;
  padding: var(--fds-space-md) var(--fds-space-lg);
  border-left: 3px solid var(--fds-accent);
  background: var(--fds-papier);
  font-family: var(--fds-font-title);
  font-size: var(--fds-fs-h3);
  font-style: italic;
  color: var(--fds-marine);
}
.fds-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .875em;
  background: var(--fds-givre);
  padding: .15em .4em;
  border-radius: var(--fds-radius-xs);
}
.fds-prose pre {
  background: var(--fds-encre);
  color: var(--fds-givre);
  padding: var(--fds-space-md);
  border-radius: var(--fds-radius-md);
  overflow-x: auto;
}
.fds-prose pre code { background: none; padding: 0; color: inherit; }
.fds-prose img { border-radius: var(--fds-radius-md); }

.fds-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
}
.fds-prose th, .fds-prose td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--fds-line);
  vertical-align: top;
}
.fds-prose th {
  font-family: var(--fds-font-title);
  font-weight: 700;
  color: var(--fds-heading);
  border-bottom-color: var(--fds-line-strong);
}
.fds-prose table + * { margin-top: var(--fds-space-lg); }
@media (max-width: 620px) {
  .fds-prose table, .fds-prose thead, .fds-prose tbody, .fds-prose tr { display: block; }
  .fds-prose thead { display: none; }
  .fds-prose tr { margin-bottom: var(--fds-space-sm); border: 1px solid var(--fds-line); border-radius: var(--fds-radius-sm); }
  .fds-prose td { display: flex; gap: .5rem; border-bottom: 1px solid var(--fds-givre); }
  .fds-prose td:last-child { border-bottom: none; }
  .fds-prose td::before {
    content: attr(data-label);
    flex: 0 0 40%;
    font-weight: 700;
    color: var(--fds-heading);
  }
}

/* Alignements WordPress. */
.alignleft  { float: left;  margin: .35rem var(--fds-space-md) var(--fds-space-sm) 0; }
.alignright { float: right; margin: .35rem 0 var(--fds-space-sm) var(--fds-space-md); }
.aligncenter { display: block; margin-inline: auto; }
.alignwide { width: min(1100px, 100%); margin-inline: auto; }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }
.wp-caption { max-width: 100%; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ==========================================================================
   Accessibilité
   ========================================================================== */

/* Anneau de focus visible sur toutes les surfaces interactives. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--fds-orange);
  outline-offset: 3px;
  border-radius: var(--fds-radius-xs);
}
.fds-invert :where(a, button, input, select, textarea, summary):focus-visible {
  outline-color: var(--fds-orange-light);
}

/* Lien d'évitement. */
.fds-skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -110%);
  z-index: var(--fds-z-modal);
  background: var(--fds-marine);
  color: #fff;
  font-weight: 700;
  font-size: var(--fds-fs-small);
  padding: .875rem 1.5rem;
  border-radius: 0 0 var(--fds-radius-sm) var(--fds-radius-sm);
  transition: transform var(--fds-dur) var(--fds-ease);
}
.fds-skip-link:focus {
  transform: translate(-50%, 0);
  color: #fff;
}

/* Utilitaires de visibilité. */
.fds-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[hidden] { display: none !important; }
