/* ==========================================================================
   CyberRP — base.css
   Remise à zéro, typographie, gabarit, en-tête et pied de page.
   Ne référence QUE les variables déclarées dans theme.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Remise à zéro
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ul, ol {
  margin: 0;
  padding: 0;
}

ul[class],
ol[class] {
  list-style: none;
}

img,
picture,
svg {
  max-width: 100%;
  display: block;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* --------------------------------------------------------------------------
   2. Page
   -------------------------------------------------------------------------- */

body {
  background-color: var(--bg);
  background-image: var(--grille-fond);
  background-size: var(--grille-pas) var(--grille-pas);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--taille-base);
  font-weight: var(--poids-texte);
  line-height: var(--interligne);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1 0 auto;
}

.conteneur {
  width: 100%;
  max-width: var(--largeur-max);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}

.conteneur--etroit {
  max-width: 900px;
}

.section {
  padding-block: var(--esp-8);
}

.section--serree {
  padding-block: var(--esp-7);
}

.section--surface {
  background-color: var(--surface);
  border-block: var(--epaisseur-filet) solid var(--border);
}

/* --------------------------------------------------------------------------
   3. Typographie
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--poids-titre);
  line-height: var(--interligne-titre);
  letter-spacing: var(--interlettre-titre);
  text-transform: uppercase;
  text-wrap: balance;
}

h1 {
  font-size: var(--taille-hero);
}

h2 {
  font-size: var(--taille-section);
  margin-bottom: var(--esp-5);
}

h3 {
  font-size: var(--taille-lg);
  font-weight: var(--poids-titre-2);
  margin-bottom: var(--esp-3);
}

h4 {
  font-size: var(--taille-md);
  font-weight: var(--poids-titre-2);
  letter-spacing: 0.04em;
  margin-bottom: var(--esp-2);
}

p,
li {
  text-wrap: pretty;
}

p + p,
p + ul,
p + ol,
ul + p,
ol + p,
p + .cadre,
h3 + p {
  margin-top: var(--esp-4);
}

.plomb {
  font-size: var(--taille-md);
  color: var(--text-muted);
  max-width: var(--largeur-texte);
}

.texte-mesure {
  max-width: var(--largeur-texte);
}

.sur-titre {
  font-family: var(--font-display);
  font-size: var(--taille-xs);
  font-weight: var(--poids-titre-2);
  letter-spacing: var(--interlettre-sur-titre);
  text-transform: uppercase;
  color: var(--accent-2);
  display: block;
  margin-bottom: var(--esp-3);
}

strong,
b {
  font-weight: var(--poids-texte-fort);
  color: var(--text);
}

em {
  font-style: normal;
  color: var(--accent-2);
}

abbr[title] {
  text-decoration: underline dotted var(--text-muted);
  cursor: help;
}

code,
kbd,
samp {
  font-family: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  font-size: 0.9em;
  background-color: var(--surface-haut);
  border: var(--epaisseur-filet) solid var(--border);
  padding: 0.1em 0.4em;
  color: var(--accent);
}

hr {
  border: 0;
  border-top: var(--epaisseur-filet) solid var(--border);
  margin-block: var(--esp-6);
}

/* Listes de contenu rédactionnel */
.liste {
  list-style: none;
  display: grid;
  gap: var(--esp-3);
}

.liste > li {
  position: relative;
  padding-left: var(--esp-5);
}

.liste > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.liste--cyan > li::before {
  background-color: var(--accent-2);
}

.liste--alert > li::before {
  background-color: var(--alert);
}

ol.liste-numerotee {
  list-style: none;
  counter-reset: etape;
  display: grid;
  gap: var(--esp-4);
}

ol.liste-numerotee > li {
  counter-increment: etape;
  position: relative;
  padding-left: 3.25rem;
}

ol.liste-numerotee > li::before {
  content: counter(etape, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-display);
  font-weight: var(--poids-titre);
  font-size: var(--taille-base);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   4. Liens et focus
   -------------------------------------------------------------------------- */

a {
  color: var(--accent-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color var(--transition-rapide);
}

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

:focus-visible {
  outline: var(--focus-epaisseur) solid var(--focus-couleur);
  outline-offset: var(--focus-decalage);
}

.lien-evitement {
  position: absolute;
  left: var(--esp-4);
  top: var(--esp-4);
  z-index: 100;
  transform: translateY(-200%);
  background-color: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: var(--taille-xs);
  font-weight: var(--poids-titre-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: var(--esp-3) var(--esp-5);
  transition: transform var(--transition);
}

.lien-evitement:focus-visible {
  transform: translateY(0);
  color: var(--bg);
}

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

/* --------------------------------------------------------------------------
   5. En-tête
   -------------------------------------------------------------------------- */

.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-voile);
  backdrop-filter: blur(10px);
  border-bottom: var(--epaisseur-filet) solid var(--border);
}

.entete__barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--esp-4);
  min-height: 4.25rem;
}

