/* =============================================================================
   Losange Éditions — maintenance / reconstruction — base commune aux 4 thèmes
   build.py concatène base.css + themes/<theme>/theme.css → <marque>/style.css
   Zéro JS, zéro CDN, aucun style inline (CSP stricte), WCAG AA.
   ========================================================================== */
:root {
  --brand-primary: #1f2a44;
  --brand-primary-dark: #141c30;
  --brand-accent: #c9a24b;
  --brand-bg: #f4f2ec;
  --brand-surface: #ffffff;
  --brand-text: #1c1c1c;
  --brand-muted: #5a5f6b;
  --brand-line: rgba(0, 0, 0, 0.1);
  --brand-radius: 18px;
  --logo-h: 56px;
  --heading-weight: 700;
  --font-heading: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --progress: 65%;
  --page-pattern: none;
  --hero-focus: 50% 50%;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--brand-text);
  background: var(--brand-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 3px; border-radius: 4px; }
address { font-style: normal; }
h1, h2 { font-family: var(--font-heading); font-weight: var(--heading-weight); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.8rem); line-height: 1.02; letter-spacing: -0.015em; }
h1 em { font-style: italic; color: var(--brand-primary); }
h2 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.75rem; }
.wrap { width: 100%; max-width: 78rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem); }
.logo { height: var(--logo-h); width: auto; }
.brand { display: inline-block; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin: 0 0 1rem;
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brand-primary);
}
.eyebrow .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--brand-accent); animation: pulse 2.4s ease-out infinite; }
.lead { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--brand-muted); max-width: 40rem; margin: 1rem 0 0; text-wrap: pretty; }

/* ---- Avancement ---- */
.progress {
  position: relative;
  display: flex; align-items: center; gap: 0.9rem;
  margin: 1.75rem 0 1.25rem;
}
.progress .bar { flex: 1; height: 10px; border-radius: 999px; background: var(--brand-line); overflow: hidden; position: relative; }
.progress .bar::after {
  content: ""; position: absolute; inset: 0; width: var(--progress); border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}
.progress .pct { font-family: var(--font-heading); font-weight: var(--heading-weight); font-size: 1.1rem; min-width: 3.2rem; text-align: right; }

/* ---- Étapes ---- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.steps li { display: grid; grid-template-columns: 2rem 1fr; gap: 0.8rem; align-items: center; color: var(--brand-muted); }
.steps .n {
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--brand-line);
  font-size: 0.8rem; font-weight: 700; color: var(--brand-muted);
}
.steps strong { display: block; color: var(--brand-text); font-weight: 600; line-height: 1.25; }
.steps small { font-size: 0.8125rem; }
.steps .done .n { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.steps .done strong { color: var(--brand-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.steps .now .n { border-color: var(--brand-accent); color: var(--brand-primary); box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-accent) 60%, transparent); animation: pulse 2.4s ease-out infinite; }
.steps .now strong { color: var(--brand-primary); }

/* ---- Contact ---- */
.contact { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; }
.contact li { display: inline-flex; align-items: center; gap: 0.5rem; }
.contact svg { width: 1.1rem; height: 1.1rem; color: var(--brand-muted); flex: none; }
.contact a { font-weight: 600; }
.note { display: flex; gap: 0.5rem; align-items: flex-start; margin: 1rem 0 0; font-size: 0.9375rem; color: var(--brand-muted); }
.note svg { width: 1.1rem; height: 1.1rem; flex: none; margin-top: 0.2rem; }

/* ---- Couvertures ---- */
.covers { margin-top: clamp(2rem, 4vw, 3rem); }
.covers p { margin: 0 0 1rem; color: var(--brand-muted); }
.covers ul { list-style: none; margin: 0; padding: 0.25rem 0 1rem; display: flex; gap: clamp(0.75rem, 2vw, 1.5rem); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.covers li { flex: 0 0 auto; width: clamp(110px, 14vw, 180px); scroll-snap-align: start; }
.covers figure { margin: 0; }
.covers img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 14px 30px -14px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.06); transition: transform .25s ease; }
.covers li:hover img { transform: translateY(-4px); }
.covers figcaption { font-size: 0.8125rem; color: var(--brand-muted); margin-top: 0.5rem; line-height: 1.35; }

/* ---- Bandeau défilant ---- */
.marquee { overflow: hidden; white-space: nowrap; }
.marquee .track { display: inline-flex; gap: 2rem; padding: 0.6rem 0; animation: marquee 28s linear infinite; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.marquee span { padding-right: 0; }

/* ---- Pied ---- */
.site-footer { font-size: 0.8125rem; padding: 1rem 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.5rem; }
.site-footer p, .site-footer address { margin: 0; }

/* ---- Animations ---- */
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-accent) 55%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes shimmer { from { background-position: 0 0; } to { background-position: 200% 0; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6%, -8%) scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .eyebrow .dot, .steps .now .n, .progress .bar::after, .marquee .track, .blob { animation: none !important; }
  .covers img { transition: none; }
}

