/*
 * GOODEV — socle : police, remise à zéro, éléments HTML nus.
 * Aucun élément ne doit retomber sur le style du navigateur.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Fallback";
  src: local("Georgia");
  size-adjust: 86%;
  ascent-override: 105%;
  descent-override: 28%;
  line-gap-override: 0%;
}

/* Sérif de la marque Accueil IA : chargée seulement par les documents qui la portent. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../../branding/accueil_ia/fonts/fraunces.woff2") format("woff2");
}

/* Repli calé sur les mesures d'Inter : le texte ne saute pas quand la police arrive. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22.5%;
  line-gap-override: 0%;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-feature-settings: "cv11", "ss03";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

/* Titres */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-4);
  font-weight: 600;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

/* Les deux premiers niveaux portent la voix du site : la sérif de titre. */
h1,
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.012em;
}

h1 {
  font-size: var(--text-3xl);
  line-height: 1.04;
}

h2 {
  font-size: var(--text-2xl);
  line-height: 1.08;
}

h1 em,
h2 em {
  color: var(--accent);
}

h3 {
  font-size: var(--text-lg);
}

h4 {
  font-size: var(--text-md);
}

h5,
h6 {
  font-size: var(--text-base);
}

/* Texte courant */
p,
ul,
ol,
dl,
blockquote,
pre,
table,
figure {
  margin: 0 0 var(--space-4);
}

p {
  text-wrap: pretty;
}

ul,
ol {
  padding-left: var(--space-6);
}

li + li {
  margin-top: var(--space-1);
}

li::marker {
  color: var(--ink-faint);
}

dt {
  font-weight: 600;
}

dd {
  margin: 0;
}

strong,
b {
  font-weight: 600;
}

small {
  font-size: var(--text-sm);
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--ink-faint);
  transition: color var(--dur-fast) var(--ease), text-decoration-color var(--dur-fast) var(--ease);
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

hr {
  height: 0;
  margin: var(--space-8) 0;
  border: 0;
  border-top: var(--rule-w) solid var(--rule);
}

blockquote {
  padding-left: var(--space-4);
  border-left: 2px solid var(--rule-strong);
  color: var(--ink-soft);
}

/* Code */
code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  padding: 0.1em 0.35em;
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper-sunk);
}

pre {
  overflow-x: auto;
  padding: var(--space-4);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-sunk);
  line-height: 1.5;
  tab-size: 4;
}

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

figcaption {
  margin-top: var(--space-2);
  color: var(--ink-faint);
  font-size: var(--text-sm);
}

/* Tableaux */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

caption {
  padding-bottom: var(--space-2);
  color: var(--ink-faint);
  font-size: var(--text-sm);
  text-align: left;
}

th,
td {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  border-bottom: var(--rule-w) solid var(--rule);
  text-align: left;
  vertical-align: top;
}

thead th {
  border-bottom-color: var(--rule-strong);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* Formulaires */
button,
input,
select,
textarea {
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

button {
  padding: var(--space-2) var(--space-4);
  border: var(--rule-w) solid var(--rule-strong);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 500;
}

input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="hidden"]),
select,
textarea {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: var(--rule-w) solid var(--ink-faint);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease);
}

/* Champ de fichier : zone en pointillés, bouton du navigateur aux couleurs du site. */
input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: var(--space-3);
  border: var(--rule-w) dashed var(--ink-faint);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--text-sm);
}

input[type="file"]::file-selector-button {
  margin-right: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: var(--rule-w) solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-sunk);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

textarea {
  min-height: 8rem;
  line-height: 1.5;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--accent);
}

fieldset {
  min-width: 0;
  margin: 0 0 var(--space-6);
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  font-weight: 600;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

/* Accordéon natif */
summary {
  cursor: pointer;
}

/* Focus : toujours visible au clavier */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-wash);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

/* Texte réservé aux lecteurs d'écran */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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