/* L'identité des pages de www.getfoodclip.com : les valeurs de DESIGN.md, les mêmes noms que celles
   d'Influence (src/ui/valeurs.css de foodclip-influence). Les polices sont servies par le site
   (src/site/identite.ts donne à chaque police son adresse sur le site) : aucune requête vers un tiers.
   Puis le cadre des textes, celui de la racine, des mentions légales, de la notice et de la page
   introuvable : la page de lecture des textes juridiques d'Influence (DESIGN.md, « Les textes
   juridiques » ; src/app/(textes)/textes.css de foodclip-influence), en-tête réduit à la marque, sans
   sommaire ni bouton d'impression (brief de la page de démo, retouche 3). Classes préfixées .tj-. */

/* ---------- Les polices : Fraunces dit, Inter agit, JetBrains Mono étiquette ---------- */
/* Latin, latin étendu et vietnamien, découpés comme Google les sert : le navigateur ne charge que ceux
   dont la page a besoin. Fichiers du design system d'Influence (design-system/assets/fonts/), licences
   à côté d'eux. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/polices/fraunces-latin.48282a415ec2.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: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/polices/fraunces-latin-ext.f120089b9440.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/polices/fraunces-vietnamese.7e3c04662669.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/polices/inter-latin.c940764593d0.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: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/polices/inter-latin-ext.a28eb6d3ccb5.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/polices/inter-vietnamese.8db00ff46c67.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/polices/jetbrains-mono-latin.2c32b9b3ee35.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: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/polices/jetbrains-mono-latin-ext.9c38cb2d0d2d.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/polices/jetbrains-mono-vietnamese.d44eb1936043.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* ---------- Les valeurs ---------- */
:root {
  --tomate: #E63B2E;         /* l'action principale, le point de la marque */
  --tomate-hover: #cf3327;   /* le survol du bouton primaire, et rien d'autre */
  --beurre: #F5EFE3;         /* le fond */
  --creme: #FBF7EE;          /* ce qui se pose sur le beurre */
  --encre: #1A1614;          /* le texte, le fond inversé */
  --gris: #7A6F66;           /* le texte secondaire */
  --gris-clair: #A89E94;     /* les détails discrets */

  --line: rgba(26, 22, 20, .1);
  --line-strong: rgba(26, 22, 20, .24);
  --voile-selection: color-mix(in srgb, var(--tomate) 26%, transparent);

  --r-trait: 2px;
  --r-sm: 10px;              /* ce qui agit */
  --r-lg: 16px;              /* ce qui contient */
  --r-pill: 999px;

  --ombre-menu: 0 16px 44px rgba(26, 22, 20, .18);

  --focus: 2px solid var(--tomate);
  --focus-decalage: 3px;

  --font-display: 'Fraunces', serif;
  --font-display-weight: 700;
  --font-display-settings: 'opsz' 24;
  --font-texte: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* L'échelle de l'espace client, celle des textes juridiques d'Influence. */
  --ec-titre-page: 40px;
  --ec-titre-page-interligne: 1.08;
  --ec-titre-page-approche: -0.025em;
  --ec-titre-page-tel: 28px;
  --ec-titre-page-tel-interligne: 1.1;
  --ec-titre-carte: 19px;
  --ec-texte: 15px;
  --ec-meta: 12.5px;
  --ec-meta-interligne: 1.35;
  --ec-mono: 11px;
  --ec-mono-approche: 0.14em;
}

/* ---------- La base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--beurre);
  color: var(--encre);
  font: 400 16px/1.5 var(--font-texte);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--voile-selection); }
:focus-visible { outline: var(--focus); outline-offset: var(--focus-decalage); }

/* ---------- Le cadre des textes ---------- */
.tj {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  /* L'interligne de la page de lecture du SaaS : un texte long se lit plus aéré qu'une liste. */
  font: 400 var(--ec-texte)/1.65 var(--font-texte);
}
.tj-tomate { color: var(--tomate); }
.tj-invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* « Aller au contenu » : caché tant qu'il n'a pas le focus, il se pose alors par-dessus l'en-tête. */
.tj-evitement:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.tj-evitement:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--beurre);
  color: var(--encre);
  box-shadow: var(--ombre-menu);
  font: 600 var(--ec-texte)/1 var(--font-texte);
  text-decoration: none;
}

