/* static/site.css — le socle COMMUN des pages publiques de tars.ma.

   Une seule feuille pour l'accueil, les six pages produit, /cgu et /confidentialite, les
   guides et les statistiques : même police (Inter, servie depuis /static), mêmes couleurs,
   même barre du haut, même pied de page, mêmes titres et liens. Chaque gabarit garde dans son
   propre <style> ce qui n'appartient qu'à lui. Servie par sv('site.css') (?v=<mtime>), donc
   une modification passe le cache de Cloudflare.

   Barre et pied de page gardent une mise en page de GAUCHE À DROITE dans toutes les langues
   (règle de l'accueil depuis l'origine) ; leurs textes, eux, suivent la langue servie. D'où
   quelques propriétés PHYSIQUES (left, margin-left), voulues et commentées. */

@font-face {
  font-family: 'Inter';
  src: url("fonts/inter-latin.woff2") format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; background: #fff; color: #0d0d0d; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
:root {
  --text: #0d0d0d; --text-muted: #6b6b6b; --text-faint: #a0a0a0;
  --border: rgba(0,0,0,0.08); --border-med: rgba(0,0,0,0.15);
  --bg-surface: #f7f7f7; --bg-dark: #0d0d0d;
}
.container-full { max-width: 1440px; margin: 0 auto; padding: 0 2.5rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 4rem; }

/* ── Passage d'une page à l'autre : un fondu court, sans JavaScript ───────────── */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.18s; animation-timing-function: ease; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
}

/* ── Barre du haut ─────────────────────────────────────────────────────────── */
.site-bar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.94); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); padding: 1rem 0; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-eye { display: block; flex-shrink: 0; height: 36px; width: auto; }
.logo-word { font-size: 24px; font-weight: 300; color: var(--text); letter-spacing: 0.14em; line-height: 1; }
/* Signature empilée sous « TARS », comme dans l'app (tars-ui/src/styles.css, .logo-sub). */
.logo-text { display: flex; flex-direction: column; justify-content: center; }
.logo-sub { margin-top: 5px; font-size: 10px; font-weight: 300; color: var(--text-muted); letter-spacing: 0.02em; line-height: 1; white-space: nowrap; }
/* Les deux boutons : UN objet porte typographie et géométrie (bordure comprise), les deux
   classes de couleur ne font que peindre. Angles à 7px, comme à l'origine. */
.nav-btn { display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; line-height: 1.25; padding: 0.55rem 1.4rem; border: 1px solid transparent; border-radius: 7px; text-decoration: none; transition: background 0.2s, color 0.2s, opacity 0.2s; }
.nav-login { background: var(--text); color: #fff; border-color: var(--text); }
.nav-login:hover { opacity: 0.8; }
.nav-signup { background: #fff; color: var(--text); border-color: var(--text); }
.nav-signup:hover { background: var(--text); color: #fff; }
.nav-actions { display: flex; align-items: center; gap: 0.8rem; }

/* Les sept pages publiques, en liens texte discrets ; la page en cours en noir. */
.topnav { flex: 1; display: flex; justify-content: center; min-width: 0; }
.topnav ul { list-style: none; }
.topnav a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--text); }
.topnav a[aria-current="page"] { font-weight: 500; }
.topnav-links { display: flex; align-items: center; gap: 1.6rem; font-size: 13px; font-weight: 400; white-space: nowrap; }
.topnav-menu { display: none; position: relative; }
.topnav-menu summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-muted); padding: 0.4rem 0.2rem; user-select: none; }
.topnav-menu summary::-webkit-details-marker { display: none; }
.topnav-menu summary:hover, .topnav-menu[open] summary { color: var(--text); }
/* Le panneau s'ouvre sous « Menu », calé à GAUCHE dans toutes les langues (la barre reste de
   gauche à droite) : physique à dessein. */
