/* Correctifs d'accessibilité (pré-audit RGAA) */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--ink, #191817);
  color: var(--night, #fff);
  border: 2px solid var(--night, #fff);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  outline: 2px solid var(--ink, #191817);
  outline-offset: 2px;
}
/* Groupe de liens d'évitement : visible dès que l'un d'eux reçoit le focus */
.skip-links {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100vw - 16px);
  transform: translateY(-300%);
}
.skip-links:focus-within { transform: none; }
.skip-links .skip-link { position: static; transform: none; }
main:focus { outline: none; }
.main-nav .theme-toggle:focus-visible,
.masthead > .theme-toggle:focus-visible,
.quick-search button:focus-visible,
.back-to-top:focus-visible {
  outline: 2px solid var(--accent, #a14142);
  outline-offset: 2px;
}
.quick-search input:focus-visible {
  outline: 2px solid var(--accent, #a14142);
  outline-offset: 2px;
}
h1:focus { outline: none; }
/* Focus visible (RGAA 10.7) : contour plein ≥ 3:1 sur les éléments qui n'en avaient pas d'assez net */
.collection-search input:focus-visible,
html .social-icon:focus-visible,
.region-help:focus-visible {
  outline: 2px solid var(--accent, #a14142);
  outline-offset: 2px;
}
.region-help:focus-visible { border-radius: 3px; }


/* Contraste en thème sombre : texte blanc sur fond rouge ≥ 4,5:1, texte rouge sur fond sombre ≥ 4,5:1 */
:root[data-theme="dark"] .quick-search button,
:root[data-theme="dark"] .collection-search button {
  background: #b04e4f;
  border-color: #b04e4f;
}
:root[data-theme="dark"] .quick-search button:hover,
:root[data-theme="dark"] .collection-search button:hover {
  background: #873536;
  border-color: #873536;
}
:root[data-theme="dark"] .platform-detail-row__percent {
  color: #d97575;
}
:root[data-theme="dark"] .generation-key h3 {
  color: #d97575;
}

/* Ancre sous l'en-tête fixe : la cible d'un focus ou d'un lien d'évitement ne passe plus sous la navigation (92 px en bureau avant défilement, 64 px ensuite ; 72 px en mobile) */
html { scroll-padding-top: 100px; }
@media (max-width: 760px) { html { scroll-padding-top: 80px; } }

/* Survol : un signe non coloré (soulignement, anneau) en plus du changement de couleur */
@media (hover: hover) {
  html .breadcrumb a:hover,
  html a.back-link:hover,
  html .stats-tab:not(.is-active):not([aria-disabled="true"]):hover,
  html .quick-search button:hover,
  html .collection-search button:hover,
  html .home-platform-chips a:not(.has-logo):hover,
  html .maker-platform-links a:not(.has-logo):hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
  }
  html a.field-link:hover { text-decoration-thickness: 2px; text-underline-offset: 4px; }
  html .main-nav :is(button, a):hover::after { opacity: 1; transform: scaleX(1); }
  html .brand[href]:hover { opacity: 0.72; }
  html .theme-toggle:hover,
  html .main-nav .theme-toggle:hover,
  html .masthead > .theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
  }
}

/* Survol du logo : fondu progressif (désactivé si l'utilisateur réduit les animations). */
.brand { transition: opacity 450ms ease; }
@media (prefers-reduced-motion: reduce) { .brand { transition: none; } }
