/* Feuille applicative GamyGroup v3.0 — socle partagé : remise à zéro,
   primitives de mise en page, échelle typographique, boutons, cartes,
   étiquettes, formulaires. Le style propre à un composant vit dans son
   .razor.css (isolation CSS Blazor).

   Toutes les valeurs viennent de tokens.css. */

/* ---------- Remise à zéro ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--gg-paper);
  color: var(--gg-ink);
  font-family: var(--gg-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { max-width: 100%; display: block; }

a { color: var(--gg-blue); text-decoration: none; }
a:hover { color: var(--gg-signal); }

button { font: inherit; color: inherit; }
input, select, textarea { font-family: var(--gg-body); }

/* Focus visible — PRD §7 (WCAG 2.1 AA). Bleu et non orange : l'orange est
   réservé au signal de marque, le focus doit rester un signal système.

   ⚠ Volontairement limité aux éléments que l'utilisateur peut atteindre
   au clavier, au lieu d'un `:focus-visible` universel. Routes.razor monte
   <FocusOnNavigate Selector="h1" /> : après chaque navigation, Blazor
   pose tabindex="-1" sur le <h1> et le focalise, pour que les lecteurs
   d'écran annoncent le titre de la page d'arrivée. Une règle universelle
   dessinait donc un cadre bleu autour du titre à chaque chargement — un
   défaut visible par tous, sans rien apporter : un visiteur voyant lit
   déjà le titre.

   L'exclusion de [tabindex="-1"] laisse intacte l'annonce au lecteur
   d'écran (qui ne dépend pas du contour) tout en retirant le cadre. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
details:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 3px solid var(--gg-blue);
  outline-offset: 3px;
}

/* Retirer notre contour ne suffit pas : la feuille de style du navigateur
   pose son propre `outline: auto` sur tout élément qui satisfait
   :focus-visible, et la cible de FocusOnNavigate en fait partie. On la
   neutralise explicitement — un élément à tabindex="-1" n'est jamais
   atteignable au clavier, donc aucun utilisateur ne perd de repère. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  outline: none;
}

/* ---------- Ancres du one-pager ----------
   L'en-tête est fixe : sans cette marge, toute cible d'ancre s'arrête
   PILE sous la barre, et son titre disparaît derrière. scrollIntoView
   (onepager.js) comme le saut natif du navigateur — au chargement direct
   d'une adresse « /fr#careers » — respectent scroll-margin-top.

   #main-content est inclus : c'est la cible du lien d'évitement, qui
   souffrirait du même masquage. */
[data-gg-spy],
#main-content {
  scroll-margin-top: calc(var(--gg-header-h) + 16px);
}

/* ---------- Primitives ---------- */
.gg-container {
  max-width: var(--gg-max);
  margin: 0 auto;
  padding-left: var(--gg-margin);
  padding-right: var(--gg-margin);
  width: 100%;
}
@media (max-width: 900px) {
  .gg-container {
    padding-left: var(--gg-margin-mobile);
    padding-right: var(--gg-margin-mobile);
  }
}

/* ⚠ padding-top/bottom séparés, jamais le raccourci `padding` : ces
   classes se combinent avec .gg-container sur le même élément, et un
   raccourci écraserait ses marges horizontales. */
.gg-section { padding-top: var(--gg-section); padding-bottom: var(--gg-section); }
.gg-section-tight { padding-top: var(--gg-section-tight); padding-bottom: var(--gg-section-tight); }
@media (max-width: 900px) {
  .gg-section { padding-top: 52px; padding-bottom: 52px; }
  .gg-section-tight { padding-top: 44px; padding-bottom: 44px; }
}

.gg-row { display: flex; }
.gg-col { display: flex; flex-direction: column; }
.gg-wrap { flex-wrap: wrap; }
.gg-ac { align-items: center; }
.gg-ae { align-items: flex-end; }
.gg-jb { justify-content: space-between; }
.gg-f1 { flex: 1; }
.gg-noshrink { flex-shrink: 0; }

/* ---------- Fonds ---------- */
.on-paper { background: var(--gg-paper); }
.on-paper-2 { background: var(--gg-paper-2); }
.on-white { background: var(--gg-white); }
.on-ink { background: var(--gg-ink); color: var(--gg-on-ink); }
.gg-rule-top { border-top: var(--gg-hairline) solid var(--gg-line); }

/* ---------- Grille à filet ----------
   Les tuiles portent leur propre filet (box-shadow) au lieu de laisser
   transparaître le fond du conteneur : avec `auto-fit`, une dernière
   rangée incomplète laisserait sinon un bloc de fond à nu. */
.gg-grid { display: grid; gap: var(--gg-hairline); }
.gg-grid > * { box-shadow: 0 0 0 0.5px var(--gg-line); }
.gg-grid.on-ink > * { box-shadow: 0 0 0 0.5px var(--gg-on-ink-line); }

