/* legal2.css — pages légales (CGV, CGU, mentions légales, confidentialité, cookies, crédits photos)
   Refonte « carnet + cinéma », version du 13 octobre 2026. Préfixe lg-.
   Structure posée par legal.js (et pré-rendue par .claude/outils/refonte-legal.mjs) :
     section.legal.lg[data-motion=off] > .eyebrow, h1, .legal-updated, nav.lg-toc, .legal-body > .lg-sec > h2…, .lg-fin
   Sans legal.js, seules les règles de typographie (sans .lg-*) s'appliquent : la page reste propre.
   Ordinateur (≥ 1100 px) : sommaire collant à gauche qui suit la lecture ; téléphone : sommaire repliable.
   On n'anime que transform / opacity ; rien ne bouge en mouvement réduit. */

#app main > section.legal {
  --lg-encre: var(--ink, #1b2433);
  --lg-trait: var(--line, #ddd2bf);
  --lg-papier: var(--surface, #fbf8f2);
  --lg-orange: var(--orange-ink, #a83b17);
  --lg-mono: var(--cine-mono, ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace);
  --lg-haut-entete: 100px;                     /* en-tête collant (75 px) + respiration */
}

/* ---------- 1. Typographie (s'applique même sans legal.js) ---------- */
#app main > section.legal .legal-body p,
#app main > section.legal .legal-body li {
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 68ch;
  margin: 0 0 1em;
  color: var(--lg-encre);
  opacity: 1;
  text-wrap: pretty;
  hyphens: manual;
}
#app main > section.legal .legal-body p { color: color-mix(in srgb, var(--lg-encre) 88%, transparent); }
#app main > section.legal .legal-body li { color: color-mix(in srgb, var(--lg-encre) 88%, transparent); margin: 0 0 .7em; }
#app main > section.legal .legal-body b,
#app main > section.legal .legal-body strong { font-weight: 600; color: var(--lg-encre); }
#app main > section.legal .legal-body h2 {
  font-size: clamp(1.4rem, 1.2rem + .6vw, 1.7rem) !important;
  line-height: 1.2;
  margin: 0 0 .7em !important;
  text-wrap: balance;
  scroll-margin-top: var(--lg-haut-entete);
}
#app main > section.legal .legal-body > h2 { margin-top: 1.8em !important; }
#app main > section.legal .legal-body ul { list-style: none; padding: 0; margin: 0 0 1.2em; }
#app main > section.legal .legal-body ul > li { position: relative; padding-left: 1.35em; }
#app main > section.legal .legal-body ul > li::before {
  content: ""; position: absolute; left: .1em; top: .82em; width: .6em; height: 2px; border-radius: 2px;
  background: var(--orange, #c94d23);
}
#app main > section.legal .legal-body a:not(.btn),
#app main > section.legal > p a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--orange, #c94d23) 55%, transparent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  transition: color .15s, text-decoration-color .15s;
}
#app main > section.legal .legal-body a:not(.btn):hover,
#app main > section.legal > p a:hover { color: var(--lg-orange); text-decoration-color: currentColor; }
#app main > section.legal .legal-updated {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--lg-mono); font-size: .78rem !important; letter-spacing: .02em; line-height: 1.3;
  color: var(--muted) !important;
  border: 1.5px dashed var(--lg-trait); border-radius: 8px; padding: .5em .85em; margin: .4em 0 0 !important;
  justify-self: start; max-width: 100%; box-sizing: border-box;
}
#app main > section.legal .legal-updated::before {
  content: ""; width: .55em; height: .55em; border-radius: 50%; background: var(--orange, #c94d23); flex: none;
}

/* ---------- 2. Cadre de la page ---------- */
#app main > section.legal.lg {
  box-sizing: border-box;
  width: auto !important;
  max-width: 1160px !important;
  margin: 0 auto !important;
  padding: 56px 32px 72px !important;
  border-radius: 0 !important;
  min-height: 0;
}
#app main > section.legal.lg > .eyebrow { margin: 0; color: var(--lg-orange); justify-self: start; }
#app main > section.legal.lg > h1 {
  font-size: clamp(2.3rem, 1.6rem + 3vw, 4.1rem) !important;
  line-height: 1.02 !important;
  margin: .32em 0 .38em !important;
  max-width: 16ch;
  text-wrap: balance;
}
#app main > section.legal.lg > h1:focus { outline: none; }
/* le corps : une feuille posée sur le bureau, détachée par une ligne pointillée */
#app main > section.legal.lg .legal-body {
  margin-top: 28px;
  padding-top: 8px;
}
#app main > section.legal.lg .legal-body > p:first-child {
  font-family: var(--f-display);
  font-size: clamp(1.15rem, 1.05rem + .35vw, 1.3rem);
  line-height: 1.5;
  color: var(--lg-encre);
  font-variation-settings: "SOFT" 60, "WONK" 0;
  max-width: 60ch;
}
#app main > section.legal.lg .legal-body > p:first-child b { font-weight: 600; }

