/* ==========================================================================
   base.css — reset, éléments HTML, typographie, utilitaires
   Chargé après tokens.css, avant components.css.
   ========================================================================== */

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: var(--fw-regular); }
p, ul, ol, dl, figure, table, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, picture, svg, video { max-width: 100%; }
img { border-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
address { font-style: normal; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--border-hairline); margin: 0; }

::selection { background: var(--terre-200); color: var(--encre-900); }

/* ---- Focus clavier — anneau terre cuite doublé de crème (charte §6) ----- */

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--terre-700);
  outline-offset: 3px;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 5px var(--craie);
}

/* ---- Typographie ------------------------------------------------------- */

.wordmark {
  font-family: var(--font-script);
  font-weight: var(--fw-regular);
  line-height: 1.1;
  letter-spacing: 0;
}

.display-1,
.display-2,
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  text-wrap: balance;
}

h1, .display-1 {
  font-size: var(--fs-3xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}

h2, .display-2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-regular);
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
}

h3 {
  font-size: var(--fs-lg);
  line-height: 1.22;
  letter-spacing: var(--ls-base);
}

h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  line-height: 1.3;
}

.eyebrow {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--terre-700);
}
.eyebrow--gold  { color: var(--or-700); }
.eyebrow--light { color: var(--or-500); }

.lead {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 60ch;
}

p { max-width: 68ch; line-height: var(--lh-base); }
p + p { margin-top: var(--sp-4); }

strong, b { font-weight: var(--fw-medium); }

small, .text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.price {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--terre-700);
  letter-spacing: var(--ls-base);
}
.price small {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

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

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

.link {
  color: var(--terre-700);
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size var(--d-base) var(--ease-soft), color var(--d-base) var(--ease-soft);
  padding-bottom: 2px;
}
.link:hover, .link:focus-visible { background-size: 100% 1px; }

.prose a:not(.btn) { color: var(--terre-700); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:not(.btn):hover { color: var(--terre-800); }

/* ---- Listes de contenu ------------------------------------------------- */

.list-plain > li + li { margin-top: var(--sp-3); }

.list-check > li {
  position: relative;
  padding-left: var(--sp-8);
  line-height: 1.55;
}
.list-check > li + li { margin-top: var(--sp-4); }
.list-check > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 18px;
  height: 1px;
  background: var(--or-500);
}

.list-bullets > li {
  position: relative;
  padding-left: var(--sp-6);
}
.list-bullets > li + li { margin-top: var(--sp-3); }
.list-bullets > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 6px;
  height: 6px;
  background: var(--terre-500);
}

/* ---- Mise en page ------------------------------------------------------ */

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

.section {
  position: relative;
  isolation: isolate;
  padding-block: var(--section-y);
  overflow: hidden;
}
.section--tight { padding-block: var(--section-y-tight); }
.section--flush-top { padding-top: 0; }
.section--flush-bottom { padding-bottom: 0; }

.section--accent  { background: var(--surface-accent); color: var(--terre-900); }
.section--soft    { background: var(--surface-soft); }
.section--card    { background: var(--surface-card); }
.section--inverse { background: var(--surface-inverse); color: var(--text-inverse); }
.section--cellar  { background: var(--surface-cellar); color: var(--or-100); }

.section--inverse h1, .section--inverse h2, .section--inverse h3,
.section--cellar  h1, .section--cellar  h2, .section--cellar  h3 { color: inherit; }
.section--inverse .lead, .section--cellar .lead { color: color-mix(in srgb, currentColor 78%, transparent); }

/* Les enfants de grille et de flex gardent par défaut leur largeur min-content
   et débordent : on l'annule une fois pour toutes. */
.grid > *, .split > *, .trades__grid > * { min-width: 0; }

.grid { display: grid; gap: var(--grid-gap); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

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

.flow-tight > * + * { margin-top: var(--sp-3); }

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---- En-tête de section ------------------------------------------------
   Double filet or au-dessus du titre : motif de marque (charte §5). */

.section-head {
  position: relative;
  max-width: 68ch;
  padding-left: var(--sp-8);
}
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center p, .section-head--center .lead { margin-inline: auto; }
.section-head .eyebrow { margin-bottom: var(--sp-3); }
.section-head h2 { margin-bottom: var(--sp-4); }
.section-head > :last-child { margin-bottom: 0; }

.section-head:not(.section-head--center) .rule-gold {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  height: auto;
  margin: 0;
  border: 0;
  background:
    linear-gradient(to bottom,
      var(--or-500) 0 var(--sp-12),
      color-mix(in srgb, var(--or-500) 26%, transparent) var(--sp-12) 100%);
}
.section-head--center { padding-left: 0; }
.section-head--center h2 { max-width: 24ch; margin-inline: auto; }

.rule-gold {
  display: block;
  width: 72px;
  height: 4px;
  border-top: 1px solid var(--or-500);
  border-bottom: 1px solid var(--or-500);
  margin-bottom: var(--sp-6);
}
.section-head--center .rule-gold { margin-inline: auto; }
.section--inverse .rule-gold,
.section--cellar .rule-gold { border-color: var(--or-500); }

/* ---- Redan de pilastre — séparateur de marque (charte §5) --------------- */

.ornament {
  display: block;
  width: 46px;
  height: 12px;
  margin-inline: auto;
  background:
    linear-gradient(var(--or-500), var(--or-500)) 50% 0    / 14px 2px no-repeat,
    linear-gradient(var(--or-500), var(--or-500)) 50% 5px  / 30px 2px no-repeat,
    linear-gradient(var(--or-500), var(--or-500)) 50% 10px / 46px 2px no-repeat;
}

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

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

.skip-link {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: var(--z-modal);
  transform: translateY(-200%);
  background: var(--encre-900);
  color: var(--or-500);
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
.skip-link:focus { transform: translateY(0); }

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mt-12 { margin-top: var(--sp-12); }
/* Empêche la césure des noms composés (« Sucy-en-Brie ») sur leurs traits
   d'union, que le navigateur traite sinon comme des points de coupure. */
.nowrap { white-space: nowrap; }

.measure { max-width: 62ch; }
.measure-narrow { max-width: 52ch; }

/* Ratios d'image — charte §5 : 3/2 produit, 16/9 héros, 4/5 vertical */
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-8-3  { aspect-ratio: 8 / 3; }
.ratio-3-2  { aspect-ratio: 3 / 2; }
.ratio-1-1  { aspect-ratio: 1 / 1; }
.ratio-4-5  { aspect-ratio: 4 / 5; }

@media (max-width: 700px) {
  .ratio-8-3 { aspect-ratio: 3 / 2; }
}
