/*
  Noren : feuille de style principale.
  Source de vérité : section E de PROJET.md (design system).
  Étape 2 : variables, reset, typographie, utilitaires, accessibilité.
*/

/* ---------- Variables du design system ---------- */
:root {
  /* ===== Charte de design (institutionnelle) : source de vérité =====
     Bleu marine profond, gris bleutés neutres, un seul bleu pour les liens,
     rouge réservé aux erreurs. Rayons de 2 à 4 px, aucune ombre, fond uni. */

  /* Marine : titres, bouton principal, marque */
  --navy-900: #0b2447;      /* encre, bouton principal (15,5:1 sur blanc) */
  --navy-700: #143a6f;      /* bouton au survol */
  --marine-actif: #071a33;  /* bouton au clic */

  /* Action (bouton principal, interrupteurs, sélection) = marine */
  --action: var(--navy-900);
  --action-survol: var(--navy-700);
  --action-pale: #eef2f7;

  /* Liens : un seul bleu */
  --lien: #1a4f9c;
  --lien-survol: #123b78;

  /* Statuts des livreurs : seule exception fonctionnelle à la palette.
     Toujours accompagnés d'un mot (« Disponible », « Occupé », « Hors ligne »). */
  --statut-dispo: #1d6b43;
  --statut-dispo-fond: #e7f1eb;
  --statut-occupe: #9a5b00;
  --statut-occupe-texte: #7a4700;
  --statut-occupe-fond: #fbf1e2;
  --statut-hors: #8392ab;
  --statut-hors-fond: #eef2f7;

  /* Anciens noms, conservés pour compatibilité (pointent vers la charte) */
  --green-500: var(--action);
  --green-600: var(--action-survol);
  --green-50: var(--action-pale);
  --amber-500: var(--statut-occupe);
  --amber-50: var(--statut-occupe-fond);
  --slate-400: #8392ab;
  --slate-50: #eef2f7;

  /* Sémantique */
  --red-500: #b42318;       /* erreurs uniquement */

  /* Neutres */
  --fond: #eef2f7;          /* fond de page uni */
  --surface: #ffffff;       /* cartes, panneaux */
  --bordure: #d3dae6;       /* bordure de surface (1 px) */
  --bordure-champ: #8392ab; /* bordure de champ (3:1) */
  --texte: #1c2b45;         /* texte courant (14:1) */
  --texte-secondaire: #55637d; /* texte secondaire (6:1) */

  /* WhatsApp : l'icône suit la couleur du texte (pas de couleur hors palette) */
  --whatsapp: currentColor;

  /* Typographie : deux familles, jamais plus */
  --police-titre: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --police-texte: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Échelle : aucun texte sous 14 px */
  --texte-xl: 31px;   --interligne-xl: 36px;   /* h1 sur mobile (36-40 px dès 768 px) */
  --texte-l: 26px;    --interligne-l: 32px;    /* h2 */
  --texte-m: 21px;    --interligne-m: 28px;    /* h3 */
  --texte-base: 16px; --interligne-base: 24px;
  --texte-s: 14px;    --interligne-s: 20px;
  --texte-xs: 14px;   --interligne-xs: 20px;

  /* Espacements (grille de 8 px) */
  --espace-demi: 4px;
  --espace-1: 8px;
  --espace-2: 16px;
  --espace-3: 24px;
  --espace-4: 32px;
  --espace-5: 40px;
  --espace-6: 48px;
  --espace-8: 64px;
  --marge-laterale: 20px;
  --largeur-max: 1200px;

  /* Rayons : 4 px au plus, 2 px pour les très petits éléments */
  --rayon-carte: 4px;
  --rayon-bouton: 4px;
  --rayon-champ: 4px;
  --rayon-pilule: 4px;      /* plus de pilules : rectangles nets */
  --rayon-petit: 2px;
  --rayon-rond: 50%;        /* seulement avatars et pastilles de statut */
  --rayon-feuille: 4px 4px 0 0;

  /* Dimensions */
  --hauteur-bouton: 48px;
  --zone-tactile: 44px;

  /* Aucune ombre : les surfaces se détachent par une bordure de 1 px */
  --ombre: none;

  /* Transitions : 160 à 240 ms, courbe douce */
  --transition: 200ms ease;
}

/* ---------- Reset léger ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: var(--texte-base);
  font-weight: 400;
  line-height: var(--interligne-base);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote {
  margin: 0;
}

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

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

button {
  cursor: pointer;
}

/* ---------- Typographie ---------- */
h1, h2, h3 {
  font-family: var(--police-titre);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--navy-900);
}

@media (min-width: 768px) {
  :root {
    --texte-xl: 38px;   --interligne-xl: 42px;
    --texte-l: 28px;    --interligne-l: 34px;
    --texte-m: 22px;    --interligne-m: 28px;
  }
}

h1 { font-size: var(--texte-xl); line-height: var(--interligne-xl); }
h2 { font-size: var(--texte-l);  line-height: var(--interligne-l); }
h3 { font-size: var(--texte-m);  line-height: var(--interligne-m); }

small {
  font-size: var(--texte-s);
  line-height: var(--interligne-s);
}

strong, b {
  font-weight: 600;
}

/* ---------- Liens ---------- */
a {
  color: var(--lien);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--lien-survol);
}

/* ---------- Images fluides ---------- */
img, svg, video {
  max-width: 100%;
  height: auto;
}

img {
  display: block;
}

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

/* Conteneur centré : 1200 px max, marges de 20 px */
.conteneur {
  width: 100%;
  max-width: var(--largeur-max);
  margin-inline: auto;
  padding-inline: var(--marge-laterale);
}

/* Pile : éléments en colonne, espacés */
.pile {
  display: flex;
  flex-direction: column;
  gap: var(--espace-2);
}

/* Rangée : éléments en ligne, qui passent à la ligne si besoin */
.rangee {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-2);
}

/* Masqué à l'écran, lu par les lecteurs d'écran */
.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Accessibilité ---------- */

/* Focus clavier : contour net bleu, jamais de halo flou */
:focus-visible {
  outline: 2px solid var(--lien);
  outline-offset: 2px;
  box-shadow: none;
}

/* Respect du réglage « réduire les animations » */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Pages provisoires (index.html et 404.html) ---------- */
.page-provisoire {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--marge-laterale);
  text-align: center;
}

.page-provisoire main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espace-2);
}

.page-provisoire img {
  width: 200px;
  max-width: 70%;
  height: auto;
}

.page-provisoire p {
  color: var(--texte-secondaire);
}

/* Lien d'action : bouton principal marine (un seul par écran) */
.page-provisoire a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--hauteur-bouton);
  padding: 0 var(--espace-3);
  border-radius: var(--rayon-bouton);
  background: var(--green-500);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.page-provisoire a:hover {
  background: var(--green-600);
  color: #fff;
}

/* ---------- Icônes (sprite /assets/icons.svg) ---------- */
.icone {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.icone--petite {
  width: 18px;
  height: 18px;
}