/* ===== Thème SPLIT — zoning « carte centrée » : visuel à gauche, panneau blanc à droite,
   bande « univers » en pied de carte. Habillage = palette / typo des futurs sites. ===== */
.theme-split { background: var(--brand-bg); }
/* Desktop : le site n'est pas « posé » sur un fond — il commence au visuel et finit au bloc revendeurs, pleine largeur */
.theme-split { position: relative; }
.theme-split .stage { display: block; padding: 0; }
.theme-split .card {
  width: 100%; min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--brand-surface);
}
.theme-split .visual { margin: 0; position: relative; min-height: 34rem; background: var(--brand-visual-bg); }
.theme-split .visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--hero-focus); }
.theme-split .panel {
  --panel-px: clamp(2rem, 6vw, 6rem);
  padding: clamp(1.25rem, 2.5vw, 1.75rem) var(--panel-px) 1.75rem;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
/* Surheader : réseaux sociaux + recrutement, en haut du panneau */
.theme-split .surheader { width: calc(100% + 2 * var(--panel-px)); margin: -0.25rem calc(-1 * var(--panel-px)) 1.5rem; padding: 0 1.25rem; display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; }
.theme-split .surheader a { display: inline-flex; align-items: center; color: var(--brand-muted); text-decoration: none; }
.theme-split .surheader svg { width: 1.2rem; height: 1.2rem; color: var(--brand-primary); transition: color .2s ease; }
.theme-split .surheader a:hover svg { color: var(--brand-secondary-text, var(--brand-primary-dark)); }
.theme-split .follow-jobs { font-weight: 600; letter-spacing: 0.01em; }
/* Bloc central (centré verticalement dans l'espace restant) */
.theme-split .panel-main { margin: auto 0; display: flex; flex-direction: column; align-items: center; padding: 1rem 0; }
.theme-split .brand { margin-bottom: 0.6rem; }
.theme-split h1 { margin: 1.6rem 0 0; font-size: calc(clamp(1.7rem, 2.5vw, 2.15rem) + var(--heading-boost, 0px)); line-height: calc(1.2 * var(--heading-lh, 1)); letter-spacing: -0.005em; font-weight: var(--heading-weight); color: var(--brand-text); max-width: none; }
.theme-split h1 em { font-style: italic; font-weight: var(--heading-weight); color: var(--brand-secondary-text, var(--brand-primary)); }
.theme-split .sep { width: 3rem; height: 0; border: 0; border-top: 2px solid var(--brand-secondary-text, var(--brand-primary)); margin: 1.5rem 0 1.4rem; }
.theme-split .about { margin: 0 auto; max-width: 30rem; font-size: 1rem; font-weight: 400; line-height: 1.65; color: var(--brand-muted); text-wrap: pretty; }
.theme-split .lead { margin: 0 auto; max-width: 30rem; font-family: var(--font-heading); font-style: italic; font-weight: 400; font-size: calc(1.325rem + var(--heading-boost, 0px)); line-height: calc(1.5 * var(--heading-lh, 1)); color: var(--brand-text); }
.theme-split .lead-hl { color: var(--brand-secondary-text, var(--brand-primary)); }
/* Pied de panneau : contact + adresse, calés en bas */
.theme-split .panel-foot { margin-top: auto; padding-top: 2rem; display: flex; flex-direction: column; align-items: center; }
/* Adresse : une ligne centrée en desktop (le <br> est masqué), deux lignes à gauche en mobile */
/* Liens légaux : desktop = dans le coin bas droit, avant la mention groupe */
.theme-split .legal { display: flex; gap: 0.9rem; }
.theme-split .legal a { color: inherit; text-decoration: none; }
.theme-split .legal a:hover { text-decoration: underline; text-underline-offset: 2px; }
.theme-split .contact-label { margin: 0 0 0.75rem; font-size: 0.9375rem; font-weight: 500; color: var(--brand-text); }
.theme-split .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 0; }
.theme-split .btn {
  display: inline-flex; align-items: center; padding: 0.7rem 1.25rem;
  border-radius: var(--btn-radius, 4px); border: 1.5px solid var(--btn, var(--brand-primary));
  background: #fff; color: var(--btn, var(--brand-primary)); text-decoration: none;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.2;
  transition: background .2s ease, color .2s ease;
}
.theme-split .btn:hover { background: var(--btn, var(--brand-primary)); color: #fff; }
.theme-split address { margin-top: 1.1rem; font-size: 0.75rem; font-weight: 400; color: var(--brand-muted); letter-spacing: 0.01em; }

/* Bandeau commercial en pied de carte — proportions de la bande « univers » des maquettes.
   Colonne 1/4 : consultation du catalogue · 3/4 : enseignes en capitales (typo des thématiques) + « bonnes librairies » */
.theme-split .gateway {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); align-items: stretch;
  background: var(--gateway, var(--band, var(--brand-secondary)));
  color: var(--gateway-text, #fff);
}
.theme-split .gateway-catalog {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 1rem;
  padding: clamp(1.75rem, 3.2vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
  background: var(--gateway-col, transparent); color: var(--gateway, var(--brand-primary));
  border-right: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  text-decoration: none; transition: color .2s ease;
}
.theme-split .gateway-catalog:hover { color: var(--gateway-col-text, var(--brand-secondary-text)); }
.theme-split .gateway-catalog-label { font-family: var(--font-heading); font-weight: var(--catalog-weight, 400); font-size: calc(clamp(1.15rem, 1.7vw, 1.4rem) + var(--heading-boost, 0px) + var(--catalog-boost, 0px)); line-height: calc(1.2 * var(--heading-lh, 1)); }
.theme-split .gateway-arrow { display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; transition: transform .2s ease; }
.theme-split .gateway-arrow svg { width: 2.6rem; height: 2.6rem; color: currentColor; }
.theme-split .gateway-catalog:hover .gateway-arrow { transform: translateX(3px); }
.theme-split .gateway-shops { padding: clamp(1.75rem, 3.2vw, 2.5rem) clamp(5rem, 9vw, 8rem) clamp(1.75rem, 3.2vw, 2.5rem) clamp(1.5rem, 4vw, 3rem); display: flex; flex-direction: column; justify-content: center; }
.theme-split .gateway h2 { margin: 0; font-size: 1.0625rem; font-family: var(--font-body); font-weight: 500; line-height: 1.4; letter-spacing: 0; text-transform: none; color: inherit; text-wrap: pretty; }
.theme-split .retailers {
  list-style: none; margin: 0.6rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem clamp(1rem, 2vw, 1.6rem);
}
.theme-split .retailers a {
  color: inherit; text-decoration: none;
  font-family: var(--font-universes, var(--font-heading)); font-weight: var(--universes-weight, 500);
  font-size: clamp(1.175rem, 1.6vw, 1.475rem); letter-spacing: 0.02em; text-transform: var(--universes-case, uppercase); line-height: 1.25;
  border-bottom: 2px solid transparent; transition: border-color .2s ease;
}
.theme-split .retailers a:hover { border-bottom-color: currentColor; }
.theme-split .retailers-more { font-family: var(--font-heading); font-style: italic; font-size: calc(1.1375rem + var(--heading-boost, 0px)); line-height: calc(1.5 * var(--heading-lh, 1)); }
.theme-split .gateway-more { margin: 0.6rem 0 0; font-family: var(--font-heading); font-style: italic; font-size: calc(1.0625rem + var(--heading-boost, 0px)); line-height: calc(1.48 * var(--heading-lh, 1)); }
.theme-split .gateway-more a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.theme-split .gateway-more a:hover { text-decoration-thickness: 2px; }
.theme-split .gateway a:focus-visible { outline-color: currentColor; }

/* Couvertures dans la carte */
.theme-split .covers { grid-column: 1 / -1; padding: clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 5vw, 3rem) 0.5rem; }
/* Pied de page : fond de la page, texte centré, même hauteur et même rythme desktop / mobile */
.theme-split .site-footer { position: absolute; right: 0; bottom: 0; margin: 0; padding: 0 10px 7px 0; display: flex; align-items: baseline; gap: 0.9rem; color: var(--gateway-text, #fff); font-size: 0.75rem; line-height: 1; }
.theme-split .site-footer .legal::after { content: "|"; opacity: 0.6; margin-left: 0.1rem; }
.theme-split .site-footer .wrap { padding: 0; margin: 0; max-width: none; width: auto; display: block; line-height: 1; }
.theme-split .site-footer .grp { margin: 0; line-height: 1; }
.theme-split .site-footer .grp { font-weight: 500; letter-spacing: 0.01em; }
.theme-split .site-footer .grp-name { font-weight: inherit; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 860px) {
  /* Rythme vertical mobile : 2rem entre les grands blocs, 1.25rem de marge latérale */
  .theme-split .stage { padding: 0; }
  .theme-split .card { grid-template-columns: 1fr; grid-template-rows: none; min-height: 0; }
  .theme-split .visual { min-height: 46svh; }
  /* Le panneau se dissout dans la grille : ses enfants deviennent des blocs de la carte, réordonnables */
  .theme-split .panel { display: contents; }
  .theme-split .surheader { width: auto; margin: 0; padding: 1rem 1rem 0; order: 1; }
  .theme-split .panel-main { order: 2; padding: 1.25rem 1.25rem 2rem; margin: 0; }
  .theme-split .gateway { order: 3; grid-template-columns: 1fr; text-align: center; }
  body.theme-split { --heading-boost: 0px; --catalog-boost: 0px; --heading-lh: 1; }
  .theme-split .gateway-catalog { background: transparent; color: var(--gateway-text, #fff); flex-direction: column; gap: 0.6rem; align-items: center; padding: 2rem 1.25rem 1.5rem; border-right: 0; border-bottom: 1px solid color-mix(in srgb, currentColor 35%, transparent); }
  .theme-split .gateway-arrow { width: 2.2rem; height: 2.2rem; }
  .theme-split .gateway-arrow svg { width: 2.2rem; height: 2.2rem; }
  .theme-split .retailers-more, .theme-split .gateway-more { line-height: 1.6; }
  .theme-split .gateway-shops { padding: 1.75rem 1.25rem 2rem; align-items: center; }
  .theme-split .lead { font-size: 1.2rem; }
  .theme-split .gateway h2 { font-size: 0.9375rem; line-height: 1.45; }
  .theme-split .retailers { justify-content: center; gap: 0.4rem 1.1rem; margin-top: 0.85rem; }
  .theme-split .retailers a { font-size: 1.1rem; line-height: 1.3; }
  .theme-split .retailers-more { font-size: 0.95rem; }
  .theme-split .gateway-more { margin-top: 0.85rem; font-size: 0.9375rem; }
  .theme-split .panel-foot { order: 4; margin: 0; padding: 2rem 1.25rem 0; background: var(--brand-surface); }
  /* Liens légaux centrés sous le contact, puis bande groupe */
  .theme-split .legal { justify-content: center; flex-wrap: wrap; gap: 0.5rem 1rem; padding: 2rem 1.25rem 3px; background: var(--brand-surface); font-size: 0.75rem; line-height: 1.4; color: var(--brand-muted); }
  .theme-split .legal a { opacity: 1; }
  .theme-split .site-footer .legal::after { content: none; }
  .theme-split .gateway-shops { padding: 1.75rem 1.25rem 2rem; }
  .theme-split .site-footer { position: static; display: block; padding: 0; background: var(--brand-surface); color: #fff; text-align: center; font-size: 0.9375rem; line-height: 1.5; }
  .theme-split .site-footer .wrap { background: var(--brand-primary); }
  .theme-split .site-footer .wrap { min-height: 3.15rem; display: flex; align-items: center; justify-content: center; padding: 0.6rem 1.25rem; }
  .theme-split .site-footer .grp { opacity: 1; }
  .theme-split .site-footer .grp-name { font-weight: 700; text-decoration: none; }
}

/* ===== Pages légales (scope .page-legal) ===================================
   Mentions légales / Politique de confidentialité / CGU.
   Même palette, même typo, aucune nouvelle couleur en dur. */

.page-legal { background: var(--brand-bg); }
.page-legal .skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand-primary); color: #fff;
  padding: 0.6rem 1rem; text-decoration: none; font-weight: 600; z-index: 100;
}
.page-legal .skip-link:focus { left: 1rem; top: 1rem; outline: 2px solid var(--brand-secondary-text, var(--brand-primary)); outline-offset: 3px; }

/* --- Bandeau visuel + voile dégradé --- */
.page-legal .legal-hero {
  position: relative; margin: 0;
  height: 6rem; overflow: hidden; background: var(--brand-visual-bg);
}
.page-legal .legal-hero img { width: 100%; height: 100%; object-fit: cover; object-position: var(--hero-focus, 50% 50%); display: block; }
.page-legal .legal-hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--brand-primary-dark, var(--brand-primary)) 50%, transparent) 0%, transparent 70%);
}

