/*
 * Pages légales (mentions légales, confidentialité, CGV).
 *
 * Pages statiques servies telles quelles depuis public/ : elles ne passent
 * ni par React ni par Tailwind. Elles reprennent donc à la main la direction
 * de la landing (src/styles/landing.css) : bandeau vert très foncé en tête,
 * corps sur crème, Bricolage Grotesque pour les titres, Geist pour le texte,
 * filets à 1px. Les couleurs sont celles de l'échelle `moss` / `bone` de
 * tailwind.config.js ; les garder alignées si la palette évolue.
 */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist-semibold.ttf') format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --lg-green: #3e5043;       /* moss-600 */
  --lg-green-deep: #24312a;  /* moss-900 : titres sur crème */
  --lg-green-dark: #1a241e;  /* moss-950 : fonds sombres */
  --lg-text: #4a5b4e;        /* moss-500 : texte courant, lecture longue */
  --lg-muted: #5f7365;       /* moss-300 */
  --lg-bone: #f2efe9;        /* bone-100 */
  --lg-bone-400: #c0baae;
  --lg-bone-500: #aaa397;
  --lg-paper: #fffdf9;
  --lg-line: #ded8ce;
  --lg-sage: #7da07e;
  --lg-ease: cubic-bezier(.16, 1, .3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--lg-bone);
  color: var(--lg-text);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  /* Pied de page collé en bas quand le document est court. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

::selection { background: rgb(125 160 126 / 30%); color: var(--lg-green-deep); }

a:focus-visible {
  outline: 2px solid rgb(125 160 126 / 80%);
  outline-offset: 3px;
  border-radius: 4px;
}

.lg-wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 640px) { .lg-wrap { padding: 0 32px; } }

.lg-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* ---- Bandeau de tête --------------------------------------------- */
.lg-hero {
  position: relative;
  isolation: isolate;
  background: var(--lg-green-dark);
  color: var(--lg-bone);
}
.lg-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(26 36 30 / 94%), rgb(26 36 30 / 98%)),
    url('/photos/dining.webp') center / cover;
}

.lg-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 80px;
}

.lg-logo { display: block; height: 30px; width: auto; color: var(--lg-bone); }
@media (min-width: 768px) { .lg-logo { height: 36px; } }

.lg-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13.5px;
  color: var(--lg-bone-400);
  text-decoration: none;
  transition: color .2s ease;
}
.lg-back:hover { color: var(--lg-bone); }
.lg-back svg { width: 14px; height: 14px; transform: rotate(180deg); }

.lg-intro { padding-top: 48px; padding-bottom: 0; }
@media (min-width: 1024px) { .lg-intro { padding-top: 72px; } }
.lg-intro .lg-eyebrow { color: var(--lg-bone-500); }

.lg-title {
  margin: 20px 0 0;
  max-width: 14em;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: clamp(2.3rem, 5.2vw, 3.6rem);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -.038em;
  color: var(--lg-bone);
  text-wrap: balance;
}

.lg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--lg-bone-500);
}
.lg-meta strong { font-weight: 400; color: var(--lg-bone-400); }

/* Onglets entre les trois documents : posés sur la jonction sombre/crème. */
.lg-tabs {
  display: flex;
  gap: 4px;
  margin-top: 44px;
  overflow-x: auto;
  scrollbar-width: none;
}
.lg-tabs::-webkit-scrollbar { display: none; }
.lg-tabs a {
  flex-shrink: 0;
  padding: 13px 18px;
  border-radius: 14px 14px 0 0;
  font-size: 14px;
  color: var(--lg-bone-400);
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}
.lg-tabs a:hover { color: var(--lg-bone); background: rgb(234 238 230 / 5%); }
.lg-tabs a[aria-current='page'] { background: var(--lg-bone); color: var(--lg-green-deep); font-weight: 600; }

/* ---- Corps -------------------------------------------------------- */
.lg-body {
  flex: 1 0 auto;
  display: grid;
  gap: 48px;
  padding-top: 40px;
  padding-bottom: 96px;
}
@media (min-width: 1024px) {
  .lg-body {
    grid-template-columns: 220px minmax(0, 780px);
    justify-content: center;
    gap: 64px;
    padding-top: 56px;
  }
  /* Même place sur chaque page, sommaire affiché ou non (page trop courte). */
  .lg-doc { grid-column: 2; }
}

/* Sommaire : construit par legal.js à partir des <h2>. Sans JavaScript il
   reste masqué et la page se lit comme un document simple. */
.lg-toc { display: none; }
@media (min-width: 1024px) {
  .lg-toc.is-ready { display: block; }
  .lg-toc-inner { position: sticky; top: 32px; max-height: calc(100vh - 64px); overflow-y: auto; }
}
.lg-toc .lg-eyebrow { color: var(--lg-muted); }
.lg-toc ol {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--lg-line);
}
.lg-toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 16px;
  border-left: 1px solid transparent;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--lg-muted);
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease;
}
.lg-toc a:hover { color: var(--lg-green-deep); }
.lg-toc a.is-active { color: var(--lg-green-deep); border-left-color: var(--lg-green); }