/* L'en-tête, réduit à la marque, qui mène à la racine. Son contenu suit la colonne de la page. */
.tj-entete {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: var(--beurre);
}
.tj-entete-dedans,
.tj-page,
.tj-pied-dedans {
  width: 100%;
  /* La colonne de lecture, 600 px : moins de 80 signes par ligne en Inter 15 px. */
  max-width: calc(600px + 2 * 32px);
  margin: 0 auto;
  padding-right: 32px;
  padding-left: 32px;
}
.tj-entete-dedans {
  display: flex;
  align-items: center;
  height: 64px;
}
.tj-marque {
  /* Une cible de 44 px de haut, dans l'en-tête qui la centre. */
  padding: 12px 0;
  color: var(--encre);
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-variation-settings: var(--font-display-settings);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.045em;
  text-decoration: none;
  white-space: nowrap;
}

/* La page : la colonne de lecture, qui pousse le pied au bas de l'écran quand le texte est court. */
.tj-page {
  flex: 1 0 auto;
  padding-top: 56px;
  padding-bottom: 80px;
  overflow-wrap: break-word;
}
.tj-titre {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-variation-settings: var(--font-display-settings);
  font-size: var(--ec-titre-page);
  line-height: var(--ec-titre-page-interligne);
  letter-spacing: var(--ec-titre-page-approche);
  text-wrap: balance;
}
.tj-chapeau { margin: 0 0 6px; color: var(--gris); }
.tj-section { margin-top: 40px; }
.tj-section-titre {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-variation-settings: var(--font-display-settings);
  font-size: var(--ec-titre-carte);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
  /* Sous l'en-tête collant, quand un lien y mène. */
  scroll-margin-top: 96px;
}
.tj-page p { margin: 0 0 14px; }
.tj-page strong { font-weight: 600; }
.tj-liste { margin: 0 0 16px; padding-left: 22px; }
.tj-liste li { margin: 0 0 6px; padding-left: 4px; }
.tj-liste li::marker { color: var(--gris); }
.tj-lien {
  color: var(--encre);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.tj-lien:hover { text-decoration-thickness: 2px; }

/* Les tableaux de l'espace client : un cadre crème, ses filets en retrait du bord, en-têtes en
   JetBrains Mono capitales grises. */
.tj-tableau {
  margin: 6px 0 22px;
  padding: 8px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--creme);
}
.tj-tableau table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tj-tableau th {
  padding: 6px 14px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--gris);
  font: 500 var(--ec-mono)/1.4 var(--font-mono);
  letter-spacing: var(--ec-mono-approche);
  text-align: left;
  text-transform: uppercase;
  vertical-align: bottom;
}
.tj-tableau td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font: 400 14.5px/1.5 var(--font-texte);
  vertical-align: top;
}
.tj-tableau tbody tr:first-child td { border-top: 0; }
.tj-tableau tbody tr:last-child td { padding-bottom: 6px; }
.tj-tableau :is(th, td):first-child { padding-left: 0; }
.tj-tableau :is(th, td):last-child { padding-right: 0; }
.tj-tableau td:first-child { font-weight: 500; }
/* Le nom de la colonne d'une case ne se lit que sur téléphone, où la ligne devient une carte. */
.tj-libelle { display: none; }