/* --- Feuille blanche posée sur le bandeau --- */
.page-legal .legal-sheet {
  position: relative; z-index: 1;
  margin: -1.25rem auto 2rem;
  padding: clamp(1rem, 3vw, 1.25rem);
  padding-left: max(env(safe-area-inset-left), clamp(1rem, 3vw, 1.25rem));
  padding-right: max(env(safe-area-inset-right), clamp(1rem, 3vw, 1.25rem));
  background: var(--brand-surface);
  border-radius: var(--brand-radius, 0) var(--brand-radius, 0) 0 0;
  box-shadow: 0 2px 24px color-mix(in srgb, var(--brand-primary-dark, var(--brand-primary)) 10%, transparent);
  max-width: 100%;
}

/* En-tête : retour, logo, H1, filet, onglets */
.page-legal .legal-sheet-head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.page-legal .legal-back { align-self: flex-start; margin: 0 0 0.75rem; font-size: 0.875rem; color: var(--brand-muted); }
.page-legal .legal-back a { color: inherit; text-decoration: none; }
.page-legal .legal-back a:hover { color: var(--brand-secondary-text, var(--brand-primary)); text-decoration: underline; text-underline-offset: 3px; }
.page-legal .legal-sheet-head .brand { margin-bottom: 1rem; }
.page-legal .legal-sheet-head .logo { height: var(--logo-h, 56px); width: auto; }
.page-legal .legal-title {
  margin: 0.25rem 0 0; font-size: calc(clamp(1.75rem, 3.5vw, 2.4rem) + var(--heading-boost, 0px));
  line-height: calc(1.2 * var(--heading-lh, 1)); letter-spacing: -0.005em;
  font-family: var(--font-heading); font-weight: var(--heading-weight);
  color: var(--brand-text); text-wrap: balance;
}
.page-legal .legal-title em { font-style: italic; font-weight: var(--heading-weight); color: var(--brand-secondary-text, var(--brand-primary)); }
.page-legal .legal-sheet-head .sep { width: 3rem; height: 0; border: 0; border-top: 2px solid var(--brand-secondary-text, var(--brand-primary)); margin: 1.4rem 0 1.3rem; }

