/* ==========================================================================
   base.css — Reset, éléments HTML, utilitaires de mise en page
   Aucun composant ici : voir components.css
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-6));
  background-color: var(--c-bg);
}

body {
  min-height: 100vh;
  background-color: var(--c-bg);
  color: var(--c-text-2);
  font-family: var(--ff-body);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* clip (et non hidden) : empêche le défilement horizontal SANS transformer
     l'axe vertical en « auto », ce qui rognait les menus déroulants (usermenu). */
  overflow-x: clip;
}

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

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--c-line);
}

/* Chiffres alignés partout : références, montants, dates */
.tabular,
.table td,
.table th {
  font-variant-numeric: tabular-nums;
}

/* --- Titres --------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--ff-display);
  color: var(--c-text);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

h2 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-black);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
}

h3 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semi);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
}

h4 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semi);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
}

/* Fragment de titre en or : sur fond clair, un dégradé plein manquerait de
   contraste. L'accent porte donc sur un fragment, pas sur le titre entier. */
.accent {
  background: linear-gradient(100deg, #985800 0%, #D08210 50%, #985800 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Dans un panneau sombre, l'or redevient lumineux et peut porter tout le titre */
.dark-panel .accent {
  background: linear-gradient(180deg, #FFFFFF 24%, #FFD79A 72%, #F5A623 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--c-amber);
  text-decoration-color: var(--c-amber-line);
  text-underline-offset: 3px;
  transition: color var(--t-fast) var(--ease);
}

a:hover {
  color: var(--c-text);
}

.dark-panel a {
  color: var(--c-amber-lt);
}

.dark-panel a:hover {
  color: var(--c-amber-lt);
}

strong,
b {
  font-weight: var(--fw-semi);
  color: var(--c-text);
}

/* --- Focus clavier --------------------------------------------------------- */

:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-xs);
}

/* --- Lien d'évitement ------------------------------------------------------ */

.skip-link {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-full);
  background: var(--grad-amber);
  color: var(--c-ondark);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  text-decoration: none;
  transform: translateY(calc(-100% - var(--sp-6)));
  transition: transform var(--t-med) var(--ease-out);
}

.skip-link:focus-visible {
  color: var(--c-ondark);
  transform: translateY(0);
}

/* --- Conteneurs et sections ------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* .section porte seul le rythme vertical : ne jamais redéclarer padding-block
   ailleurs, sous peine de conflits de spécificité. */
.section {
  position: relative;
  padding-block: var(--sp-section);
}

.section--tight {
  padding-block: calc(var(--sp-section) * .58);
}

.section--alt {
  background-color: var(--c-bg-2);
}

.section-head {
  /* max-width: 44rem; */
  margin-bottom: var(--sp-12);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head>*+* {
  margin-top: var(--sp-4);
}

.section-head p {
  color: var(--c-muted);
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
}

/* --- Grilles ---------------------------------------------------------------- */

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

.grid--gap-lg {
  gap: var(--sp-6);
}

@media (min-width: 640px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid--split {
    grid-template-columns: 1fr 1fr;
  }
}

.stack>*+* {
  margin-top: var(--sp-4);
}

.stack-lg>*+* {
  margin-top: var(--sp-8);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

/* --- Utilitaires ------------------------------------------------------------ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--c-amber);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
}

.lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--c-muted);
}

.text-muted {
  color: var(--c-muted);
}

.text-faint {
  color: var(--c-faint);
}

.text-sm {
  font-size: var(--fs-sm);
}

.text-center {
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Atmosphère -------------------------------------------------------------
   Sur fond clair, le halo devient une aube très diffuse : il réchauffe le
   haut de page sans jamais faire baisser le contraste du texte. */

.glow {
  position: absolute;
  pointer-events: none;
  border-radius: var(--r-full);
  background: radial-gradient(circle,
      rgba(245, 166, 35, .34) 0%,
      rgba(9, 72, 147, .16) 44%,
      transparent 72%);
}

.glow--hero {
  top: -38%;
  left: 50%;
  width: min(170%, 1240px);
  aspect-ratio: 1;
  transform: translateX(-50%);
}

/* Dans un panneau sombre, le halo reprend sa densité */
.dark-panel .glow {
  background: radial-gradient(circle,
      rgba(245, 166, 35, .30) 0%,
      rgba(46, 123, 214, .26) 40%,
      transparent 70%);
}

/* Grain : texture de papier, très légère. En multiply sur fond clair, sinon
   le bruit blanchit l'image au lieu de la texturer. */
.grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .30;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.dark-panel .grain {
  opacity: .45;
  mix-blend-mode: overlay;
}

/* --- Mouvement réduit -------------------------------------------------------- */

@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;
  }
}

/* --- Impression --------------------------------------------------------------- */

@media print {

  html,
  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .site-footer,
  .glow,
  .grain,
  .no-print {
    display: none !important;
  }

  .dark-panel {
    background: #fff !important;
    color: #000 !important;
  }

  h1,
  h2,
  h3,
  h4 {
    color: #000;
  }

  .accent {
    -webkit-text-fill-color: #000;
    color: #000;
  }

  .card,
  .table-wrap {
    border-color: #999;
    background: #fff;
  }
}