/* Feuille de style des pages de contenu statiques (guides).
 *
 * Ces pages ne passent PAS par React ni par vite : elles sont assemblées par
 * saas/bin/build_pages.py et servies telles quelles, pour rester lisibles par
 * tout robot sans exécuter une ligne de JavaScript. Cette feuille est donc du
 * CSS ordinaire, à un chemin STABLE (pas d'empreinte de build) — ne pas la
 * renommer sans regénérer les pages.
 *
 * Les couleurs et le vocabulaire visuel reprennent ceux de la page d'accueil
 * (saas/frontend/src/styles/index.css, bloc .lp) pour que les guides ne
 * ressemblent pas à un autre site.
 */

:root {
  --black: #0a0a0a;
  --anthracite: #171717;
  --grey: #737373;
  --line: #e5e5e5;
  --wash: #f5f5f5;
  --white: #ffffff;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
          "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.shell { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }

/* ---------------------------------------------------------------- en-tête */
.pg-header {
  position: sticky; top: 0; z-index: 20;
  background: rgb(255 255 255 / 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.pg-header .shell { display: flex; align-items: center; gap: 0.75rem; padding-top: 0.9rem; padding-bottom: 0.9rem; }
.pg-brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }
.pg-brand img { width: 2rem; height: 2rem; display: block; }
.pg-brand span { font-size: 0.875rem; font-weight: 600; letter-spacing: -0.01em; }
.pg-nav { margin-left: auto; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.pg-nav a {
  color: var(--grey); text-decoration: none; font-size: 0.875rem;
  padding: 0.4rem 0.6rem; border-radius: 0.5rem; transition: color .2s, background .2s;
}
.pg-nav a:hover { color: var(--black); background: var(--wash); }
.pg-nav a.cta {
  background: var(--black); color: var(--white); font-weight: 500; padding: 0.5rem 0.9rem;
}
.pg-nav a.cta:hover { background: var(--anthracite); }

/* Sélecteur de langue — même vocabulaire visuel que celui de la SPA
   (LangSwitch.tsx) : deux cases jointes, la courante en noir plein. */
.pg-lang {
  display: inline-flex; align-items: stretch; overflow: hidden;
  border: 1px solid var(--line); border-radius: 0.5rem; margin-left: 0.25rem;
}
.pg-lang > * {
  padding: 0.3rem 0.5rem; font-size: 0.6875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.5;
  text-decoration: none; transition: background .2s, color .2s;
}
.pg-lang .on { background: var(--black); color: var(--white); }
.pg-lang a { background: var(--white); color: var(--grey); border-radius: 0; }
.pg-lang a:hover { background: var(--wash); color: var(--black); }
@media (max-width: 720px) { .pg-brand span { display: none; } }
/* Sous 640 px, mesuré : logo 32 + « Démonstrations » 117 + langue 41 + appel à
   l'action 133 + marges 48 = 394 px pour 390 disponibles. La barre passait sur
   deux lignes et faisait 110 px de haut, en position collante. Ne restent donc
   que l'essentiel : le logo (qui mène à l'accueil), la langue, et l'action. */
@media (max-width: 640px) {
  .pg-nav a.secondary { display: none; }
  /* Faute de place, on ne garde que l'AUTRE langue : afficher la langue
     courante serait redondant avec la page qu'on est en train de lire. */
  .pg-lang { border: 0; margin-left: 0; }
  .pg-lang .on { display: none; }
  .pg-lang a { border: 1px solid var(--line); border-radius: 0.5rem; }
}

/* -------------------------------------------------------------- contenu */
.pg-main { padding: 2.5rem 0 4rem; }
@media (min-width: 768px) { .pg-main { padding: 3.5rem 0 5rem; } }

.pg-crumb { font-size: 0.8125rem; color: var(--grey); margin: 0 0 1.5rem; }
.pg-crumb a { color: var(--grey); }
.pg-crumb span { margin: 0 0.4rem; }

/* La colonne de lecture est bornée : au-delà de ~70 caractères par ligne
   l'œil perd la ligne suivante. Les tableaux, eux, prennent toute la largeur. */
.prose { max-width: 44rem; }

h1 {
  font-size: clamp(1.85rem, 1.2rem + 2.2vw, 2.9rem);
  line-height: 1.12; letter-spacing: -0.025em; font-weight: 600; margin: 0;
}
h2 {
  font-size: clamp(1.3rem, 1.05rem + 0.9vw, 1.75rem);
  line-height: 1.25; letter-spacing: -0.02em; font-weight: 600;
  margin: 3rem 0 0.75rem; scroll-margin-top: 5rem;
}
h3 {
  font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em;
  margin: 2rem 0 0.4rem; scroll-margin-top: 5rem;
}
p { margin: 0 0 1rem; }
.lead { font-size: 1.125rem; line-height: 1.6; color: var(--anthracite); margin: 1.25rem 0 0; }
.updated { font-size: 0.8125rem; color: var(--grey); margin-top: 1rem; }
a { color: var(--black); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 600; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin: 0.35rem 0; }
li > ul, li > ol { margin-top: 0.35rem; }
/* Glossaire : le terme porte le poids, la définition respire en dessous.
   <dt>/<dd> plutôt que des titres, parce que c'est la structure exacte de la
   chose — et parce que le générateur en tire les DefinedTerm du JSON-LD. */
dl { margin: 1.5rem 0 0; }
dt {
  font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em;
  margin-top: 1.75rem; scroll-margin-top: 5rem;
}
dt:first-child { margin-top: 0; }
dd { margin: 0.4rem 0 0; padding-left: 1rem; border-left: 2px solid var(--line); }

kbd {
  font-family: inherit; font-size: 0.8125em; background: var(--white);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 0.3rem;
  padding: 0.05em 0.4em; white-space: nowrap;
}
sup { font-size: 0.7em; vertical-align: super; line-height: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em; background: var(--wash); border: 1px solid var(--line);
  border-radius: 0.35rem; padding: 0.08em 0.35em;
}
pre {
  background: var(--wash); border: 1px solid var(--line); border-radius: 0.75rem;
  padding: 1rem; overflow-x: auto; font-size: 0.8125rem; line-height: 1.6;
}
pre code { background: none; border: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

/* Encadré : ce qu'il faut retenir, ou l'avertissement qu'on ne veut pas rater */
.note {
  border: 1px solid var(--line); border-left: 3px solid var(--black);
  border-radius: 0 0.75rem 0.75rem 0; background: var(--wash);
  padding: 1rem 1.25rem; margin: 1.75rem 0;
}
.note p:last-child { margin-bottom: 0; }
.note-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--grey); margin-bottom: 0.4rem; }

/* --------------------------------------------------------------- tableaux */
.table-wrap { overflow-x: auto; margin: 1.75rem 0; border: 1px solid var(--line); border-radius: 0.9rem; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.9375rem; }
thead th {
  text-align: left; font-weight: 600; font-size: 0.8125rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey);
  padding: 0.85rem 1rem; background: var(--wash); border-bottom: 1px solid var(--line);
  vertical-align: bottom;
}
tbody th { text-align: left; font-weight: 600; }
td, tbody th { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.55; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* -------------------------------------------------------------------- FAQ */
.qa { border-top: 1px solid var(--line); padding-top: 1.25rem; margin-top: 1.25rem; }
.qa:first-of-type { border-top: 0; }
.qa h3 { margin-top: 0; }
.qa p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- démos/CTA */
.demo-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0 1.75rem; }
.demo-links a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1px solid var(--line); border-radius: 0.6rem; background: var(--white);
  padding: 0.45rem 0.8rem; font-size: 0.875rem; text-decoration: none; color: var(--black);
  transition: background .2s, border-color .2s;
}
.demo-links a:hover { background: var(--wash); border-color: var(--grey); }