/* Onglets des 3 pages — style .btn de l'accueil */
.page-legal .legal-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 0 0 1rem; }
.page-legal .legal-tabs a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.65rem 1.1rem; min-height: 44px;
  border-radius: var(--btn-radius, 4px); border: 1.5px solid var(--btn, var(--brand-primary));
  background: #fff; color: var(--btn, var(--brand-primary)); text-decoration: none;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.2;
  text-align: center; overflow-wrap: anywhere;
  transition: background .2s ease, color .2s ease;
}
.page-legal .legal-tabs a:hover { background: var(--btn, var(--brand-primary)); color: #fff; }
.page-legal .legal-tabs a[aria-current="page"] { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); cursor: default; }

/* --- Grille sommaire / corps --- */
.page-legal .legal-grid { margin-top: 1.5rem; }
.page-legal .legal-toc { margin: 0 0 1.5rem; }
.page-legal .legal-toc-details { background: var(--brand-bg); border: 1px solid color-mix(in srgb, var(--brand-primary) 15%, transparent); border-radius: var(--brand-radius, 4px); padding: 0.5rem 1rem; }
.page-legal .legal-toc-details summary { font-family: var(--font-heading); font-weight: var(--heading-weight); color: var(--brand-primary); cursor: pointer; padding: 0.4rem 0; outline: none; }
.page-legal .legal-toc-details summary:focus-visible { outline: 2px solid var(--brand-secondary-text, var(--brand-primary)); outline-offset: 3px; border-radius: 2px; }
.page-legal .legal-toc ol, .page-legal .legal-toc ul { list-style: none; margin: 0.5rem 0 0.75rem; padding: 0; }
.page-legal .legal-toc li { margin: 0.3rem 0; }
.page-legal .legal-toc a { color: var(--brand-text); text-decoration: none; font-size: 0.9375rem; display: inline-block; padding: 0.15rem 0; overflow-wrap: anywhere; }
.page-legal .legal-toc a:hover, .page-legal .legal-toc a:target { color: var(--brand-primary); text-decoration: underline; text-underline-offset: 3px; }

