/* ==========================================================================
   ÉCRIN — Reset & typographie de base
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  scroll-behavior: smooth;
  /* décale l'ancre pour ne pas passer sous le bandeau et le header fixes */
  scroll-padding-top: calc(var(--banner-h) + var(--header-h) + 1rem);
}

body {
  min-height: 100vh;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Empêche le scroll de la page quand le menu mobile ou la lightbox sont ouverts */
body.is-locked {
  overflow: hidden;
}

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

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

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: var(--lh-title);
  letter-spacing: var(--ls-display);
  text-wrap: balance;
  color: var(--text-heading);
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 500; }
h4 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  font-weight: 700;
  letter-spacing: 0;
}

h1 em,
h2 em,
.hero__title em {
  font-style: italic;
  color: var(--c-wine);
}

p {
  text-wrap: pretty;
}

/* --- Liens ---------------------------------------------------------------- */

a {
  color: inherit;
  text-decoration: none;
}

/* Lien de texte courant : soulignement qui s'épaissit au survol */
.link {
  color: var(--c-wine-deep);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-size var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.link:hover {
  background-size: 100% 2px;
}

/* --- Listes --------------------------------------------------------------- */

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

/* --- Accessibilité -------------------------------------------------------- */

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

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: calc(var(--z-menu) + 10);
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-ink);
  color: var(--c-paper);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  border-radius: 0 0 12px 12px;
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Sélection ------------------------------------------------------------ */

::selection {
  background: var(--c-wine);
  color: var(--c-paper);
}

/* --- Barre de défilement (WebKit) ----------------------------------------- */

@media (min-width: 1024px) {
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-track { background: var(--c-paper-2); }
  ::-webkit-scrollbar-thumb {
    background: var(--c-stone-line);
    border: 3px solid var(--c-paper-2);
    border-radius: 999px;
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--c-wine); }
}
