/*
 * Paraphe — même famille visuelle que Vigie : une page blanche, de l'encre, et presque pas de couleur.
 * Le sujet n'est pas alarmant : le rouge ne sert pas ici, et aucune couleur ne juge un employeur.
 */
@font-face {
  font-family: 'Familjen Grotesk';
  src: url(/fonts/familjen-grotesk-latin-wght-normal.woff2) format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

/* ---------- Thème clair (défaut) ---------- */
:root,
:root[data-theme='light'] {
  --paper: #ffffff;
  --surface: #ffffff;
  --sunk: #f3f3f0;
  --ink: #16181d;
  --ink-2: #5d6068;
  --ink-3: #6b6e76;
  --line: #e6e6e3;
  --line-strong: #8d8f94;
  --link: #16181d;
  --action: #16181d;
  --action-ink: #ffffff;
  --hot: #d7261e;
  --important-text: #8a5300;
  --important-bg: #fbf1dc;
  --ok-text: #1f7a4d;
  --ok-bg: #e9f3ed;
  --focus: #16181d;
  color-scheme: light;
}

/* ---------- Thème sombre : choix explicite ou préférence système ---------- */
:root[data-theme='dark'] {
  --paper: #121315;
  --surface: #18191c;
  --sunk: #222428;
  --ink: #eeeeea;
  --ink-2: #b3b5ba;
  --ink-3: #989aa0;
  --line: #2c2e32;
  --line-strong: #6e7076;
  --link: #eeeeea;
  --action: #eeeeea;
  --action-ink: #121315;
  --hot: #ff5a4f;
  --important-text: #f2c46b;
  --important-bg: #352914;
  --ok-text: #6fd3a0;
  --ok-bg: #13301f;
  --focus: #eeeeea;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #121315;
    --surface: #18191c;
    --sunk: #222428;
    --ink: #eeeeea;
    --ink-2: #b3b5ba;
    --ink-3: #989aa0;
    --line: #2c2e32;
    --line-strong: #6e7076;
    --link: #eeeeea;
    --action: #eeeeea;
    --action-ink: #121315;
    --hot: #ff5a4f;
    --important-text: #f2c46b;
    --important-bg: #352914;
    --ok-text: #6fd3a0;
    --ok-bg: #13301f;
    --focus: #eeeeea;
    color-scheme: dark;
  }
}

:root {
  --sans: 'Familjen Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 4px;
  --r-md: 6px;
  --largeur: 1080px;
  --marge: clamp(16px, 4vw, 40px);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  overflow-x: clip;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}

