/* ==========================================================================
   css/base.css — Font declaration, default typography, links, focus & motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Self-hosted Font Declaration (AGENTS.md section 3)
   Only manrope-latin-wght-normal.woff2 is declared. The latin-ext file stays
   in /assets/fonts/ intentionally without an @font-face rule.
   Manrope has no italic file; browsers synthesize the slant for <em> and <i>.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Manrope';
  src: url('../assets/fonts/manrope-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Document & Default Typography
   -------------------------------------------------------------------------- */
html {
  font-family: var(--font-sans);
  font-size: 100%; /* 16px default browser base */
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: var(--color-white);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

/* Headings: black by default (Accueil, Informations générales, Documents).
   Notre équipe section headings use .heading--accent (green #95B134). */
h1,
h2,
h3,
h4 {
  color: var(--color-black);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

h1 {
  font-size: var(--text-hero);
  font-weight: var(--weight-bold);
}

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

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

/* Modifier for Notre équipe green section titles (AGENTS.md section 6.3) */
.heading--accent {
  color: var(--color-green-accent);
}

p + p {
  margin-top: var(--space-4);
}

/* Scientific Latin names and italic captions use browser-synthesized slant */
em,
i {
  font-style: italic;
}

strong,
b {
  font-weight: var(--weight-bold);
}

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

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

/* Horizontal section divider (Informations générales, Notre équipe, Documents) */
hr {
  border: 0;
  border-top: 1px solid var(--color-border-subtle);
  margin: var(--space-12) 0;
}

/* --------------------------------------------------------------------------
   3. Links
   -------------------------------------------------------------------------- */
a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   4. Keyboard Focus Styles (High Contrast on All Backgrounds)
   Why not #95B134 everywhere?
   #95B134 has only ~2.47:1 contrast on white (#FFFFFF) and ~1.92:1 on the
   footer grey (#E1E1E1), which fails the WCAG 3:1 requirement for focus rings.
   Instead, we use a two-colour ring:
   - An inner 2px white ring (box-shadow) so focus is clearly visible on dark
     surfaces (the #545454 navigation bar, hero photos, and dark modal buttons).
   - An outer 2px near-black ring (outline with 2px offset) so focus is clearly
     visible on light surfaces (white sections, cards, and the #E1E1E1 footer).
   -------------------------------------------------------------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-focus-outer);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--color-focus-inner);
}

/* --------------------------------------------------------------------------
   5. Accessibility Utilities & Reduced Motion (AGENTS.md section 3)
   -------------------------------------------------------------------------- */

/* Visually hides text while keeping it readable by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
