/* ==========================================================================
   Base — variables partagées par toutes les rubriques du site
   ========================================================================== */
:root {
  --paper: #f5eddc;
  --paper-light: #fbf6ec;
  --paper-shade: #e6dac2;
  --liner: #e4d4b4;
  --liner-deep: #cdb98f;
  --ink: #5b4a36;
  --ink-soft: #8a7559;
  --accent: #9e3a32; /* rouge des textes de la vidéo */
  --gold: #c9a660;
  --video-backdrop: #fce3c8;

  /* Palette du site (Provence) */
  --ivory: #faf6ee;
  --ivory-deep: #f3ecdf;
  --ivory-card: #fffdf8;
  --sage: #9fae8a;
  --sage-deep: #7f8f69;
  --sage-light: #e4e9da;
  --sage-mist: #eef1e7;
  --olive: #4b5530;        /* écriture principale */
  --olive-soft: #6c7550;
  --olive-muted: #8b9273;
  --line: rgba(75, 85, 48, 0.16);
  --todo: #b07a2a;

  --font-sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --header-h: 56px;
  --radius: 18px;
  --ease-out: cubic-bezier(0.22, 0.7, 0.25, 1);

  --font-serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;

  --vh: 100vh;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  /* Grain papier généré en SVG (léger, sans image externe) */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .38  0 0 0 0 .31  0 0 0 0 .2  0 0 0 .11 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --fibers: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.012 .05' numOctaves='4' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .46  0 0 0 0 .32  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>");
}

@supports (height: 100svh) {
  :root { --vh: 100svh; }
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  background: var(--ivory);
  color: var(--olive);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

/* Tant que l’enveloppe est fermée, rien ne défile derrière */
html.is-sealed,
html.is-sealed body,
html.is-opening,
html.is-opening body {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
}

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

button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

[hidden] { display: none !important; }

/* Papier ivoire texturé, réutilisable */
.paper {
  background-color: var(--paper);
  background-image: var(--grain), var(--fibers),
    radial-gradient(120% 80% at 30% 20%, var(--paper-light) 0%, var(--paper) 55%, var(--paper-shade) 130%);
  background-size: 220px 220px, 600px 600px, 100% 100%;
}