/* sections numérotées : un numéro de porte, une ligne de découpe entre deux sections */
#app main > section.legal.lg .lg-sec {
  padding: 30px 0 6px;
  border-top: 1.5px dashed var(--lg-trait);
}
#app main > section.legal.lg .lg-sec:first-child { border-top: 0; padding-top: 6px; }
#app main > section.legal.lg .legal-body > p + .lg-sec { margin-top: 18px; }
#app main > section.legal.lg .lg-sec > h2 { margin: 0 0 .65em !important; }
#app main > section.legal.lg .lg-sec > h2:focus { outline: none; }
#app main > section.legal.lg .lg-sec > h2:focus-visible { outline: 2px solid var(--orange, #c94d23); outline-offset: 6px; border-radius: 4px; }
#app main > section.legal.lg .lg-num,
#app main > section.legal.lg .lg-sec > h2[data-n]::before {
  display: inline-block;
  vertical-align: .28em;
  margin-right: .7em;
  padding: .32em .5em .28em;
  min-width: 2.4em;
  box-sizing: border-box;
  text-align: center;
  font-family: var(--lg-mono);
  font-size: .5em;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  font-variation-settings: normal;
  color: var(--lg-orange);
  border: 1.5px solid currentColor;
  border-radius: 6px;
  white-space: nowrap;
}
#app main > section.legal.lg .lg-sec > h2[data-n]::before { content: attr(data-n); content: attr(data-n) / ""; }

/* formulaire de rétractation (CGV) : une fiche à remplir */
#app main > section.legal.lg .lg-sec p:has(> i:first-child) {
  font-family: var(--lg-mono);
  font-size: .9rem;
  line-height: 1.85;
  background: var(--lg-papier);
  border: 1.5px dashed var(--lg-trait);
  border-radius: 12px;
  padding: 16px 18px;
  max-width: 62ch;
}
#app main > section.legal.lg .lg-sec p:has(> i:first-child) > i:first-child { font-family: var(--f-body); color: var(--muted); }

/* fin de page : bouton retour + haut de page */
#app main > section.legal.lg .lg-fin {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  margin-top: 36px; padding-top: 28px;
  border-top: 2px dashed var(--lg-trait);
}
#app main > section.legal.lg .lg-fin > .btn { margin: 0 !important; min-height: 48px; }
#app main > section.legal.lg .lg-haut {
  display: inline-flex; align-items: center; gap: .5em;
  min-height: 44px; padding: 0 4px;
  font-family: var(--lg-mono); font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: color .15s;
}
#app main > section.legal.lg .lg-haut svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease-out, ease); }
#app main > section.legal.lg .lg-haut:hover { color: var(--lg-orange); }
#app main > section.legal.lg .lg-haut:hover svg { transform: translateY(-2px); }

/* ---------- 3. Sommaire ---------- */
#app main > section.legal.lg .lg-toc { font-family: var(--f-body); }
#app main > section.legal.lg .lg-toc p.lg-toc-h {
  margin: 0 0 14px !important; line-height: 1 !important;
  font-family: var(--lg-mono); font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--lg-orange);
}
#app main > section.legal.lg .lg-toc-l { list-style: none; margin: 0; padding: 0; counter-reset: none; }
#app main > section.legal.lg .lg-toc-l a {
  display: grid; grid-template-columns: 2.7em minmax(0, 1fr); align-items: baseline; column-gap: .2em;
  padding: 8px 10px 8px 0;
  color: var(--lg-encre); text-decoration: none;
  font-size: .9rem; line-height: 1.35;
}
#app main > section.legal.lg .lg-toc-n { font-family: var(--lg-mono); font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
/* colonne des numéros à la largeur du plus long (« 3 bis. », « 14. ») : titres alignés */
@supports (grid-template-columns: subgrid) {
  #app main > section.legal.lg .lg-toc-l { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: .85em; }
  #app main > section.legal.lg .lg-toc-l > li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
  #app main > section.legal.lg .lg-toc-l a { grid-column: 1 / -1; grid-template-columns: subgrid; column-gap: .85em; }
}
#app main > section.legal.lg .lg-toc-x { color: color-mix(in srgb, var(--lg-encre) 78%, transparent); transition: color .15s; }
#app main > section.legal.lg .lg-toc-l a:hover .lg-toc-x { color: var(--lg-orange); }
#app main > section.legal.lg .lg-toc-t { display: none; }

