/* Base : polices locales, variables (valeurs de repli, le thème de config.js les remplace), réinitialisation, typographie. */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Italiana';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/italiana-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --c-fond: #F4EEE6;
  --c-surface: #FBF8F3;
  --c-texte: #241A14;
  --c-texte-doux: #6B5A4C;
  --c-bordure: #E4D8CA;
  --c-deco: #D8C6B3;
  --c-accent: #9A5B43;
  --f-titres: 'Italiana', 'Didot', 'Times New Roman', serif;
  --f-texte: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Échelle typographique fluide */
  --t-petit: 0.8125rem;
  --t-normal: 1rem;
  --t-grand: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --t-h3: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  --t-h2: clamp(2.25rem, 1.7rem + 2vw, 3.5rem);
  --t-h1: clamp(2.75rem, 1.9rem + 3.6vw, 5.25rem);

  /* Espacements */
  --e-1: 0.5rem;
  --e-2: 1rem;
  --e-3: 1.5rem;
  --e-4: 2.5rem;
  --e-5: clamp(2.5rem, 2rem + 4vw, 6.5rem);

  --rayon: 6px;
  --largeur: 1200px;
  --gouttiere: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  --hauteur-barre: 0px;
  --ombre: 0 1px 2px rgb(23 23 23 / 0.04), 0 8px 24px rgb(23 23 23 / 0.06);
  --transition: 220ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

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

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

body {
  margin: 0;
  background: var(--c-fond);
  color: var(--c-texte);
  font-family: var(--f-texte);
  font-size: var(--t-normal);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: var(--hauteur-barre);
}

h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }

h1, h2, .logo {
  font-family: var(--f-titres);
  font-weight: 400; /* Italiana n'a qu'une graisse : pas de faux gras */
  line-height: 1.05;
  letter-spacing: 0;
  text-wrap: balance;
}
h3 { font-size: var(--t-normal); font-weight: 600; line-height: 1.35; }
p { text-wrap: pretty; }

img, picture { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; }
/* Bouton qui a l'apparence d'un lien (lien « Opus Sites » qui ouvre une fenêtre) */
.lien-bouton { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--c-bordure); }

.conteneur {
  width: 100%;
  max-width: calc(var(--largeur) + 2 * var(--gouttiere));
  margin-inline: auto;
  padding-inline: max(var(--gouttiere), env(safe-area-inset-left));
}

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

.centre { text-align: center; }

.surtitre {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.lien {
  color: var(--c-accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--c-deco);
  text-decoration-thickness: 1px;
  transition: text-decoration-color var(--transition);
}
.lien:hover { text-decoration-color: currentColor; }

/* Apparition douce au défilement (voir ui/apparitions.js) */
.apparition {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.6, 0.2, 1);
  transition-delay: var(--delai-apparition, 0ms);
}
.apparition.est-visible { opacity: 1; transform: none; }

@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;
  }
  .apparition { opacity: 1; transform: none; }
}
