/* ==========================================================================
   base.css — remise à zéro minimale + styles de base des éléments HTML
   ========================================================================== */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

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

  body,
  h1,
  h2,
  h3,
  p,
  figure,
  dl,
  dd,
  address {
    margin: 0;
  }

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

  address {
    font-style: normal;
  }

  img,
  picture,
  svg {
    display: block;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
  }

  /* Les règles d'affichage des composants ne doivent jamais réafficher un élément [hidden]. */
  [hidden] {
    display: none !important;
  }
}

@layer base {
  html {
    scroll-padding-top: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }

  body {
    background: var(--color-cream);
    color: var(--color-ink);
    font-family: var(--font-sans);
    /* line-height volontairement laissé à « normal » : chaque composant fixe le sien. */
    -webkit-font-smoothing: antialiased;
  }

  /* Le défilement de la page est bloqué tant que la visionneuse est ouverte. */
  body:has(dialog[open]) {
    overflow: hidden;
  }

  a {
    color: var(--color-ink);
    text-decoration: none;
  }

  a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  a:focus-visible,
  button:focus-visible {
    outline: 2px solid var(--color-brass-light);
    outline-offset: 3px;
  }

  h1,
  h2,
  h3,
  .font-serif {
    font-family: var(--font-serif);
    font-weight: 500;
    letter-spacing: 0.005em;
  }

  strong {
    font-weight: 600;
  }

  /* Chiffres alignés sur la ligne de base (« 1 550 m », « 216 m² »…). */
  .num {
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1;
  }

  /* Respect de la préférence « réduire les animations » du système. */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}