/* Le document : une feuille de papier, comme le formulaire de /demo. */
.lg-doc {
  min-width: 0;
  padding: 32px 22px 40px;
  border-radius: 22px;
  background: var(--lg-paper);
  box-shadow:
    0 0 0 1px rgb(36 49 42 / 6%),
    0 1px 2px rgb(36 49 42 / 4%),
    0 12px 32px -20px rgb(36 49 42 / 18%);
  animation: lgRise .85s cubic-bezier(.22, 1, .36, 1) both;
}
@media (min-width: 640px) { .lg-doc { padding: 48px 48px 56px; } }
@media (min-width: 1024px) { .lg-doc { padding: 56px 64px 64px; } }

@keyframes lgRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.lg-doc > :first-child { margin-top: 0; }
.lg-doc > :last-child { margin-bottom: 0; }

.lg-doc h2 {
  margin: 48px 0 14px;
  padding-top: 40px;
  border-top: 1px solid var(--lg-line);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.03em;
  color: var(--lg-green-deep);
  text-wrap: balance;
}
.lg-doc > h2:first-child { padding-top: 0; border-top: 0; }

.lg-doc h3 {
  margin: 28px 0 8px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--lg-green-deep);
}
.lg-doc h3 em { font-style: normal; }

.lg-doc p { margin: 12px 0; text-wrap: pretty; }
.lg-doc strong { font-weight: 600; color: var(--lg-green-deep); }

.lg-doc ul { margin: 12px 0; padding-left: 0; list-style: none; }
.lg-doc li { position: relative; margin: 8px 0; padding-left: 22px; }
.lg-doc li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: .72em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--lg-sage);
}

.lg-doc a {
  color: var(--lg-green-deep);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgb(125 160 126 / 60%);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color .2s ease;
  overflow-wrap: anywhere;
}
.lg-doc a:hover { text-decoration-color: var(--lg-green-deep); }

.lg-doc code {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--lg-bone);
  font-family: inherit;
  font-size: .92em;
  color: var(--lg-green-deep);
}

.lg-doc hr { margin: 48px 0 24px; border: 0; border-top: 1px solid var(--lg-line); }
.lg-doc .lg-note { font-size: 13.5px; color: var(--lg-muted); }

/* Tableaux : défilent horizontalement dans leur cadre sur petit écran. */
.lg-table {
  margin: 20px 0 24px;
  overflow-x: auto;
  border: 1px solid var(--lg-line);
  border-radius: 14px;
}
.lg-table table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.55;
}
.lg-table th,
.lg-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--lg-line);
}
.lg-table tbody tr:last-child td { border-bottom: 0; }
.lg-table th {
  background: var(--lg-bone);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lg-muted);
  white-space: nowrap;
}

/* ---- Pied de page (repris de src/landing/sections/Footer.tsx) ----- */
.lg-footer {
  padding: 48px 0 32px;
  border-top: 1px solid rgb(242 239 233 / 10%);
  background: var(--lg-green-dark);
}
.lg-footer a { text-decoration: none; transition: color .2s ease; }

.lg-footer-grid { display: grid; gap: 48px; }
@media (min-width: 1024px) { .lg-footer-grid { grid-template-columns: 1.2fr 2fr; } }

.lg-footer-logo { display: block; height: 40px; width: auto; color: var(--lg-bone); }
@media (min-width: 768px) { .lg-footer-logo { height: 48px; } }

.lg-footer-pitch {
  max-width: 20rem;
  margin: 20px 0 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--lg-bone-500);
}

.lg-footer-mail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  font-size: 13.5px;
  color: var(--lg-bone-400);
}
.lg-footer-mail svg { width: 16px; height: 16px; }
.lg-footer-mail:hover { color: var(--lg-bone); }

.lg-footer-cols { display: grid; gap: 40px; }
@media (min-width: 640px) { .lg-footer-cols { grid-template-columns: repeat(3, 1fr); } }
.lg-footer-cols .lg-eyebrow { color: var(--lg-bone-500); }
.lg-footer-cols ul { margin: 20px 0 0; padding: 0; list-style: none; }
.lg-footer-cols li + li { margin-top: 12px; }
.lg-footer-cols a { font-size: 13.5px; color: var(--lg-bone-400); }
.lg-footer-cols a:hover,
.lg-footer-cols a[aria-current='page'] { color: var(--lg-bone); }

.lg-footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgb(242 239 233 / 8%);
  font-size: 12.5px;
  color: var(--lg-bone-500);
}
@media (min-width: 640px) { .lg-footer-bottom { flex-direction: row; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lg-doc { animation: none; }
}

/* ---- Impression : le document seul, en noir sur blanc. ------------ */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .lg-hero { background: none; color: #000; }
  .lg-hero::before,
  .lg-bar,
  .lg-tabs,
  .lg-toc,
  .lg-footer { display: none !important; }
  .lg-intro { padding-top: 0; }
  .lg-title,
  .lg-meta,
  .lg-meta strong,
  .lg-doc h2,
  .lg-doc h3,
  .lg-doc strong,
  .lg-doc a { color: #000; }
  .lg-body { display: block; padding: 16px 0 0; }
  .lg-doc { padding: 0; box-shadow: none; animation: none; }
  .lg-doc h2 { break-after: avoid; }
  .lg-table { overflow: visible; }
  .lg-table table { min-width: 0; }
}