/* ---------- Échelle typographique ----------
   Display = Space Grotesk. Le poids 600 est le poids de titre du système ;
   700 est réservé au logotype. */
.gg-display, .gg-h1, .gg-h2, .gg-h3, .gg-h4 {
  font-family: var(--gg-display);
  font-weight: 600;
  text-wrap: pretty;
}

.gg-display {                       /* H1 du bandeau d'accueil */
  font-size: clamp(36px, 4.6vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.gg-h1 {                            /* H1 de page intérieure */
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.gg-h2 {                            /* titre de section */
  font-size: clamp(28px, 2.8vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.gg-h3 {                            /* sous-section */
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.gg-h4 {                            /* titre de carte */
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.gg-lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--gg-muted);
  max-width: 36em;
}
.on-ink .gg-lede { color: var(--gg-on-ink-body); }

.gg-body-lg { font-size: 16.5px; line-height: 1.6; }
.gg-body { font-size: 15px; line-height: 1.55; }
.gg-body-sm { font-size: 14.5px; line-height: 1.55; }
.gg-muted { color: var(--gg-muted); }

/* Surtitre monospace en capitales — le libellé de section du système. */
.gg-kicker {
  font-family: var(--gg-mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gg-muted-2);
}
.gg-kicker.signal { color: var(--gg-signal); }
.on-ink .gg-kicker { color: var(--gg-on-ink-mute); }

.gg-mono { font-family: var(--gg-mono); font-size: 12px; letter-spacing: 0.06em; }
.gg-mono-sm { font-family: var(--gg-mono); font-size: 11.5px; letter-spacing: 0.08em; }

/* ---------- Le point du logotype ----------
   Motif signature (PRD §6.1) : le point orange ferme le logotype et
   chaque titre-thèse. Décoratif — toujours accompagné d'aria-hidden. */
.gg-dot { color: var(--gg-signal); }

/* ---------- Boutons ---------- */
.gg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--gg-body);
  font-weight: 600;
  font-size: 15px;
  padding: 17px 26px;
  min-height: var(--gg-hit);
  border: none;
  border-radius: var(--gg-radius);
  cursor: pointer;
  text-align: center;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.gg-btn-sm { font-size: 14px; padding: 13px 20px; }

.gg-btn-signal { background: var(--gg-signal); color: var(--gg-white); }
.gg-btn-signal:hover { background: var(--gg-ink); color: var(--gg-white); }

.gg-btn-ink { background: var(--gg-ink); color: var(--gg-white); }
.gg-btn-ink:hover { background: var(--gg-blue); color: var(--gg-white); }

.gg-btn-blue { background: var(--gg-blue); color: var(--gg-white); }
.gg-btn-blue:hover { background: var(--gg-ink); color: var(--gg-white); }

.gg-btn-outline-ink {
  background: transparent;
  color: var(--gg-ink);
  border: var(--gg-hairline) solid var(--gg-ink);
  font-weight: 500;
}
.gg-btn-outline-ink:hover { background: var(--gg-ink); color: var(--gg-white); }

/* Contour clair — sur fond encre uniquement. */
.gg-btn-outline-light {
  background: transparent;
  color: var(--gg-on-ink);
  border: var(--gg-hairline) solid var(--gg-on-ink-line-2);
  font-weight: 500;
}
.gg-btn-outline-light:hover { border-color: var(--gg-signal); color: var(--gg-signal); }

.gg-btn:disabled,
.gg-btn[aria-disabled="true"] {
  background: transparent;
  color: var(--gg-placeholder);
  border: var(--gg-hairline) solid var(--gg-line-strong);
  cursor: not-allowed;
}

/* Lien fléché monospace — « EN SAVOIR PLUS → ». */
.gg-link-mono {
  font-family: var(--gg-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--gg-blue);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gg-link-mono:hover { color: var(--gg-signal); }
.on-ink .gg-link-mono { color: var(--gg-on-ink); border-bottom: 1px solid var(--gg-signal); padding-bottom: 4px; }

/* ---------- Étiquettes : cinq familles distinctes ----------
   Le PRD §6.2 exige un vocabulaire unique décliné, sans que les familles
   deviennent interchangeables. Chacune a donc son propre traitement. */
.gg-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--gg-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 9px 13px;
  border-radius: var(--gg-radius);
}
.gg-tag-service    { background: var(--gg-blue-pale); color: var(--gg-blue-deep); }
.gg-tag-tech       { border: var(--gg-hairline) solid var(--gg-line-strong); background: var(--gg-paper); color: var(--gg-muted-3); }
.gg-tag-sector     { background: var(--gg-ink); color: var(--gg-on-ink); }
.gg-tag-capability { border: var(--gg-hairline) dashed var(--gg-line-dashed); color: var(--gg-muted); }
.gg-tag-metric     { background: var(--gg-signal-pale); color: var(--gg-error); }

a.gg-tag-tech:hover { border-color: var(--gg-ink); color: var(--gg-ink); }

/* ---------- Pastille de puce ----------
   Le rond reprend le point du logotype à l'échelle du texte. */
.gg-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gg-blue);
  flex: none;
  margin-top: 8px;
}
.gg-bullet.signal { background: var(--gg-signal); }

.gg-bullet-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

/* ---------- Emplacement d'image ----------
   Hachures diagonales : marque explicitement un visuel à fournir, au lieu
   d'un aplat gris qu'on pourrait croire volontaire. */
.gg-slot {
  background: repeating-linear-gradient(135deg,
    var(--gg-hatch-a), var(--gg-hatch-a) 8px,
    var(--gg-hatch-b) 8px, var(--gg-hatch-b) 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--gg-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gg-placeholder);
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
}
.gg-slot.on-ink {
  background: repeating-linear-gradient(135deg,
    var(--gg-ink-2), var(--gg-ink-2) 8px,
    var(--gg-ink-3) 8px, var(--gg-ink-3) 16px);
  color: var(--gg-on-ink-faint);
}

/* ---------- Formulaires ---------- */
.gg-field { display: flex; flex-direction: column; gap: 7px; }

.gg-label { font-size: 13.5px; font-weight: 600; }

.gg-input, .gg-select, .gg-textarea {
  border: var(--gg-hairline) solid var(--gg-line-strong);
  border-radius: var(--gg-radius);
  padding: 14px;
  font-size: 15px;
  background: var(--gg-white);
  color: var(--gg-ink);
  min-height: 48px;
  width: 100%;
}
.gg-textarea { resize: vertical; min-height: 104px; }
.gg-input:hover, .gg-select:hover, .gg-textarea:hover { border-color: var(--gg-ink); }

/* Le champ en erreur porte SA couleur, et le message explique quoi faire
   (PRD §5.4 : « messages explicites, jamais génériques »). */
.gg-input.invalid, .gg-textarea.invalid, .gg-select.invalid {
  border-color: var(--gg-error);
  background: var(--gg-error-bg);
}
.gg-validation {
  color: var(--gg-error);
  font-size: 13px;
  line-height: 1.5;
}

.gg-form-error {
  margin: 0;
  font-size: 14px;
  color: var(--gg-error);
  border: var(--gg-hairline) solid var(--gg-error);
  background: var(--gg-error-bg);
  padding: 12px 14px;
  border-radius: var(--gg-radius);
}

/* ---------- Bandeau de page ----------
   Motif commun à toutes les pages intérieures (Solutions, Secteurs,
   Réalisations, À propos, Carrières, Contact, pages légales). Placé ici
   et non dans un .razor.css : l'isolation CSS de Blazor étant par
   composant, chaque page devrait sinon en recopier les règles. */
.gg-phero {
  background: var(--gg-ink);
  color: var(--gg-on-ink);
}
.gg-phero-inner {
  padding-top: 44px;
  padding-bottom: 64px;
}
.gg-phero h1 { color: var(--gg-white); margin: 24px 0 0; }
.gg-phero-lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--gg-on-ink-body);
  max-width: 620px;
  margin: 18px 0 0;
}

