/* =========================================
   0) VARIABLES GLOBALES (faciles à ajuster)
   - Modifie seulement cette section pour changer
     les polices, tailles, espacements et largeur max.
========================================= */
:root {
  /* Polices */
  --font-text-chivo: "Chivo", Arial, sans-serif;
  --font-title-oswald: "Oswald", Helvetica, sans-serif;
  --font-array-montserrat: "Montserrat", Arial, sans-serif;

  /* Échelle typographique fluide (mobile → desktop)
     Ajuste les bornes min/max si tu veux +/− grand 
     --fs-base : font-size par défaut (corps du texte)
     --lh-base : line-height par défaut (corps du texte)
  */
  --fs-base: clamp(15px, 0.35vw + 14px, 17px);
  /* Corps du texte */
  --lh-base: 1.6;

  --fs-h1: clamp(2.0rem, 1.2rem + 3vw, 3.2rem);
  --fs-h2: clamp(1.75rem, 1.1rem + 2vw, 2.6rem);
  --fs-h3: clamp(1.5rem, 1.0rem + 1.5vw, 2.0rem);
  --fs-h4: clamp(1.25rem, 0.9rem + 1vw, 1.6rem);
  --fs-h5: clamp(1.1rem, 0.85rem + 0.6vw, 1.3rem);
  --fs-h6: clamp(1.0rem, 0.8rem + 0.3vw, 1.1rem);

  /* Largeur & gouttières */
  --content-max: 1200px;
  /* largeur max du contenu centré */
  --gutter: clamp(12px, 3vw, 28px);
  /* padding horizontal clamp(min, préféré, max)*/
  --block-gap: 1rem;
  /* espace vertical standard */
}

/* =========================================
   1) RESET LÉGER & BASE
========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding-bottom: 60px;
  /* coupe tout débordement horizontal global */
}

body {
  font-family: var(--font-text-chivo);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: #222;
  background-color: #fff;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  /* évite aussi le scroll vertical inutile */
}

/* =========================================
   2) TYPOGRAPHIE PAR DÉFAUT
========================================= */
p,
li,
span {
  font-family: var(--font-text-chivo);
  margin: 0 0 var(--block-gap) 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title-oswald);
  font-weight: 600;
  /* Oswald: 300–700 dispo, ajuste si besoin */
  line-height: 1.2;
  margin: 0 0 var(--block-gap) 0;
  text-wrap: balance;
  /* meilleure casse des titres si supporté */
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
}

h4 {
  font-size: var(--fs-h4);
}

h5 {
  font-size: var(--fs-h5);
}

h6 {
  font-size: var(--fs-h6);
}

/* Liens */
a {
  color: inherit;
  text-decoration: none;
}

tbody {
  font-family: var(--font-array-montserrat);
}

/* =========================================
   3) LAYOUT GLOBAL
========================================= */
.container {
  inline-size: min(var(--content-max), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Sections et wrappers : pas de dépassement, jamais */
main,
section,
header,
footer,
aside,
nav {
  max-width: 100vw;
  /* bloque les débordements, iPhone compris */
  overflow-x: hidden;
  /* sécurité anti-scroll horizontal */
}

/* Grilles & Flex : évite les débordements des enfants flex/grid */
:where(.flex, .grid, .row, .cols)>* {
  min-width: 0;
  /* corrige le texte qui force l’expansion des colonnes */
}


select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  color: #333;
  cursor: pointer;
}

/* Style quand il est actif (focus) */
select:focus {
  outline: none;
  /* désactive le highlight natif */
  border-color: #0a1f44;
  /* bleu foncé CRM */
  box-shadow: 0 0 0 3px rgba(10, 31, 68, 0.2);
  /* halo doux */
}


/* =========================================
   4) MÉDIAS & ÉLÉMENTS À LARGEUR VARIABLE
========================================= */
img,
svg,
video,
canvas,
iframe {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Les tableaux passent en bloc scrollable si trop larges */
table {
  width: 100%;
  border-collapse: collapse;
  /* display: block; */
  overflow-x: auto;
}

@media (max-width: 768px) {

  table {
    display: block;
  }

}


.main-gabarit-center {
  max-width: 1300px;
  /* garde une largeur max sur desktop */
  width: 100%;
  /* mais toujours 100% de la largeur disponible */
  margin: auto;
  background: #fff;
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-top: 100px;
  overflow-x: auto;
  /* ✅ permet le scroll horizontal si trop serré */
}


/* =========================================
   5) UTILITAIRES (optionnels, pratiques)
========================================= */
/* Accessibilité : éléments seulement pour lecteurs d’écran */
.visually-hidden {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 1) Voir toutes les boîtes (activer en ajoutant .debug-outline sur <html> ou <body>) */
.debug-outline * {
  outline: 1px dashed rgba(255, 0, 0, .35);
  outline-offset: -1px;
}

/* 2) Marquer UNIQUEMENT les éléments qui débordent (classe ajoutée via JS) */
.is-overflowing {
  outline: 2px dashed #ff0033 !important;
  background-image:
    repeating-linear-gradient(45deg,
      rgba(255, 0, 0, .08) 0 10px,
      transparent 10px 20px);
  position: relative;
}

.is-overflowing::after {
  content: "overflow";
  position: absolute;
  top: 0;
  right: 0;
  font: 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background: #ff0033;
  color: #fff;
  padding: 2px 5px;
  border-bottom-left-radius: 4px;
}

/* Utilitaires utiles avec le debug */
.breakable {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.nowrap {
  white-space: nowrap;
}