/* ------------------------------------------------ vignettes des exemples */
/* Deux colonnes dès qu'il y a la place : les quatre formats d'un bien se
   comparent à l'œil, ce qui est tout l'intérêt de la page. */
.demo-grid { display: grid; gap: 1.25rem; margin: 2rem 0; }
@media (min-width: 760px) { .demo-grid { grid-template-columns: 1fr 1fr; } }

.demo { margin: 0; }
.demo-frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 0.9rem; border: 1px solid var(--line); background: var(--wash);
}
.demo-frame img, .demo-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block;
}
.demo-frame img { object-fit: cover; }

/* Le bouton EST le lien : sans JavaScript il mène à la visite, avec il
   l'ouvre sur place. Voir assets/demo.js. */
a.demo-play {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.85rem;
  text-decoration: none; color: var(--white); font-size: 0.9375rem; font-weight: 500;
  text-shadow: 0 1px 3px rgb(10 10 10 / 0.5);
  background: linear-gradient(180deg, rgb(10 10 10 / 0.10), rgb(10 10 10 / 0.45));
  transition: background .25s;
}
.demo-play-icon {
  position: relative; width: 3.25rem; height: 3.25rem; border-radius: 50%;
  background: rgb(255 255 255 / 0.94); box-shadow: 0 4px 16px rgb(10 10 10 / 0.35);
  transition: transform .25s;
}
.demo-play-icon::after {          /* le triangle, centré optiquement */
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 0; height: 0; border-left: 0.85rem solid var(--black);
  border-top: 0.55rem solid transparent; border-bottom: 0.55rem solid transparent;
  transform: translate(-40%, -50%);
}
a.demo-play:hover { background: linear-gradient(180deg, rgb(10 10 10 / 0.05), rgb(10 10 10 / 0.55)); }
a.demo-play:hover .demo-play-icon { transform: scale(1.07); }

