/* Variables, thèmes clair et sombre, typographie. Aucune ressource externe. */

:root {
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-2: #e9eff5;
  --text: #14202b;
  --muted: #46566a;
  --border: #c3cfdb;
  --border-strong: #66788c;
  --primary: #0b5cad;
  --primary-hover: #084a8c;
  --on-primary: #ffffff;
  --danger: #b3261e;
  --on-danger: #ffffff;
  --success: #1b6e3c;
  --success-bg: #e3f4e9;
  --warning-bg: #fff3d1;
  --warning-text: #4f3500;
  --danger-bg: #fde7e5;
  --info-bg: #e3eefa;
  --focus: #0b5cad;
  --shadow: 0 1px 3px rgba(20, 32, 43, 0.18);
  --radius: 0.5rem;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0e1621;
  --surface: #17222f;
  --surface-2: #1f2d3d;
  --text: #e8eef4;
  --muted: #aebccb;
  --border: #33465a;
  --border-strong: #8196ab;
  --primary: #7db7f0;
  --primary-hover: #a3cdf6;
  --on-primary: #06223d;
  --danger: #ff8f87;
  --on-danger: #3a0a07;
  --success: #7ddc9c;
  --success-bg: #12301f;
  --warning-bg: #3a2e0c;
  --warning-text: #ffe3a0;
  --danger-bg: #3d1816;
  --info-bg: #14283d;
  --focus: #ffd84d;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0e1621;
    --surface: #17222f;
    --surface-2: #1f2d3d;
    --text: #e8eef4;
    --muted: #aebccb;
    --border: #33465a;
    --border-strong: #8196ab;
    --primary: #7db7f0;
    --primary-hover: #a3cdf6;
    --on-primary: #06223d;
    --danger: #ff8f87;
    --on-danger: #3a0a07;
    --success: #7ddc9c;
    --success-bg: #12301f;
    --warning-bg: #3a2e0c;
    --warning-text: #ffe3a0;
    --danger-bg: #3d1816;
    --info-bg: #14283d;
    --focus: #ffd84d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

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

html {
  /* Respecte la taille de texte du navigateur ; le réglage du site la multiplie. */
  font-size: calc(100% * var(--text-scale, 1));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 1.5rem 0 0.75rem;
}

h1 {
  font-size: 1.6rem;
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.1rem;
}

h4 {
  font-size: 1rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

a {
  color: var(--primary);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--primary-hover);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--surface-2);
  padding: 0.05em 0.3em;
  border-radius: 0.25rem;
}

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

h1:focus,
legend:focus,
main:focus,
.verdict:focus,
.fiche__h2:focus {
  outline: none;
}

h1:focus-visible,
legend:focus-visible,
.verdict:focus-visible,
.fiche__h2:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.muted {
  color: var(--muted);
}

.sr-only,
.visually-section {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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