/* Le pied : l'éditeur et l'adresse du support, puis les textes, le texte en cours nommé sans lien. */
.tj-pied { border-top: 1px solid var(--line); }
.tj-pied-dedans {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  padding-top: 22px;
  padding-bottom: 28px;
  color: var(--gris);
  font: 400 var(--ec-meta)/1.6 var(--font-texte);
}
.tj-pied-editeur { margin: 0; }
.tj-pied-textes ul { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; list-style: none; }
/* Des cibles de 28 px de haut, espacées. */
.tj-pied-lien,
.tj-pied-textes a,
.tj-pied-textes [aria-current] { display: inline-block; padding: 4px 0; }
.tj-pied-lien,
.tj-pied-textes a { color: var(--gris); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tj-pied-lien:hover,
.tj-pied-textes a:hover { color: var(--encre); }
.tj-pied-textes [aria-current] { color: var(--encre); }
/* L'adresse du texte, imprimée seulement. */
.tj-source { display: none; }

/* ---------- Téléphone, sous 900 px, le seuil de l'espace client ---------- */
@media screen and (max-width: 899px) {
  .tj-entete-dedans, .tj-page, .tj-pied-dedans { padding-right: 16px; padding-left: 16px; }
  .tj-entete-dedans { height: 60px; }
  .tj-marque { font-size: 19px; }
  .tj-page { padding-top: 28px; padding-bottom: 56px; }
  .tj-titre { font-size: var(--ec-titre-page-tel); line-height: var(--ec-titre-page-tel-interligne); }
  .tj-section { margin-top: 34px; }
  .tj-pied-dedans { flex-direction: column; gap: 10px; padding-top: 20px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  /* L'éditeur et l'adresse du support ne tiennent pas sur une ligne de téléphone : l'adresse prend la sienne,
     sans laisser « · » en fin de ligne. */
  .tj-pied-separateur { display: none; }
  .tj-pied-editeur .tj-pied-lien { display: block; width: fit-content; }
}

/* ---------- Un tableau trop large pour l'écran : chaque ligne devient une carte ---------- */
@media screen and (max-width: 699px) {
  .tj-tableau table, .tj-tableau tbody, .tj-tableau tr, .tj-tableau td { display: block; }
  .tj-tableau thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .tj-tableau { padding: 14px 16px; }
  .tj-tableau tr { padding: 14px 0; border-top: 1px solid var(--line); }
  .tj-tableau tbody tr:first-child { padding-top: 0; border-top: 0; }
  .tj-tableau tbody tr:last-child { padding-bottom: 0; }
  .tj-tableau td, .tj-tableau tbody tr:is(:first-child, :last-child) td { padding: 0; border: 0; }
  .tj-tableau td + td { margin-top: 10px; }
  .tj-tableau td:first-child { font-weight: 600; }
  .tj-libelle {
    display: block;
    margin-bottom: 2px;
    color: var(--gris);
    font: 500 var(--ec-mono)/1.4 var(--font-mono);
    letter-spacing: var(--ec-mono-approche);
    text-transform: uppercase;
  }
  .tj-tableau td:first-child .tj-libelle { display: none; }
}

/* ---------- L'impression : le texte seul, et l'adresse d'où il vient ---------- */
@media print {
  @page { size: A4; margin: 16mm 18mm; }
  body { background: none; }
  .tj { min-height: 0; font-size: 10pt; line-height: 1.5; }
  .tj-evitement, .tj-entete, .tj-pied-textes { display: none; }
  .tj-page { max-width: none; padding: 0; }
  .tj-titre { font-size: 20pt; }
  .tj-chapeau { margin-bottom: 14pt; }
  .tj-section { margin-top: 16pt; }
  .tj-section-titre { font-size: 12.5pt; break-after: avoid; }
  .tj-page p, .tj-liste li { orphans: 3; widows: 3; }
  .tj-tableau { overflow: visible; border-color: var(--line-strong); border-radius: 0; background: none; }
  .tj-tableau th { border-bottom-color: var(--line-strong); }
  .tj-tableau td { border-top-color: var(--line-strong); font-size: 9.5pt; }
  .tj-tableau tr { break-inside: avoid; }
  .tj-lien { text-decoration: none; }
  .tj-pied { margin-top: 18pt; border-top-color: var(--line-strong); }
  .tj-pied-dedans { display: block; max-width: none; padding: 8pt 0 0; font-size: 8.5pt; }
  .tj-pied-lien { padding: 0; text-decoration: none; }
  .tj-source { display: inline; }
}