h1 {
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.86em;
  background: var(--sunk);
  padding: 1px 5px;
  border-radius: var(--r-sm);
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.evitement {
  position: absolute;
  left: 8px;
  top: -60px;
  padding: 8px 12px;
  background: var(--action);
  color: var(--action-ink);
  border-radius: var(--r-sm);
  z-index: 30;
}

.evitement:focus {
  top: 8px;
}

/* ---------- En-tête public ---------- */
.tete {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px max(var(--marge), calc(50vw - var(--largeur) / 2));
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.marque {
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.liens {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.liens a {
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.liens a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---------- Recherche ---------- */
.recherche {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 420px;
}

.recherche .icone {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

input {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  min-height: 38px;
  width: 100%;
  min-width: 0;
}

input::-webkit-search-cancel-button {
  cursor: pointer;
}

.tete .recherche input {
  min-height: 40px;
  padding-left: 34px;
  background: var(--sunk);
  border-color: transparent;
}

/* La grande recherche est une ligne soulignée : le champ et son action se lisent d'un seul trait. */
.recherche.grande {
  max-width: 640px;
  margin: 28px 0 14px;
  gap: 0 12px;
  border-bottom: 2px solid var(--ink);
}

.recherche.grande:focus-within {
  border-bottom-width: 3px;
  margin-bottom: 13px;
}

.recherche.grande input {
  min-height: 52px;
  padding: 8px 0;
  background: none;
  border: 0;
  border-radius: 0;
  font-size: 1.08rem;
}

.recherche.grande input:focus-visible {
  outline: 0;
}

button,
.bouton {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.recherche.grande button {
  min-height: 52px;
  padding-inline: 0;
  background: none;
  border: 0;
  color: var(--ink);
  font-weight: 600;
}

.recherche.grande button:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 25;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.suggestions a {
  display: block;
  padding: 8px 12px;
  color: var(--ink);
  text-decoration: none;
}

.suggestions a:hover,
.suggestions a[aria-selected='true'] {
  background: var(--sunk);
}

/* ---------- Contenu ---------- */
.ariane {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 16px var(--marge) 0;
  color: var(--ink-3);
  font-size: 0.88rem;
}

.ariane a {
  color: var(--ink-3);
}

main {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 28px var(--marge) 64px;
}

section {
  margin-top: 48px;
}

.chapeau {
  max-width: 40em;
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 1.15rem;
  line-height: 1.45;
}

.note {
  max-width: 52em;
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 0.9rem;
}

.discret {
  color: var(--ink-3);
  font-size: 0.88rem;
}

.une h1 {
  max-width: 16em;
  font-size: clamp(2.1rem, 5.2vw, 3.3rem);
  letter-spacing: -0.035em;
}

.definition p,
.principes li {
  max-width: 44em;
  color: var(--ink-2);
}

.definition h2,
.principes h2 {
  margin-bottom: 8px;
}

.principes ul,
.prose ul,
.limites ul {
  margin: 10px 0 0;
  padding-left: 1.2rem;
}

.principes li,
.prose li,
.limites li {
  margin-bottom: 6px;
}

.grille-themes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 0 32px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.grille-themes li {
  display: grid;
  gap: 2px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.grille-themes a {
  font-weight: 600;
  text-decoration: none;
}

.grille-themes a:hover {
  text-decoration: underline;
}

.grille-themes span {
  color: var(--ink-3);
  font-size: 0.9rem;
}

.colonnes {
  columns: 3 16rem;
  column-gap: 40px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.colonnes li {
  padding: 6px 0;
  border-top: 1px solid var(--line);
  break-inside: avoid;
}

.colonnes a,
.resultats a {
  text-decoration: none;
  font-weight: 500;
}

.colonnes a:hover,
.resultats a:hover {
  text-decoration: underline;
}

.resultats {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  max-width: 44em;
}

.resultats li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.resultats span {
  color: var(--ink-3);
}

/* ---------- Fiche ---------- */
.identite {
  margin-top: 10px;
  color: var(--ink-2);
}

.reperes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 18px 32px;
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}

.reperes dt {
  color: var(--ink-3);
  font-size: 0.85rem;
}

.reperes dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.sommaire ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.sommaire a {
  font-weight: 500;
}

.sommaire span {
  color: var(--ink-3);
}

.theme-fiche h2,
.limites h2,
.vide h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}

.theme-fiche {
  scroll-margin-top: 80px;
}

.accords {
  margin: 0;
  padding: 0;
  list-style: none;
}

.accord {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.accord h3 {
  max-width: 48em;
  font-weight: 600;
}

.accord h3 a {
  text-decoration: none;
}

.accord h3 a:hover {
  text-decoration: underline;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 8px 2px 6px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  background: var(--sunk);
  white-space: nowrap;
}

.badge svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.extrait {
  max-width: 48em;
  margin: 12px 0 0;
}

.extrait figcaption {
  color: var(--ink-3);
  font-size: 0.85rem;
}

.extrait blockquote {
  margin: 4px 0 0;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--ink);
  overflow-wrap: anywhere;
}

.accord .discret {
  margin-top: 6px;
}

details {
  margin-top: 12px;
}

summary {
  cursor: pointer;
  padding: 8px 0;
  color: var(--ink-2);
  font-weight: 500;
}

.liste-theme {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.liste-theme li {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.liste-theme .nom {
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
}

.liste-theme .nom:hover {
  text-decoration: underline;
}

.liste-theme .meta {
  margin-top: 2px;
}

.limites li {
  max-width: 48em;
  color: var(--ink-2);
}

.vide p {
  max-width: 44em;
  margin-top: 12px;
  color: var(--ink-2);
}

.provenance {
  max-width: 52em;
  margin-top: 40px;
  color: var(--ink-3);
  font-size: 0.85rem;
}

.prose {
  max-width: 44rem;
}

.prose h2 {
  margin-top: 1.8rem;
}

.prose p {
  margin-top: 10px;
}

.prose .chapeau {
  margin-top: 14px;
}

/* ---------- Pied ---------- */
.pied {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px var(--marge) 32px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.875rem;
  text-align: center;
}

.pied nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
}

.pied a {
  color: var(--ink-3);
}

.theme {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.theme[hidden] {
  display: none;
}

.theme button {
  min-height: 32px;
  padding: 3px 12px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink-2);
  font-size: 0.85rem;
}

.theme button + button {
  border-left: 1px solid var(--line-strong);
}

.theme button[aria-pressed='true'] {
  background: var(--action);
  color: var(--action-ink);
}

@media (max-width: 760px) {
  .tete {
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  .tete .recherche {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  main {
    padding-top: 20px;
  }
}
