/* ==========================================================================
   GÉOPOLIS · Base : polices, réinitialisation, typographie, accessibilité
   ========================================================================== */

/* --- Polices auto-hébergées (licence SIL OFL), sous-ensemble latin --- */
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-standard-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/dm-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("../fonts/dm-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --- Réinitialisation --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--nuit);
}

/* Transition douce entre les pages (navigateurs compatibles) */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--police-revue);
  font-size: var(--t-base);
  font-weight: 400;
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote {
  margin: 0;
}
ul[class], ol[class] {
  padding: 0;
  list-style: none;
}
img, svg {
  max-width: 100%;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.lien-evitement {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--police-institution);
  font-size: var(--t-petit);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.lien-evitement:focus {
  transform: none;
  outline: 2px solid var(--rouge);
}

.visuellement-cache {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

::selection {
  background: var(--rouge);
  color: var(--papier);
}

/* --- Mouvement réduit : tout s'affiche immédiatement --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
