:root {
  color-scheme: light;
  --ink: #24211e;
  --muted: #625e58;
  --paper: #f5f3e8;
  --surface: #fffefa;
  --surface-strong: #ffffff;
  --line: #d9d3c0;
  --line-strong: #bcb49d;
  --gold: #987c10;
  --gold-soft: #eee7c7;
  --focus: #765f08;
  --serif: var(--font-ui);
  --sans: var(--font-ui);
  --mono: var(--font-ui);
  font-family: var(--sans);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 78px; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper); text-rendering: optimizeLegibility; }
::selection { color: var(--ink); background: var(--gold-soft); }
a { color: inherit; text-decoration-color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 9px 12px; color: #fff; background: var(--ink); font-family: var(--mono); font-size: var(--type-caption); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; top: 0; z-index: 10; box-sizing: border-box; height: 55px; padding: 0 max(22px, calc((100vw - 1180px) / 2 + 22px)); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: var(--surface-strong); box-shadow: none; }
.site-header-brand { min-width: 0; display: flex; align-items: center; gap: 15px; }
.wordmark { flex: 0 0 auto; color: var(--ink); font-family: var(--serif); font-size: var(--type-section); font-weight: var(--weight-heading); letter-spacing: .035em; line-height: 1; text-decoration: none; }
.site-header-context { overflow: hidden; color: var(--muted); font-family: var(--mono); font-size: var(--type-caption); font-weight: var(--weight-label); letter-spacing: .1em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.site-header-exit { min-height: 34px; padding: 7px 11px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: #fff; background: var(--ink); font-family: var(--mono); font-size: var(--type-caption); font-weight: var(--weight-label); letter-spacing: .01em; text-decoration: none; white-space: nowrap; }
.site-header-exit:hover { background: #3d3934; }

/* Mise en page des trois documents publics. */
.document-switcher { width: min(1120px, calc(100% - 40px)); margin: 28px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-strong); background: var(--surface); }
.document-switcher a { min-height: 48px; padding: 11px 16px; display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--line-strong); color: var(--muted); font-size: var(--type-meta); font-weight: var(--weight-heading); line-height: 1.25; text-align: center; text-decoration: none; }
.document-switcher a:last-child { border-right: 0; }
.document-switcher a:hover { color: var(--ink); background: #faf8ef; }
.document-switcher a[aria-current="page"] { color: #fff; background: var(--ink); }

.legal-main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: clamp(56px, 7vw, 88px) 0 80px; }
.legal-hero { max-width: 850px; padding-bottom: 50px; }
.legal-hero h1 { max-width: 850px; margin: 0; font-family: var(--serif); font-size: var(--type-display); font-weight: var(--weight-heading); letter-spacing: -.035em; line-height: 1.2; text-wrap: balance; }
.legal-hero .lead { max-width: 68ch; margin: 25px 0 0; color: var(--muted); font-family: var(--serif); font-size: var(--type-subtitle); line-height: 1.48; }
.document-date { margin: 20px 0 0; color: var(--muted); font-family: var(--mono); font-size: var(--type-caption); font-variant-numeric: tabular-nums; letter-spacing: .03em; }

.key-points { margin: 0 0 64px; border: 1px solid var(--line-strong); background: var(--surface-strong); }
.key-points h2 { margin: 0; padding: 22px 24px; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: var(--type-section); font-weight: var(--weight-heading); letter-spacing: -.02em; }
.key-points dl { margin: 0; }
.key-points dl > div { padding: 18px 24px; display: grid; grid-template-columns: minmax(150px, .55fr) minmax(0, 1.45fr); gap: 24px; border-bottom: 1px solid var(--line); }
.key-points dl > div:last-child { border-bottom: 0; }
.key-points dt { color: var(--muted); font-size: var(--type-meta); font-weight: var(--weight-heading); letter-spacing: .02em; }
.key-points dd { margin: 0; font-size: var(--type-body); line-height: 1.55; }

.legal-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(44px, 7vw, 92px); align-items: start; }
.legal-toc { position: sticky; top: 78px; }
.legal-toc strong { display: block; margin-bottom: 14px; font-family: var(--mono); font-size: var(--type-caption); font-weight: var(--weight-label); letter-spacing: .08em; text-transform: uppercase; }
.legal-toc ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.legal-toc li { margin: 0; border-bottom: 1px solid var(--line); }
.legal-toc a { padding: 11px 0; display: block; color: var(--muted); font-size: var(--type-meta); line-height: 1.35; text-decoration: none; }
.legal-toc a:hover { color: var(--ink); }

.legal-content { min-width: 0; }
.legal-content > section { padding: 38px 0 46px; border-top: 1px solid var(--line-strong); }
.legal-content > section:first-child { padding-top: 0; border-top: 0; }
.legal-content h2 { max-width: 22ch; margin: 0 0 20px; font-family: var(--serif); font-size: var(--type-section); font-weight: var(--weight-heading); letter-spacing: -.025em; line-height: 1.2; text-wrap: balance; }
.legal-content h3 { max-width: 46ch; margin: 28px 0 9px; font-family: var(--sans); font-size: var(--type-subtitle); font-weight: var(--weight-heading); line-height: 1.2; }
.legal-content p, .legal-content li, .legal-content dd { max-width: 70ch; font-size: var(--type-body); line-height: 1.65; }
.legal-content address { max-width: 70ch; font-size: var(--type-body); font-style: normal; line-height: 1.65; }
.legal-content p { margin: 0 0 17px; }
.legal-content p:last-child { margin-bottom: 0; }
.legal-content ul, .legal-content ol { max-width: 70ch; margin: 0 0 18px; padding-left: 1.35em; }
.legal-content li + li { margin-top: 8px; }
.plain-list { padding: 0 !important; list-style: none; }
.plain-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.plain-list li:first-child { border-top: 1px solid var(--line); }

.legal-definition-list { margin: 20px 0 0; border-top: 1px solid var(--line); }
.legal-definition-list > div { padding: 14px 0; display: grid; grid-template-columns: minmax(150px, .6fr) minmax(0, 1.4fr); gap: 22px; border-bottom: 1px solid var(--line); }
.legal-definition-list dt { color: var(--muted); font-size: var(--type-meta); font-weight: var(--weight-heading); }
.legal-definition-list dd { margin: 0; font-size: var(--type-body); }

.processing-list { margin-top: 24px; border-top: 1px solid var(--line); }
.processing-item { padding: 20px 0; display: grid; grid-template-columns: minmax(150px, .65fr) minmax(0, 1.35fr); gap: 24px; border-bottom: 1px solid var(--line); }
.processing-item h3 { margin: 0; font-size: var(--type-subtitle); }
.processing-item p { margin: 0 0 9px; font-size: var(--type-body); }
.processing-item p:last-child { margin-bottom: 0; }
.legal-basis { color: var(--muted); }

.legal-note { margin: 28px 0 0; padding: 20px 22px; border: 1px solid #d5c78c; background: #fffaf0; }
.legal-note strong { display: block; margin-bottom: 7px; font-size: var(--type-meta); }
.legal-note p, .legal-note span { margin: 0; color: #52491f; font-size: var(--type-meta); line-height: 1.55; }

.contact-block { margin-top: 22px; border: 1px solid var(--line-strong); background: var(--surface-strong); }
.contact-block > div { padding: 19px 22px; border-bottom: 1px solid var(--line); }
.contact-block > div:last-child { border-bottom: 0; }
.contact-block strong { display: block; margin-bottom: 6px; }
.contact-block p, .contact-block address { margin: 0; font-size: var(--type-body); font-style: normal; line-height: 1.55; }

.faq-list { border-top: 1px solid var(--line-strong); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { padding: 17px 4px; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; font-size: var(--type-body); font-weight: var(--weight-heading); list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: ""; width: 8px; height: 8px; flex: 0 0 auto; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg) translateY(-2px); transition: transform .18s ease-out; }
.faq-list details[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.faq-list details p { margin: 0; padding: 0 40px 18px 4px; color: var(--muted); font-size: var(--type-body); }
.legal-source-links { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: var(--type-meta); }

/* Le modèle d'annexe existant continue d'utiliser ces styles génériques. */
body:not(.legal-page) main { width: min(780px, calc(100% - 40px)); margin: 0 auto; padding: clamp(52px, 9vw, 108px) 0 72px; }
body:not(.legal-page) h1 { max-width: 650px; margin: 0; font-family: var(--serif); font-size: var(--type-title); font-weight: var(--weight-heading); letter-spacing: -.04em; line-height: 1.2; }
.eyebrow, .section-number { margin: 0 0 10px; color: #716016; font-family: var(--sans); font-size: var(--type-caption); font-weight: var(--weight-heading); letter-spacing: .15em; text-transform: uppercase; }
body:not(.legal-page) .lead { max-width: 655px; margin: 30px 0 50px; color: var(--muted); font-family: var(--serif); font-size: var(--type-subtitle); line-height: 1.5; }
.notice { margin: 0 0 66px; padding: 23px 25px; border: 1px solid #e3d7ac; background: #fffdf7; box-shadow: 0 14px 30px rgba(51, 42, 19, .06); }
.notice strong, .review-note strong { font-family: var(--sans); font-size: var(--type-meta); letter-spacing: .04em; text-transform: uppercase; }
.notice p { margin: 9px 0 0; color: var(--muted); line-height: 1.55; }
body:not(.legal-page) section { padding: 52px 0; border-top: 1px solid var(--line); }
body:not(.legal-page) h2 { margin: 0 0 15px; font-family: var(--serif); font-size: var(--type-section); font-weight: var(--weight-heading); letter-spacing: -.035em; }
body:not(.legal-page) p, body:not(.legal-page) li, body:not(.legal-page) dd { font-size: var(--type-subtitle); line-height: 1.65; }
body:not(.legal-page) section p { max-width: 64ch; margin: 0 0 18px; }
.review-note { margin-top: 35px; padding: 22px 24px; border: 1px solid #e3d7ac; border-radius: 4px; color: #574d2a; background: #fff9e4; line-height: 1.55; }

.legal-footer { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 38px; display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); gap: 34px; border-top: 1px solid var(--line-strong); color: var(--muted); font-size: var(--type-caption); line-height: 1.55; }
.legal-footer strong { display: block; margin-bottom: 9px; color: var(--ink); font-size: var(--type-meta); }
.legal-footer p { margin: 0; }
.legal-footer nav { display: flex; flex-wrap: wrap; gap: 9px 19px; }
.legal-footer-meta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 7px 16px; }

@media (max-width: 760px) {
  html { scroll-padding-top: 68px; }
  .document-switcher { grid-template-columns: 1fr; }
  .document-switcher a { min-height: 43px; border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .document-switcher a:last-child { border-bottom: 0; }
  .legal-layout { grid-template-columns: 1fr; gap: 42px; }
  .legal-toc { position: static; }
  .legal-toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-toc li:nth-child(odd) { border-right: 1px solid var(--line); }
  .legal-toc a { height: 100%; padding: 11px 12px; }
}

@media (max-width: 540px) {
  .site-header { height: 55px; padding: 0 16px; }
  .site-header-brand { gap: 9px; }
  .wordmark { font-size: var(--type-section); }
  .site-header-context { display: none; }
  .site-header-exit { min-height: 30px; padding: 6px 8px; font-size: var(--type-caption); }
  .document-switcher, .legal-main, .legal-footer { width: min(100% - 32px, 1120px); }
  .document-switcher { margin-top: 18px; }
  .legal-main { padding-top: 44px; }
  .legal-hero { padding-bottom: 40px; }
  .legal-hero h1 { font-size: var(--type-display); }
  .key-points { margin-bottom: 48px; }
  .key-points dl > div, .legal-definition-list > div, .processing-item { grid-template-columns: 1fr; gap: 6px; }
  .legal-toc ol { grid-template-columns: 1fr; }
  .legal-toc li:nth-child(odd) { border-right: 0; }
  .legal-content > section { padding: 32px 0 38px; }
  .legal-footer { grid-template-columns: 1fr; }
  body:not(.legal-page) main { width: min(100% - 32px, 780px); padding-top: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media print {
  .skip-link, .site-header, .document-switcher, .legal-toc, .legal-footer { display: none !important; }
  body { color: #000; background: #fff; }
  .legal-main { width: auto; padding: 0; }
  .key-points, .contact-block { break-inside: avoid; }
  .legal-content > section { break-inside: auto; }
}

/* Retour au parcours accessible pendant la lecture des documents. */
.site-header-exit { min-height: 44px; }
@media (max-width: 520px) { .site-header-context { display: none; } }
