/* ═══════════════════════════════════════════════════════════════════════
   SCROLER — Socle commun à toutes les pages
   ───────────────────────────────────────────────────────────────────────
   Aucun !important de mise en forme : tout est préfixé `scr-` ou porté
   par une variable CSS, donc rien ne fuit et rien n'est écrasé de force.
   Les 7 !important présents sont cantonnés à trois usages où ils sont
   la technique standard : le masquage lecteur d'écran (.scr-sr), la
   neutralisation des animations sous prefers-reduced-motion, et
   l'impression.
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══ 1. Jetons de design ══════════════════════════════════════════════ */
:root {
  /* Palette de marque (relevée sur le favicon officiel) */
  --scr-orange:  #E94E1A;
  --scr-orange-d:#C13D12;   /* 4,6:1 sur le papier, 5,3:1 en fond de bouton blanc */
  --scr-paper:   #F2EFEA;
  --scr-grey:    #B3B2B2;
  --scr-coal:    #373736;
  --scr-ink:     #000000;
  --scr-night:   #14100D;  /* charbon chaud (ex-#0B0A0A) */

  /* Texte sur fond sombre — ratios vérifiés sur --scr-night #14100D */
  --scr-on-night:        #F2EFEA;             /* 16,5:1 */
  --scr-on-night-soft:   rgba(242,239,234,.86);/* 12,3:1 */
  --scr-on-night-mute:   rgba(242,239,234,.72);/*  8,8:1 */

  /* Texte sur fond clair — ratios vérifiés sur --scr-paper */
  --scr-on-paper:        #121211;             /* 16,3:1 */
  --scr-on-paper-soft:   #4A4A48;             /*  7,7:1 */
  --scr-on-paper-mute:   #5F5F5C;             /*  5,6:1 */

  /* Typographie */
  --scr-font:  'Jost', ui-sans-serif, -apple-system, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --scr-mono:  'IBM Plex Mono', ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;

  /* Rythme */
  --scr-gutter: clamp(20px, 5vw, 72px);
  --scr-max:    1180px;

  /* Hauteur d'un éventuel en-tête fixe (thème WordPress).
     Une seule valeur à changer si le thème ajoute une barre collante. */
  --scr-header: 0px;

  /* Courbe d'animation maison */
  --scr-ease: cubic-bezier(.22, 1, .36, 1);
}

/* ═══ 2. Remise à zéro minimale ════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--scr-paper);
  color: var(--scr-on-paper);
  font-family: var(--scr-font);
  font-weight: 300;
  font-size: clamp(16px, 1.05vw + 12px, 18px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-weight: 200;
  line-height: 1.12;
  letter-spacing: -.005em;
  text-wrap: balance;
}
h1 { font-size: clamp(34px, 6vw, 68px); }
h2 { font-size: clamp(26px, 4vw, 44px); }
h3 { font-size: clamp(20px, 2.4vw, 27px); font-weight: 300; }

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-underline-offset: .18em; }

/* Sélection et défilement aux couleurs de la maison.
   #C13D12 sous du blanc : 5,3:1 — le vif #E94E1A n'en donne que 3,8. */
::selection { background: #C13D12; color: #fff; }
html { scrollbar-color: rgba(233,78,26,.55) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(233,78,26,.55); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(233,78,26,.8); }

/* ═══ 3. Accessibilité ═════════════════════════════════════════════════ */

/* Anneau de focus visible partout, y compris sur fond sombre.
   `:focus-visible` seul ne suffit pas sur les vieux Safari : on garde un
   repli `:focus` neutralisé dès que `:focus-visible` est reconnu. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus {
  outline: 3px solid var(--scr-orange);
  outline-offset: 3px;
  border-radius: 2px;
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus:not(:focus-visible) {
  outline: none;
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--scr-orange);
  outline-offset: 3px;
}

/* Réservé aux lecteurs d'écran. `clip-path` plutôt que `clip` (déprécié). */
.scr-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Variante qui réapparaît au focus clavier — pour le lien d'évitement. */
.scr-sr--focusable:focus-visible {
  position: fixed !important;
  top: 12px; left: 12px;
  width: auto; height: auto;
  margin: 0; padding: 14px 22px;
  overflow: visible;
  clip-path: none;
  z-index: 9999;
  background: var(--scr-ink);
  color: var(--scr-paper);
  font-family: var(--scr-mono);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
}

/* ═══ 4. Mise en page ══════════════════════════════════════════════════ */
.scr-wrap {
  width: 100%;
  max-width: var(--scr-max);
  margin-inline: auto;
  padding-inline: var(--scr-gutter);
}

/* ═══ 5. Boutons et liens d'action ═════════════════════════════════════ */
.scr-btn {
  display: inline-flex;
  align-items: center;
  gap: .8em;
  min-height: 48px;               /* cible tactile confortable (WCAG 2.5.8) */
  padding: 14px 30px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: var(--scr-on-paper);
  font-family: var(--scr-mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .28s ease, color .28s ease, border-color .28s ease;
}
.scr-btn:hover  { background: var(--scr-ink); color: var(--scr-paper); border-color: var(--scr-ink); }
.scr-btn--accent{ color: var(--scr-orange-d); }
/* #C13D12 et non #E94E1A : blanc sur l’orange de marque ne donne que
   3,8:1, sous le seuil AA. */
.scr-btn--accent:hover { background: var(--scr-orange-d); color: #fff; border-color: var(--scr-orange-d); }

/* Sur fond sombre */
.scr-on-dark .scr-btn { color: var(--scr-on-night); }
.scr-on-dark .scr-btn:hover { background: var(--scr-orange-d); color: #fff; border-color: var(--scr-orange-d); }

/* ═══ 6. Préférences système ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  /* `.scr-nuit .scr-btn` de page.css fait (0,2,0) et pose border-color :
     il faut au moins autant ici, sinon la bordure reste invisible. */
  .scr-btn,
  .scr-nuit .scr-btn { border: 2px solid ButtonText; }
}

/* ═══ 7. Impression ════════════════════════════════════════════════════ */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .scr-no-print { display: none !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}
