/* ============================================================
   IGLAM — Design System · Base
   ============================================================
   Reset modernisé, typographie, liens, focus visible,
   rhythm helpers, respect de prefers-reduced-motion.
   ============================================================ */

/* --------------------------------------------------------
   1. RESET
   -------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
video,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* --------------------------------------------------------
   2. TYPOGRAPHIE
   -------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-titre);
  color: var(--color-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 700;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p {
  margin: 0 0 var(--space-5);
  text-wrap: pretty;
}

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

strong { font-weight: 600; }

ul, ol { margin: 0 0 var(--space-5); padding-left: var(--space-5); }
li { margin-bottom: var(--space-2); }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

blockquote {
  margin: 0 0 var(--space-6);
  padding-left: var(--space-5);
  border-left: 3px solid var(--color-accent);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

/* --------------------------------------------------------
   3. LIENS
   -------------------------------------------------------- */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover { color: var(--color-accent-dark); }

/* Sur les fonds sombres (header héro, footer, témoignages), les liens
   doivent hériter de la couleur du conteneur (blanc) et non du bleu :
   sinon ils deviennent invisibles.
   Exceptions (elles ont leur propre couleur de texte) :
   - les menus déroulants, sur fond blanc
   - les CTA .cta-uni et .btn-candidater, qui portent leur propre variante de couleur */
.hero-wrapper:not(.hero-wrapper--internal) a:not(.sub-menu a):not(.cta-uni):not(.btn-candidater),
.site-footer a,
.voices-band a,
.section-dark a,
.ct-form a {
  color: inherit;
}

.hero-wrapper:not(.hero-wrapper--internal) a:not(.sub-menu a):not(.cta-uni):not(.btn-candidater):hover,
.site-footer a:hover,
.voices-band a:hover,
.section-dark a:hover,
.ct-form a:hover {
  color: var(--color-accent-bright);
}

/* Les CTA à fond marine (section-cta) portent du texte blanc :
   la règle « a { color: primary } » ci-dessus les rendrait
   marine sur marine, donc invisibles hors survol. */
.section-cta,
.filiere-hero-back,
.hero-spotlight > a {
  color: var(--color-text-inverse);
}

.section-cta:hover,
.filiere-hero-back:hover,
.hero-spotlight > a:hover {
  color: var(--color-text-inverse);
}

/* Lien "texte + flèche" : Used dans le footer et les CTA */
.read-more,
.section-cta,
.filiere-link {
  font-weight: 600;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: gap var(--transition-base), color var(--transition-base);
}

.read-more:hover,
.section-cta:hover,
.filiere-link:hover {
  color: var(--color-accent-dark);
  gap: calc(var(--space-2) + 4px);
  text-decoration: none;
}

/* --------------------------------------------------------
   4. FOCUS VISIBLE — accessibilité clavier
   Un anneau unique, cohérent sur tous les interactifs.
   -------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

/* On neutralise l'outline natif seulement quand on le remplace */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* Cibles tactiles suffisantes */
button,
[role="button"],
input[type="submit"] {
  min-height: var(--tap-target);
}

/* --------------------------------------------------------
   5. CONTENEUR & RYTHME
   -------------------------------------------------------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Espacement vertical des sections — généreux et fluide */
.section {
  padding-block: var(--section-y);
}

.section-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

.section-subtitle {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  max-width: 62ch;
  margin-bottom: var(--space-7);
}

.section-dark {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 { color: var(--color-text-inverse); }

.section-dark .section-subtitle { color: var(--color-text-inverse-muted); }

.section-light { background: var(--color-surface); }
.section-gray  { background: var(--color-surface-alt); }

.text-center { text-align: center; }
.text-center .section-subtitle { margin-inline: auto; }

/* --------------------------------------------------------
   6. MOTION
   -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

/* --------------------------------------------------------
   7. IMPRESSION
   -------------------------------------------------------- */
@media print {
  .topbar, .site-header, .site-footer, .iglam-whatsapp-float, .mobile-panel { display: none !important; }
  body { color: #000; font-size: 12pt; }
}