/* Fil d'Ariane monospace. */
.gg-crumb {
  font-family: var(--gg-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--gg-on-ink-mute);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.gg-crumb a { color: var(--gg-on-ink-mute); }
.gg-crumb a:hover { color: var(--gg-signal); }
.gg-crumb span[aria-hidden] { color: var(--gg-on-ink-dim); }
.gg-crumb .current { color: var(--gg-on-ink); }

/* En-tête de section : titre à gauche, lien à droite, sur un filet. */
.gg-sec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  border-bottom: var(--gg-hairline) solid var(--gg-ink);
  padding-bottom: 20px;
}
.gg-sec-head.on-ink { border-bottom-color: rgba(246, 245, 242, 0.24); }

@media (max-width: 900px) {
  .gg-phero-inner { padding-top: 32px; padding-bottom: 44px; }
}

/* ---------- Accessibilité ---------- */
.gg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.gg-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--gg-signal);
  color: var(--gg-white);
  padding: 14px 20px;
  font-weight: 600;
}
.gg-skip-link:focus { left: 0; color: var(--gg-white); }

/* ---------- Mouvement ----------
   Sobre par principe (PRD §6.2) : micro-interactions au survol, une seule
   animation ambiante (le flux du bandeau), rien de décoratif. */
@keyframes gg-flow {
  0%   { left: 0%;   opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
    scroll-behavior: auto !important;
  }
}