.marque {
  font-family: var(--font-display);
  font-weight: var(--poids-titre);
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.marque span {
  color: var(--accent);
}

.marque:hover {
  color: var(--text);
}

.menu-bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background-color: transparent;
  border: var(--epaisseur-filet) solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition-rapide), color var(--transition-rapide);
}

.menu-bouton:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.menu-bouton__traits,
.menu-bouton__traits::before,
.menu-bouton__traits::after {
  display: block;
  width: 18px;
  height: 2px;
  background-color: currentColor;
  transition: transform var(--transition), opacity var(--transition-rapide);
}

.menu-bouton__traits {
  position: relative;
}

.menu-bouton__traits::before,
.menu-bouton__traits::after {
  content: '';
  position: absolute;
  left: 0;
}

.menu-bouton__traits::before {
  top: -6px;
}

.menu-bouton__traits::after {
  top: 6px;
}

.menu-bouton[aria-expanded='true'] .menu-bouton__traits {
  background-color: transparent;
}

.menu-bouton[aria-expanded='true'] .menu-bouton__traits::before {
  transform: translateY(6px) rotate(45deg);
}

.menu-bouton[aria-expanded='true'] .menu-bouton__traits::after {
  transform: translateY(-6px) rotate(-45deg);
}

.nav {
  display: none;
}

.nav.est-ouvert {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background-color: var(--surface);
  border-bottom: var(--epaisseur-filet) solid var(--border);
  box-shadow: var(--ombre);
}

.nav__liste {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--esp-2) var(--gouttiere) var(--esp-5);
}

.nav__lien {
  display: block;
  font-family: var(--font-display);
  font-size: var(--taille-xs);
  font-weight: var(--poids-titre-2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  padding: var(--esp-4) 0;
  border-bottom: var(--epaisseur-filet) solid var(--border);
}

.nav__lien:hover {
  color: var(--accent);
}

.nav__lien[aria-current='page'] {
  color: var(--accent);
}

@media (min-width: 60rem) {
  .menu-bouton {
    display: none;
  }

  .nav,
  .nav.est-ouvert {
    display: block;
    position: static;
    background-color: transparent;
    border: 0;
    box-shadow: none;
  }

  .nav__liste {
    flex-direction: row;
    align-items: center;
    gap: var(--esp-6);
    padding: 0;
  }

  .nav__lien {
    padding: var(--esp-2) 0;
    border-bottom: 2px solid transparent;
  }

  .nav__lien:hover,
  .nav__lien[aria-current='page'] {
    border-bottom-color: var(--accent);
  }
}

/* --------------------------------------------------------------------------
   6. Pied de page
   -------------------------------------------------------------------------- */

.pied {
  flex-shrink: 0;
  background-color: var(--surface);
  border-top: var(--epaisseur-filet) solid var(--border);
  margin-top: var(--esp-8);
}

.pied__grille {
  display: grid;
  gap: var(--esp-6);
  padding-block: var(--esp-7) var(--esp-6);
}

@media (min-width: 48rem) {
  .pied__grille {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--esp-7);
  }
}

.marque--pied {
  font-size: 1.15rem;
}

.pied__resume {
  max-width: 42ch;
}

.pied h2,
.pied h3 {
  font-size: var(--taille-xs);
  letter-spacing: var(--interlettre-sur-titre);
  color: var(--text-muted);
  margin-bottom: var(--esp-4);
}

.pied__liste {
  display: grid;
  gap: var(--esp-3);
}

.pied__liste a {
  text-decoration: none;
  font-weight: var(--poids-texte-fort);
}

.pied__liste a:hover {
  text-decoration: underline;
}

.pied__bas {
  border-top: var(--epaisseur-filet) solid var(--border);
  padding-block: var(--esp-5) var(--esp-6);
  display: grid;
  gap: var(--esp-2);
}

.pied__bas p {
  font-size: var(--taille-sm);
  color: var(--text-muted);
  max-width: 90ch;
}

.pied__bas p + p {
  margin-top: 0;
}

.avertissement-cdpr {
  color: var(--text);
  font-weight: var(--poids-texte-fort);
}

/* --------------------------------------------------------------------------
   7. Utilitaires
   -------------------------------------------------------------------------- */

.centre {
  text-align: center;
}

.centre .plomb {
  margin-inline: auto;
}

.pile {
  display: grid;
  gap: var(--esp-4);
}

.pile--large {
  gap: var(--esp-6);
}

.rangee {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-4);
}

.rangee--centre {
  justify-content: center;
}

.mt-6 { margin-top: var(--esp-6); }
.mt-7 { margin-top: var(--esp-7); }
.mb-5 { margin-bottom: var(--esp-5); }

/* --------------------------------------------------------------------------
   8. Mouvement réduit
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