/* — ordinateur : colonne collante qui suit la lecture — */
@media (min-width: 1100px) {
  #app main > section.legal.lg:not(.lg-credits) {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    column-gap: clamp(48px, 5vw, 88px);
    align-items: start;
  }
  #app main > section.legal.lg:not(.lg-credits) > * { grid-column: 2; min-width: 0; }
  #app main > section.legal.lg:not(.lg-credits) > .lg-toc {
    grid-column: 1; grid-row: 1 / span 20;
    position: sticky; top: var(--lg-haut-entete);
    max-height: calc(100vh - var(--lg-haut-entete) - 24px);
    overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
    margin-top: 10px; padding: 2px 4px 8px 0;
  }
  #app main > section.legal.lg .legal-body { max-width: 760px; }
  #app main > section.legal.lg .lg-toc-l { position: relative; padding-left: 26px; }
  /* le fil : pointillé, puis orange jusqu'à la section en cours (transform seulement) */
  #app main > section.legal.lg .lg-toc-l::before,
  #app main > section.legal.lg .lg-toc-l::after {
    content: ""; position: absolute; left: 6px; top: 14px; bottom: 14px; width: 2px; border-radius: 2px;
  }
  #app main > section.legal.lg .lg-toc-l::before { background: repeating-linear-gradient(to bottom, var(--lg-trait) 0 5px, transparent 5px 9px); }
  #app main > section.legal.lg .lg-toc-l::after {
    background: var(--orange, #c94d23);
    transform-origin: 50% 0; transform: scaleY(var(--lg-fil, 0));
    transition: transform .55s var(--ease-out, ease);
  }
  #app main > section.legal.lg .lg-toc-l > li { position: relative; }
  #app main > section.legal.lg .lg-toc-l > li::before {
    content: ""; position: absolute; left: -25px; top: 13px; width: 10px; height: 10px; box-sizing: border-box; border-radius: 50%;
    background: var(--bg, #f3ede2); border: 2px solid var(--lg-trait); z-index: 1;
    transition: transform .3s var(--cine-ressort, cubic-bezier(.34, 1.56, .64, 1)), background-color .2s, border-color .2s;
  }
  #app main > section.legal.lg .lg-toc-l > li.is-lu::before { background: var(--orange, #c94d23); border-color: var(--orange, #c94d23); }
  #app main > section.legal.lg .lg-toc-l > li.is-ici::before { background: var(--bg, #f3ede2); border-color: var(--orange, #c94d23); border-width: 3px; transform: scale(1.35); }
  #app main > section.legal.lg .lg-toc-l > li.is-ici .lg-toc-x { color: var(--lg-encre); font-weight: 600; }
  #app main > section.legal.lg .lg-toc-l > li.is-ici .lg-toc-n,
  #app main > section.legal.lg .lg-toc-l > li.is-lu .lg-toc-n { color: var(--lg-orange); }
  #app main > section.legal.lg .lg-toc > .lg-haut { margin: 12px 0 0 0; }
  #app main > section.legal.lg .lg-fin > .lg-haut { display: none; }
  #app main > section.legal.lg:not(.lg-credits) .lg-fin { border-top: 0; padding-top: 0; margin-top: 32px; }
  /* la feuille : papier posé, ombre imprimée */
  #app main > section.legal.lg:not(.lg-credits) .legal-body {
    background: var(--lg-papier);
    border: 1px solid color-mix(in srgb, var(--lg-trait) 80%, transparent);
    border-radius: 18px;
    box-shadow: var(--paper-shadow, 0 12px 30px -12px #3a2a1440);
    padding: 36px clamp(32px, 4vw, 52px) 26px;
  }
}