.demo figcaption {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.75rem;
  margin-top: 0.7rem;
}
.demo-fmt { font-size: 0.9375rem; font-weight: 600; }
.demo-num { font-size: 0.8125rem; color: var(--grey); font-variant-numeric: tabular-nums; }
/* Un décompte incomplet se voit : c'est l'information de la page, pas un
   détail à noyer dans le gris. */
.demo-num.partial { color: var(--black); font-weight: 500; }

.cta-box {
  margin: 3rem 0 0; padding: 1.75rem; border: 1px solid var(--line);
  border-radius: 1rem; background: var(--wash);
}
.cta-box h2 { margin-top: 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0.75rem; padding: 0.7rem 1.25rem; font-size: 0.9375rem;
  font-weight: 500; text-decoration: none; transition: background .2s;
}
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: var(--anthracite); }
.btn-light { background: var(--white); color: var(--black); border: 1px solid var(--line); }
.btn-light:hover { background: var(--wash); }

/* --------------------------------------------------------------- voir aussi */
.also { margin-top: 3.5rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.also h2 { margin-top: 0; font-size: 1.0625rem; }
.also ul { list-style: none; padding: 0; display: grid; gap: 0.75rem; margin-top: 1.25rem; }
@media (min-width: 640px) { .also ul { grid-template-columns: 1fr 1fr; } }
.also li { margin: 0; }
.also a {
  display: block; border: 1px solid var(--line); border-radius: 0.9rem;
  padding: 1rem 1.15rem; text-decoration: none; color: inherit; background: var(--white);
  transition: box-shadow .25s, border-color .25s;
}
.also a:hover { border-color: var(--grey); box-shadow: 0 2px 6px rgb(10 10 10 / .06); }
.also strong { display: block; font-size: 0.9375rem; }
.also em { display: block; font-style: normal; font-size: 0.8125rem; color: var(--grey); margin-top: 0.25rem; }

/* ------------------------------------------------------------------ pied */
.pg-footer { background: var(--black); color: var(--white); margin-top: 4rem; }
.pg-footer .shell { padding-top: 3rem; padding-bottom: 3rem; text-align: center; }
.pg-footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: center; font-size: 0.875rem; }
/* Les guides d'abord, le légal ensuite et séparé : deux rangs de nature
   différente sur une seule ligne se lisent comme une bouillie de liens. */
.pg-footer-head {
  font-size: 0.75rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.14em; color: #737373; margin-bottom: 1rem;
}
.pg-footer-legal {
  margin-top: 2.5rem; padding-top: 2rem;
  border-top: 1px solid rgb(255 255 255 / 0.12);
}
.pg-footer a { color: #a1a1aa; text-decoration: none; transition: color .2s; }
.pg-footer a:hover { color: var(--white); }
.pg-footer .brand { color: var(--white); font-weight: 500; }
.pg-footer .vat { font-size: 0.75rem; color: #737373; margin-top: 1.25rem; }

/* Légende de tableau lisible par un lecteur d'écran, invisible à l'œil : le
   tableau a déjà son titre juste au-dessus, le répéter serait du bruit visuel. */
.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;
}

:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; border-radius: 3px; }
.pg-footer :focus-visible { outline-color: var(--white); }