/* --- Corps du texte --- */
.page-legal .legal-body {
  font-family: var(--font-body);
  font-size: 1rem; line-height: 1.65;
  color: var(--brand-text);
  max-width: 68ch;
  hyphens: auto;
}
.page-legal .legal-body h2 {
  position: relative; margin: 2.2rem 0 0.75rem; padding-top: 0.5rem;
  font-family: var(--font-heading); font-weight: var(--heading-weight);
  font-size: calc(1.375rem + var(--heading-boost, 0px)); line-height: calc(1.3 * var(--heading-lh, 1));
  color: var(--brand-primary);
}
.page-legal .legal-body h2::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 2.5rem; height: 4px; border-radius: 2px;
  background: var(--brand-secondary-text, var(--brand-secondary, var(--brand-primary)));
}
.page-legal .legal-body h2:first-of-type { margin-top: 1rem; }
.page-legal .legal-body h3 {
  margin: 1.5rem 0 0.5rem; font-family: var(--font-body);
  font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand-muted);
}
.page-legal .legal-body p { margin: 0 0 1rem; text-wrap: pretty; }
.page-legal .legal-body strong { font-weight: 600; color: var(--brand-text); }
.page-legal .legal-body em { font-style: italic; }
.page-legal .legal-body ul, .page-legal .legal-body ol { margin: 0 0 1.2rem; padding-left: 1.5rem; }
.page-legal .legal-body li { margin: 0.4rem 0; }
.page-legal .legal-body ul li::marker { color: var(--brand-secondary-text, var(--brand-secondary, var(--brand-primary))); font-weight: 700; }
.page-legal .legal-body ol li::marker { color: var(--brand-primary); font-weight: 600; }
.page-legal .legal-body hr { margin: 2rem 0; border: 0; border-top: 1px solid color-mix(in srgb, var(--brand-primary) 15%, transparent); }
.page-legal .legal-body a { color: var(--brand-primary); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.page-legal .legal-body a:hover { color: var(--brand-secondary-text, var(--brand-primary-dark)); }
.page-legal .legal-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em; padding: 0.1em 0.4em;
  background: var(--brand-bg); border-radius: 3px; color: var(--brand-primary-dark, var(--brand-primary));
  overflow-wrap: anywhere;
}
.page-legal .legal-body p em:last-child {
  display: block; margin-top: 2rem; text-align: right; font-style: italic; font-size: 0.875rem; color: var(--brand-muted);
}