/* — téléphone / tablette : sommaire repliable sous la date — */
@media (max-width: 1099.98px) {
  #app main > section.legal.lg { padding: 34px 20px 56px !important; }
  #app main > section.legal.lg > .lg-toc {
    margin: 22px 0 6px;
    background: var(--lg-papier);
    border: 1.5px solid var(--lg-trait);
    border-radius: 14px;
    overflow: hidden;
    max-width: 640px;
  }
  #app main > section.legal.lg .lg-toc p.lg-toc-h,
  #app main > section.legal.lg .lg-toc > .lg-haut { display: none; }
  #app main > section.legal.lg .lg-toc-t {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin: 0; padding: 0 16px;
    background: none; border: 0; border-radius: 0; cursor: pointer; color: var(--lg-encre);
    font: 600 1rem/1.2 var(--f-body); text-align: left; -webkit-tap-highlight-color: transparent;
  }
  #app main > section.legal.lg .lg-toc-t > b {
    font-family: var(--lg-mono); font-size: .72rem; font-weight: 700; color: var(--lg-orange);
    border: 1.5px solid currentColor; border-radius: 6px; padding: .2em .45em;
  }
  #app main > section.legal.lg .lg-toc-t > i {
    margin-left: auto; width: 9px; height: 9px; border: solid currentColor; border-width: 0 2px 2px 0;
    transform: translateY(-2px) rotate(45deg); transition: transform .25s var(--ease-out, ease);
  }
  #app main > section.legal.lg .lg-toc-t[aria-expanded="true"] > i { transform: translateY(2px) rotate(225deg); }
  #app main > section.legal.lg .lg-toc-t:focus-visible { outline: 2px solid var(--orange, #c94d23); outline-offset: -4px; border-radius: 12px; }
  #app main > section.legal.lg .lg-toc-l { display: none; border-top: 1.5px dashed var(--lg-trait); padding: 4px 6px 8px; }
  #app main > section.legal.lg .lg-toc.is-ouvert .lg-toc-l { display: block; }
  @supports (grid-template-columns: subgrid) { #app main > section.legal.lg .lg-toc.is-ouvert .lg-toc-l { display: grid; } }
  #app main > section.legal.lg .lg-toc-l a { min-height: 44px; align-items: center; padding: 6px 10px; border-radius: 8px; }
  #app main > section.legal.lg .lg-toc-l a:active { background: var(--soft, #e9e0cf); }
  #app main > section.legal.lg .lg-sec { padding-top: 26px; }
  #app main > section.legal.lg .lg-sec > h2 { scroll-margin-top: 80px; }
}
@media (max-width: 520px) {
  #app main > section.legal.lg { padding: 26px 18px 48px !important; }
  #app main > section.legal.lg > h1 { font-size: clamp(2.05rem, 9.2vw, 2.6rem) !important; }
  #app main > section.legal .legal-body p,
  #app main > section.legal .legal-body li { font-size: 1rem; line-height: 1.65; }
  #app main > section.legal.lg .legal-body > p:first-child { font-size: 1.12rem; }
  #app main > section.legal.lg .lg-fin > .btn { flex: 1 1 100%; justify-content: center; }
  #app main > section.legal.lg .lg-sec p:has(> i:first-child) { font-size: .84rem; padding: 14px; }
}

/* ---------- 4. Crédits photos : planche de tickets ---------- */
#app main > section.legal.lg-credits { max-width: 1040px !important; }
#app main > section.legal.lg-credits > p { max-width: 68ch; color: var(--muted); line-height: 1.6; margin: 0 0 1em; font-size: 1rem; }
#app main > section.legal.lg-credits > ul {
  list-style: none; margin: 28px 0 30px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px;
  counter-reset: lg-cr;
}
#app main > section.legal.lg-credits > ul > li {
  counter-increment: lg-cr;
  position: relative; margin: 0; min-height: 64px; box-sizing: border-box;
  padding: 12px 14px 12px 64px;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: .3em;
  background: var(--lg-papier); border: 1px solid var(--lg-trait); border-radius: 12px;
  font-size: .95rem; line-height: 1.4; color: var(--lg-encre);
}
#app main > section.legal.lg-credits > ul > li::before {
  content: counter(lg-cr, decimal-leading-zero);
  content: counter(lg-cr, decimal-leading-zero) / "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 48px;
  display: grid; place-items: center;
  font-family: var(--lg-mono); font-size: .78rem; font-weight: 700; color: var(--lg-orange);
  border-right: 1.5px dashed var(--lg-trait);
}
#app main > section.legal.lg-credits > ul > li a {
  color: var(--muted); font-size: .85rem; white-space: nowrap;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--orange, #c94d23) 50%, transparent); text-underline-offset: 3px;
  display: inline-flex; align-items: center; min-height: 32px;
}
#app main > section.legal.lg-credits > ul > li a:hover { color: var(--lg-orange); }
#app main > section.legal.lg-credits > p:last-child { font-size: .9rem; }

/* ---------- 5. Sombre, mouvement réduit, impression ---------- */
html[data-theme=dark] #app main > section.legal.lg:not(.lg-credits) .legal-body { box-shadow: 0 12px 30px -14px #000c; }
html[data-theme=dark] #app main > section.legal .legal-updated::before,
html[data-theme=dark] #app main > section.legal .legal-body ul > li::before { background: var(--orange, #f08a5d); }
@media (prefers-reduced-motion: reduce) {
  #app main > section.legal.lg .lg-toc-l::after,
  #app main > section.legal.lg .lg-toc-l > li::before,
  #app main > section.legal.lg .lg-toc-t > i,
  #app main > section.legal.lg .lg-haut svg { transition: none !important; }
}
@media print {
  #app main > section.legal.lg { display: block !important; padding: 0 !important; }
  #app main > section.legal.lg .lg-toc,
  #app main > section.legal.lg .lg-fin { display: none !important; }
  #app main > section.legal.lg .legal-body { box-shadow: none !important; border: 0 !important; padding: 0 !important; }
}