.topnav-panel { position: absolute; top: calc(100% + 0.6rem); left: 0; right: auto; z-index: 200; min-width: 210px; background: #fff; border: 1px solid var(--border-med); border-radius: 10px; padding: 0.5rem 0; box-shadow: 0 12px 28px -14px rgba(0,0,0,0.18); }
.topnav-panel a { display: block; padding: 0.55rem 1.1rem; font-size: 14px; }
/* En ligne seulement quand les sept liens tiennent avec de l'air (mesuré). En dessous, « Menu »
   juste après le logo. Marges physiques : voir l'en-tête de ce fichier. */
@media (max-width: 1179px) {
  .topnav-links { display: none; }
  .topnav-menu { display: block; }
  .topnav { flex: 0 0 auto; margin-left: 1.6rem; }
  .nav-actions { margin-left: auto; }
}

/* ── Pied de page ──────────────────────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--border); padding: 2rem 0 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding-bottom: 1.5rem; }
.footer-left { font-size: 12px; color: var(--text-faint); }
.footer-links { display: flex; align-items: center; gap: 1.5rem; }
.footer-links a { font-size: 12px; color: var(--text-faint); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text-muted); }
.footer-links .soc { display: inline-flex; align-items: center; }
.footer-right { font-size: 12px; color: var(--text-faint); display: flex; align-items: center; gap: 7px; }
/* Bande Cloudflare : l'asset @3x est rendu à sa taille de CONCEPTION (175 / 3 = 58,33 px) ;
   `height: auto` garde le rapport exact. Aucune retouche de l'image. */
.footer-cloudflare { border-top: 1px solid var(--border); padding: 1.5rem 0 1.25rem; display: flex; flex-direction: column; align-items: center; gap: 0.55rem; }
.cf-badge { display: block; line-height: 0; }
.cf-badge img { width: 58.33px; height: auto; display: block; }
.cf-line { font-size: 12px; color: var(--text-muted); }
.cf-fine { font-size: 10.5px; color: var(--text-faint); }
.footer-copyright { border-top: 1px solid var(--border); padding: 1.25rem 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.footer-carte { width: 15px; height: auto; display: block; }
.footer-copyright span { font-size: 12px; color: var(--text-faint); }

/* ── Pages de lecture (produit, CGU, confidentialité, guides, statistiques) ───── */
/* Une colonne d'environ 70 caractères, une hiérarchie de titres nette, des liens noirs
   soulignés finement, comme sur l'accueil. */
.page { max-width: 46rem; margin: 0 auto; padding: 4rem 1.5rem 5rem; }
.page-kicker { font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; }
.page-kicker a { color: inherit; text-decoration: none; }
.page-kicker a:hover { color: var(--text); }
.page h1 { font-size: 40px; font-weight: 300; line-height: 1.12; letter-spacing: -0.025em; color: var(--text); margin-bottom: 1.1rem; text-wrap: balance; }
.page .lead { font-size: 18px; font-weight: 300; line-height: 1.65; color: var(--text-muted); margin-bottom: 2.5rem; }
.prose h2 { font-size: 23px; font-weight: 400; letter-spacing: -0.015em; line-height: 1.25; color: var(--text); margin: 2.6rem 0 0.8rem; }
.prose h3 { font-size: 15px; font-weight: 500; color: var(--text); margin: 1.8rem 0 0.5rem; }
.prose p { font-size: 16px; font-weight: 300; line-height: 1.75; color: #2b2b2b; margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 0.4rem 0 1.2rem; padding-inline-start: 1.25rem; }
.prose li { font-size: 16px; font-weight: 300; line-height: 1.7; color: #2b2b2b; margin-bottom: 0.45rem; }
.prose li::marker { color: var(--text-faint); }
.prose strong { font-weight: 500; color: var(--text); }
.prose a, .page .lead a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-med); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.prose a:hover, .page .lead a:hover { text-decoration-color: var(--text); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0.6rem 0 1.4rem; font-size: 14px; }
.prose th { text-align: start; background: var(--bg-surface); font-weight: 500; padding: 0.6rem 0.75rem; border: 1px solid var(--border); }
.prose td { padding: 0.6rem 0.75rem; border: 1px solid var(--border); vertical-align: top; line-height: 1.55; font-weight: 300; }
.prose code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }

/* ── Centre d'aide (/aide/<slug> et l'entrée de /faq) ─────────────────────── */
/* Texte lu par les lecteurs d'écran seulement (le « ✓ » d'un tableau dit « Oui »). */
.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; }
.fil-ariane { font-size: 13px; color: var(--text-muted); margin-bottom: 1rem; }
.fil-ariane a { color: var(--text-muted); text-decoration: none; }
.fil-ariane a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.page-maj { font-size: 13px; color: var(--text-faint); margin: -1.6rem 0 2.2rem; }
/* Le tableau défile de côté dans son cadre, jamais la page. La première colonne (les
   critères) reste lisible : largeur minimale, et elle suit le défilement. */
/* `position: relative` : les textes .sr-only des cellules (positionnés en absolu) restent
   DANS le cadre qui défile. Sans lui ils se rattachent à la page et l'élargissent sur
   mobile (mesuré : 682 px de large pour un écran de 390). */
.table-defile { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0.6rem 0 1.2rem; border: 1px solid var(--border); border-radius: 8px; }
.table-defile:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.table-defile table { margin: 0; font-size: 13.5px; }
.table-defile th, .table-defile td { border-width: 0 0 1px; }
.table-defile thead th { text-align: center; vertical-align: bottom; width: 7.5rem; }
.table-defile thead th:first-child { width: auto; }
.table-defile tbody th { text-align: start; font-weight: 400; background: #fff; min-width: 11rem; position: sticky; inset-inline-start: 0; z-index: 1; box-shadow: inset -1px 0 0 var(--border); }
html[dir="rtl"] .table-defile tbody th { box-shadow: inset 1px 0 0 var(--border); }
.table-defile td { text-align: center; font-size: 16px; }
/* Les trois états d'une cellule : définis UNE fois ici. Couleurs sobres, toutes au-dessus
   de 4,5:1 sur blanc (vert 5,0, orange 5,0, rouge 6,5), donc lisibles même petites. */
:root { --etat-oui: #17803d; --etat-partiel: #b45309; --etat-non: #b91c1c; }
.etat { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; }
.etat-oui { color: var(--etat-oui); }
.etat-partiel { color: var(--etat-partiel); }
.etat-non { color: var(--etat-non); }
/* L'en-tête d'un groupe de lignes : discret, sur toute la largeur, pour séparer les trois
   groupes sans crier. */
.table-defile tr.table-groupe th { position: static; text-align: start; background: var(--bg-surface); box-shadow: none; font-size: 11.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 0.55rem 0.75rem; }
html[dir="rtl"] .table-defile tr.table-groupe th { box-shadow: none; letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.table-legende { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 13px; font-weight: 300; color: var(--text-muted); margin: -0.6rem 0 1.4rem; }
.table-legende-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.table-defile tbody:last-child tr:last-child th, .table-defile tbody:last-child tr:last-child td { border-bottom: 0; }
/* PROVISOIRE : deux versions du tableau comparatif, pour que TARS en choisisse une. L'une
   sous l'autre par défaut ; côte à côte dès 1100 px, sur une largeur plus grande que la
   colonne de lecture (centrée sur elle). Chaque tableau garde son propre cadre qui défile :
   `min-width: 0` empêche une colonne de grille de s'élargir à la taille de son tableau. */
.tables-choix { margin: 0.6rem 0 1.6rem; }
.prose .tables-choix-intro { font-size: 14px; color: var(--text-muted); }
.tables-choix-option { min-width: 0; margin-bottom: 1.6rem; }
.prose .tables-choix-etiquette { display: inline-block; font-size: 11.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); border: 1px solid var(--border-med); border-radius: 999px; padding: 0.15rem 0.6rem; margin-bottom: 0.7rem; line-height: 1.5; }
html[dir="rtl"] .prose .tables-choix-etiquette { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.prose .tables-choix-sources { font-size: 13px; color: var(--text-muted); }
.tables-choix-option .table-defile td { font-size: 13px; }
.tables-choix-option .table-defile tbody th, .tables-choix-option .table-defile td { vertical-align: middle; }
@media (min-width: 1100px) {
  .tables-choix { --large: min(1280px, calc(100vw - 4rem)); width: var(--large); margin-inline: calc((100% - var(--large)) / 2); }
  .tables-choix-grille { display: grid; grid-template-columns: 1.25fr 1fr; gap: 2rem; align-items: start; }
  .tables-choix-option { margin-bottom: 0; }
  .tables-choix-option .table-defile thead th { width: 5.5rem; }
  .tables-choix-option .table-defile tbody th { min-width: 9.5rem; }
}
/* Les neuf pages du centre d'aide en cartes, comme « Explorer TARS » sur l'accueil. */
.cartes-aide { margin: 0 0 3rem; }
.cartes-aide h2 { font-size: 23px; font-weight: 400; letter-spacing: -0.015em; margin-bottom: 1.2rem; }
.cartes-aide-grille { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.9rem; }
.carte-aide { display: flex; flex-direction: column; gap: 0.45rem; height: 100%; padding: 1.2rem 1.25rem 1.3rem; border: 1px solid var(--border-med); border-radius: 10px; text-decoration: none; color: var(--text); transition: border-color 0.2s, background 0.2s; }
.carte-aide:hover { border-color: var(--text); background: var(--bg-surface); }
.carte-aide-nom { font-size: 16px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.35; }
.carte-aide-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; font-weight: 300; }
html[dir="rtl"] .cartes-aide h2, html[dir="rtl"] .carte-aide-nom { letter-spacing: 0; }
/* Sous les cartes de /faq : toutes les questions du sujet, groupées par page. */
.questions-aide { margin: 0 0 3rem; }
.questions-aide h2 { font-size: 23px; font-weight: 400; letter-spacing: -0.015em; margin-bottom: 0.4rem; }
.questions-aide h3 { font-size: 15px; font-weight: 500; margin: 1.6rem 0 0.5rem; }
.questions-aide h3 a { color: var(--text); text-decoration: none; }
.questions-aide ul { padding-inline-start: 1.25rem; }
.questions-aide li { font-size: 15px; font-weight: 300; line-height: 1.6; margin-bottom: 0.35rem; }
.questions-aide li::marker { color: var(--text-faint); }
.questions-aide a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-med); text-underline-offset: 3px; }
.questions-aide a:hover { text-decoration-color: var(--text); }
html[dir="rtl"] .questions-aide h2 { letter-spacing: 0; }
.prose h3[id] { scroll-margin-top: 6rem; }
html[dir="rtl"] .page h1, html[dir="rtl"] .prose h2 { letter-spacing: 0; }

/* ── Écrans moyens et petits ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .container, .container-full { padding: 0 1.25rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .page { padding-top: 3rem; }
  .page h1 { font-size: 32px; }
}
@media (max-width: 640px) {
  /* Barre à 390 px : logo, Menu, langues et deux boutons sur UNE ligne en fr, en, ar (mesuré). */
  .logo-sub { display: none; }
  .site-bar { padding: 0.7rem 0; }
  .site-bar .container-full { padding: 0 0.9rem; }
  .nav-actions { gap: 0.4rem; }
  .logo { gap: 6px; }
  .logo-eye { height: 26px; }
  .logo-word { font-size: 19px; letter-spacing: 0.1em; }
  .topnav { flex: 0 0 auto; margin-left: 0.5rem; }
  .topnav-menu summary { font-size: 12.5px; }
  .nav-btn { font-size: 12px; padding: 0.4rem 0.65rem; white-space: nowrap; }
  /* `.site-bar .lang-switch` : le partial lang_toggle porte son propre <style>, inclus après
     cette feuille ; à spécificité égale, son `.lang-switch` l'emporterait. */
  .site-bar .lang-switch { font-size: 12px; gap: 1px; }
  .site-bar .lang-switch .lang-opt { padding: 3px 3px; }
  .footer-inner { align-items: center; text-align: center; }
  .footer-links a { padding: 6px 2px; }
  .page { padding: 2.5rem 1.25rem 4rem; }
  .page h1 { font-size: 29px; }
  .page .lead { font-size: 16.5px; }
}
@media (max-width: 480px) {
  .site-bar .lang-switch .lang-sep { display: none; }
  .site-bar .lang-switch { gap: 4px; }
}
@media (max-width: 400px) {
  .site-bar .container-full { padding: 0 0.75rem; }
  .logo-word { font-size: 16px; letter-spacing: 0.06em; }
  .logo-eye { height: 23px; }
  .topnav { margin-left: 0.45rem; }
  .topnav-menu summary { font-size: 12px; }
  .nav-btn { font-size: 11.5px; padding: 0.38rem 0.5rem; }
  .site-bar .lang-switch { gap: 2px; }
}
/* ── Guides (/guide/<slug>, /guides) ─────────────────────────────────────────── */
/* Sans chapeau, la date suit directement le titre. */
.page h1 + .guide-maj { margin-top: -0.4rem; }
/* « Avec TARS » : ce que TARS fait pour le sujet, après le guide et avant ses sources. */
.avec-tars { margin: 2.8rem 0 2rem; padding: 1.4rem 1.5rem 1.2rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; }
.avec-tars h2 { font-size: 21px; font-weight: 400; letter-spacing: -0.015em; margin-bottom: 0.8rem; }
.avec-tars p { font-size: 15.5px; font-weight: 300; line-height: 1.7; color: #2b2b2b; margin-bottom: 0.7rem; }
.avec-tars-liens { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0.4rem 0 0.6rem; }
.avec-tars a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-med); text-underline-offset: 3px; font-size: 15px; }
.avec-tars a:hover { text-decoration-color: var(--text); }
.avec-tars h3 { font-size: 15px; font-weight: 500; margin: 1.3rem 0 0.4rem; scroll-margin-top: 6rem; }
html[dir="rtl"] .avec-tars h2 { letter-spacing: 0; }
.guide-note { margin-top: 2.6rem; padding: 1rem 1.2rem; border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; font-weight: 300; line-height: 1.65; color: var(--text-muted); }
.guide-note a { color: var(--text); }
.guides-cat { margin-bottom: 2.4rem; }
.guides-vide { color: var(--text-muted); font-size: 15px; font-weight: 300; }