/* --- Bloc contact (fin de feuille) --- */
.page-legal .legal-contact {
  margin: 2.5rem auto 0; padding: 1.5rem 0 0;
  border-top: 1px solid color-mix(in srgb, var(--brand-primary) 15%, transparent);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.page-legal .legal-contact .contact-label { margin: 0 0 0.75rem; font-size: 0.9375rem; font-weight: 500; color: var(--brand-text); }
.page-legal .legal-contact .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 0; }
.page-legal .legal-contact .btn {
  display: inline-flex; align-items: center; padding: 0.7rem 1.25rem; min-height: 44px;
  border-radius: var(--btn-radius, 4px); border: 1.5px solid var(--btn, var(--brand-primary));
  background: #fff; color: var(--btn, var(--brand-primary)); text-decoration: none;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.2;
  transition: background .2s ease, color .2s ease;
}
.page-legal .legal-contact .btn:hover { background: var(--btn, var(--brand-primary)); color: #fff; }

/* --- Footer identique à l'accueil --- */
.page-legal .site-footer { margin-top: 0; padding: 1.5rem 1.25rem 2rem; padding-bottom: max(env(safe-area-inset-bottom), 2rem); background: #fff; }
.page-legal .site-footer .legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem 1.2rem; font-size: 0.875rem; color: var(--brand-muted); }
.page-legal .site-footer .legal a { color: inherit; text-decoration: none; }
.page-legal .site-footer .legal a:hover { text-decoration: underline; text-underline-offset: 3px; }
.page-legal .site-footer .legal a[aria-current="page"] { color: var(--brand-text); font-weight: 600; text-decoration: none; }
.page-legal .site-footer .wrap { margin-top: 1rem; padding: 0.6rem 1.25rem; background: var(--brand-primary); color: #fff; min-height: 3.15rem; display: flex; align-items: center; justify-content: center; }
.page-legal .site-footer .grp { margin: 0; font-size: 0.875rem; }
.page-legal .site-footer .grp-name { font-weight: 700; }

/* --- Focus visible, prefers-reduced-motion --- */
.page-legal a:focus-visible,
.page-legal summary:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  .page-legal * { transition: none !important; }
}

/* --- Petits mobiles (< 480 px) --- */
@media (max-width: 479px) {
  .page-legal .legal-hero { height: 6rem; }
  .page-legal .legal-sheet { margin-top: -1.25rem; padding: 1rem; }
  .page-legal .legal-title { font-size: calc(clamp(1.5rem, 7vw, 1.9rem) + var(--heading-boost, 0px)); }
  .page-legal .legal-body { font-size: 1rem; line-height: 1.6; }
  .page-legal .legal-body h2 { font-size: calc(1.25rem + var(--heading-boost, 0px)); }
  .page-legal .legal-tabs { flex-direction: column; align-items: stretch; }
  .page-legal .legal-tabs a { width: 100%; }
}
/* --- Mobiles larges / tablettes portrait (480–859 px) --- */
@media (min-width: 480px) and (max-width: 859px) {
  .page-legal .legal-hero { height: 7.5rem; }
  .page-legal .legal-sheet { margin-top: -1.5rem; padding: 1.25rem; }
}
/* --- Tablettes / petits portables (860–1099 px) : feuille centrée, pas de colonne --- */
@media (min-width: 860px) {
  .page-legal .legal-hero { height: clamp(9rem, 18vw, 14rem); }
  .page-legal .legal-sheet { margin: -3rem auto 3rem; max-width: 72rem; padding: 2rem clamp(1.5rem, 3vw, 2.5rem); border-radius: var(--brand-radius, 4px); }
  .page-legal .legal-grid { display: block; }
  .page-legal .legal-body { margin: 0 auto; }
}
/* --- Grands écrans (≥ 1100 px) : sommaire en colonne gauche sticky --- */
@media (min-width: 1100px) {
  .page-legal .legal-sheet { margin-top: -4rem; padding: 2.5rem 3rem; }
  .page-legal .legal-grid { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem; margin-top: 2rem; }
  .page-legal .legal-toc { margin: 0; }
  .page-legal .legal-toc-details { background: transparent; border: 0; padding: 0; }
  .page-legal .legal-toc-details summary { display: none; }
  .page-legal .legal-toc-details { display: block; }
  .page-legal .legal-toc-details > ul,
  .page-legal .legal-toc-details > ol { display: block; }
  .page-legal .legal-body { margin: 0; max-width: 68ch; }
}
@media (min-width: 1100px) and (min-height: 700px) {
  .page-legal .legal-toc { position: sticky; top: 2rem; max-height: calc(100svh - 4rem); overflow: auto; }
}
/* --- Mobile paysage : bandeau réduit --- */
@media (max-height: 500px) and (orientation: landscape) {
  .page-legal .legal-hero { height: 5rem; }
}
/* --- Impression --- */
@media print {
  .page-legal .legal-hero,
  .page-legal .legal-tabs,
  .page-legal .legal-toc,
  .page-legal .legal-contact,
  .page-legal .site-footer { display: none !important; }
  .page-legal { background: #fff; color: #000; }
  .page-legal .legal-sheet { box-shadow: none; margin: 0; max-width: 100%; }
  .page-legal .legal-body { max-width: 100%; }
  .page-legal .legal-body a { color: #000; text-decoration: underline; }
  .page-legal .legal-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.9em; }
}


/* ===== Drawer légal (desktop/tablette : latéral · mobile : bottom sheet) ===== */

html.drawer-locked { overflow: hidden; }
html.drawer-locked body { overflow: hidden; }

.legal-drawer {
  position: fixed; inset: 0; z-index: 1000;
  pointer-events: none;
}
.legal-drawer[hidden] { display: none; }

.legal-drawer__overlay {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--brand-primary-dark, #000) 60%, transparent);
  opacity: 0;
  transition: opacity .3s ease, backdrop-filter .3s ease;
  pointer-events: auto;
}

.legal-drawer__panel {
  position: absolute;
  background: var(--brand-surface, #fff);
  box-shadow: -24px 0 48px -8px rgba(0,0,0,.22);
  display: flex; flex-direction: column;
  pointer-events: auto;
  outline: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Transition d'ouverture — portée par .is-open ajouté/retiré par JS */
.legal-drawer.is-open .legal-drawer__overlay { opacity: 1; }
.legal-drawer.is-open .legal-drawer__panel  { transform: translate(0, 0); }

/* ---------- Mobile < 480 px — bottom sheet ---------- */
.legal-drawer__panel {
  left: 0; right: 0; bottom: 0; top: auto;
  width: 100%; height: min(90svh, 44rem);
  border-radius: 1.1rem 1.1rem 0 0;
  padding: 0.25rem clamp(1rem, 4vw, 1.25rem) max(env(safe-area-inset-bottom), 1.25rem);
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.22, 1, .36, 1);
}
.legal-drawer__handle {
  width: 2.5rem; height: 4px;
  margin: 0.5rem auto 0.75rem;
  background: color-mix(in srgb, var(--brand-primary) 20%, transparent);
  border-radius: 999px;
}

/* ---------- Mobile large & tablette portrait 480–859 px ---------- */
@media (min-width: 480px) {
  .legal-drawer__panel {
    top: 0; right: 0; bottom: 0; left: auto;
    width: 92%; height: 100svh;
    border-radius: 0;
    padding: 1.25rem 1.25rem max(env(safe-area-inset-bottom), 1.25rem);
    padding-left: max(env(safe-area-inset-left), 1.25rem);
    padding-right: max(env(safe-area-inset-right), 1.25rem);
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.22, 1, .36, 1);
  }
  .legal-drawer__handle { display: none; }
}

/* ---------- Tablettes paysage / petits portables 860–1099 px ---------- */
@media (min-width: 860px) {
  .legal-drawer__panel {
    width: min(70%, 42rem);
    padding: 1.5rem 1.75rem max(env(safe-area-inset-bottom), 1.5rem);
    transition: transform .35s cubic-bezier(.22, 1, .36, 1);
  }
}

/* ---------- Desktop ≥ 1100 px ---------- */
@media (min-width: 1100px) {
  .legal-drawer.is-open .legal-drawer__overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .legal-drawer__panel {
    width: min(55%, 48rem);
    padding: 2.5rem 2.75rem max(env(safe-area-inset-bottom), 2rem);
    transition: transform .38s cubic-bezier(.22, 1, .36, 1);
  }
}

/* ---------- Head : nav onglets + bouton fermer ---------- */
.legal-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--brand-primary) 15%, transparent);
  flex-wrap: wrap;
}
.legal-drawer__tabs {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  min-width: 0; flex: 1;
}
.legal-drawer__tabs a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.55rem 0.85rem; min-height: 44px;
  border-radius: var(--btn-radius, 4px);
  border: 1.5px solid var(--btn, var(--brand-primary));
  background: #fff; color: var(--btn, var(--brand-primary));
  text-decoration: none; text-align: center;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; line-height: 1.2;
  overflow-wrap: anywhere;
  transition: background .2s ease, color .2s ease;
}
.legal-drawer__tabs a:hover { background: var(--btn, var(--brand-primary)); color: #fff; }
.legal-drawer__tabs a[aria-current="page"] {
  background: var(--brand-primary); color: #fff; border-color: var(--brand-primary);
  cursor: default;
}
.legal-drawer__tabs a:focus-visible {
  outline: 2px solid var(--brand-secondary-text, var(--brand-primary));
  outline-offset: 3px;
}

.legal-drawer__close {
  flex: none;
  display: inline-grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, transparent);
  border-radius: 50%;
  background: var(--brand-bg); color: var(--brand-primary);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.legal-drawer__close:hover { background: var(--brand-primary); color: #fff; transform: scale(1.05); }
.legal-drawer__close:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; }
@media (min-width: 860px)  { .legal-drawer__close { width: 2.5rem; height: 2.5rem; } }
@media (min-width: 1100px) { .legal-drawer__close { width: 2.5rem; height: 2.5rem; } }

/* ---------- Body : hérite .legal-body (page légale) ---------- */
.legal-drawer__body {
  padding-top: 1.25rem;
  font-family: var(--font-body);
  font-size: 1rem; line-height: 1.65;
  color: var(--brand-text);
  hyphens: auto;
}
.legal-drawer__body h1 { display: none; }  /* gabarit page a déjà le H1, redondant ici */
.legal-drawer__body h2 {
  position: relative; margin: 2rem 0 0.75rem; padding-top: 0.5rem;
  font-family: var(--font-heading); font-weight: var(--heading-weight);
  font-size: calc(1.3rem + var(--heading-boost, 0px));
  line-height: calc(1.3 * var(--heading-lh, 1));
  color: var(--brand-primary);
}
.legal-drawer__body h2::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 2.5rem; height: 4px; border-radius: 2px;
  background: var(--brand-secondary-text, var(--brand-secondary, var(--brand-primary)));
}
.legal-drawer__body h2:first-of-type { margin-top: 1rem; }
.legal-drawer__body h3 {
  margin: 1.3rem 0 0.5rem; font-family: var(--font-body);
  font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand-muted);
}
.legal-drawer__body p { margin: 0 0 1rem; text-wrap: pretty; overflow-wrap: anywhere; }
.legal-drawer__body ul, .legal-drawer__body ol { margin: 0 0 1.2rem; padding-left: 1.5rem; }
.legal-drawer__body li { margin: 0.4rem 0; }
.legal-drawer__body ul li::marker { color: var(--brand-secondary-text, var(--brand-primary)); font-weight: 700; }
.legal-drawer__body a {
  color: var(--brand-primary); text-decoration: underline; text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.legal-drawer__body a:hover { color: var(--brand-secondary-text, var(--brand-primary-dark)); }
.legal-drawer__body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em; padding: 0.1em 0.4em;
  background: var(--brand-bg); border-radius: 3px; color: var(--brand-primary-dark, var(--brand-primary));
}
.legal-drawer__body p em:last-child {
  display: block; margin-top: 2rem; text-align: right;
  font-style: italic; font-size: 0.875rem; color: var(--brand-muted);
}

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .legal-drawer__overlay,
  .legal-drawer__panel {
    transition: none;
  }
}

/* ---------- impression : masquer le drawer ---------- */
@media print {
  .legal-drawer { display: none !important; }
}
