/* ==========================================================================
   Mutuelle Chaton : feuille de style unique
   ========================================================================== */

:root {
  --bg: #fbf8f3;
  --bg-alt: #f4eee4;
  --surface: #ffffff;
  --ink: #1a1f1c;
  --ink-soft: #3c453f;
  --muted: #5f6961;
  --brand: #1c6b55;
  --brand-dark: #12503f;
  --brand-soft: #e6f1ec;
  --accent: #c9552a;
  --accent-soft: #fbeade;
  --line: #e7ded1;
  --line-strong: #d6c9b6;
  --shadow-s: 0 1px 2px rgba(26, 31, 28, .06), 0 4px 12px rgba(26, 31, 28, .05);
  --shadow-m: 0 2px 6px rgba(26, 31, 28, .07), 0 18px 40px rgba(26, 31, 28, .08);
  --radius: 14px;
  --radius-l: 22px;
  --maxw: 1180px;
  --measure: 70ch;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #11140f;
    --bg-alt: #171b16;
    --surface: #1a1f1b;
    --ink: #ece7dd;
    --ink-soft: #cfc9bd;
    --muted: #9ba49b;
    --brand: #64bd9c;
    --brand-dark: #8ad3b6;
    --brand-soft: #16281f;
    --accent: #ef8a5c;
    --accent-soft: #2a1c15;
    --line: #2b322c;
    --line-strong: #3b443c;
    --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-m: 0 18px 40px rgba(0, 0, 0, .45);
  }
}

:root[data-theme='dark'] {
  --bg: #11140f;
  --bg-alt: #171b16;
  --surface: #1a1f1b;
  --ink: #ece7dd;
  --ink-soft: #cfc9bd;
  --muted: #9ba49b;
  --brand: #64bd9c;
  --brand-dark: #8ad3b6;
  --brand-soft: #16281f;
  --accent: #ef8a5c;
  --accent-soft: #2a1c15;
  --line: #2b322c;
  --line-strong: #3b443c;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-m: 0 18px 40px rgba(0, 0, 0, .45);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.68;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-dark); text-decoration-color: color-mix(in oklab, var(--brand) 40%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 0 0 .6em;
  font-variation-settings: 'SOFT' 0, 'WONK' 0;
}

h1 { font-size: clamp(2rem, 1.35rem + 2.8vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.05rem); margin-top: 2.2em; }
h3 { font-size: clamp(1.18rem, 1.06rem + .6vw, 1.42rem); margin-top: 1.9em; }
h4 { font-size: 1.05rem; margin-top: 1.6em; font-family: var(--sans); font-weight: 700; }

p { margin: 0 0 1.15em; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 32px; } }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--brand); color: #fff; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- En-tete ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__in { display: flex; align-items: center; gap: 14px; min-height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 1.15rem; letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--brand); display: grid; place-items: center; box-shadow: var(--shadow-s); }
.brand__mark svg { width: 21px; height: 21px; fill: #fff; }
.brand__sub { display: block; font-family: var(--sans); font-size: .68rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-top: 1px; }

.nav { margin-left: auto; display: none; align-items: center; gap: 4px; }

.nav a {
  display: inline-block; padding: 8px 13px; border-radius: 999px;
  font-size: .95rem; font-weight: 500; color: var(--ink-soft); text-decoration: none;
}
.nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nav a[aria-current='page'] { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.nav-toggle {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  border-radius: 999px; padding: 8px 15px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}

@media (min-width: 950px) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
  .mobile-nav, .mobile-nav.is-open { display: none; }
}

.mobile-nav { display: none; border-top: 1px solid var(--line); background: var(--surface); }
.mobile-nav.is-open { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: 8px 0 18px; }
.mobile-nav a { display: block; padding: 12px 16px; text-decoration: none; color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line); }

/* ---------- Heros ---------- */

.hero { padding: 40px 0 8px; }
.hero__grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.05fr .95fr; gap: 48px; } .hero { padding: 64px 0 16px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand-dark); background: var(--brand-soft); padding: 6px 13px; border-radius: 999px; margin-bottom: 18px;
}

.hero__lede { font-size: 1.16rem; color: var(--ink-soft); max-width: 60ch; }

.hero__media { position: relative; border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-m); background: var(--bg-alt); }
.hero__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: .97rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-s); }
.btn--primary:hover { background: var(--brand-dark); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { color: var(--ink); border-color: var(--brand); }

/* ---------- Bandeaux de reperes ---------- */

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 34px 0 6px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; }
.stat__v { display: block; font-family: var(--serif); font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem); font-weight: 600; color: var(--brand-dark); line-height: 1.1; }
.stat__l { display: block; font-size: .85rem; color: var(--muted); margin-top: 6px; }

/* ---------- Sections ---------- */

.band { padding: 56px 0; }
.band--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.band__head { max-width: 62ch; margin-bottom: 30px; }
.band__head p { color: var(--muted); margin: 0; }
.band__head h2 { margin-top: 0; }

.grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--2 { grid-template-columns: repeat(2, 1fr); } }

.card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-m); color: inherit; }
.card__img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--bg-alt); }
.card__body { padding: 18px 19px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__kicker { font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.card__title { font-family: var(--serif); font-size: 1.14rem; font-weight: 600; line-height: 1.26; margin: 0; }
.card__desc { font-size: .93rem; color: var(--muted); margin: 0; }
.card__more { margin-top: auto; padding-top: 10px; font-size: .88rem; font-weight: 600; color: var(--brand-dark); }

/* ---------- Article ---------- */

.crumbs { font-size: .84rem; color: var(--muted); padding: 18px 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li::after { content: '›'; margin-left: 6px; color: var(--line-strong); }
.crumbs li:last-child::after { content: ''; }
.crumbs a { color: var(--muted); }

.article-head { padding: 12px 0 8px; max-width: 74ch; }
.article-head h1 { margin-bottom: .35em; }
.article-head .lede { font-size: 1.14rem; color: var(--ink-soft); }

.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .84rem; color: var(--muted); margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.meta span { display: inline-flex; align-items: center; gap: 6px; }

.article-hero { margin: 26px 0 8px; border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-m); }
.article-hero img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
@media (min-width: 760px) { .article-hero img { aspect-ratio: 5 / 2; max-height: 440px; } }

.layout { display: grid; gap: 34px; padding: 26px 0 60px; }
.layout > * { min-width: 0; }
@media (min-width: 1040px) { .layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; } }

.prose { max-width: var(--measure); min-width: 0; font-size: 1.075rem; }
.prose > h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--brand); }
.prose strong { font-weight: 650; color: var(--ink); }
.prose code { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 5px; padding: .1em .4em; font-size: .9em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose h2 { padding-top: .2em; }
.prose h2::after { content: ''; display: block; width: 46px; height: 3px; border-radius: 3px; background: var(--accent); margin-top: .5em; }

blockquote {
  margin: 1.8em 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--brand);
  font-family: var(--serif); font-size: 1.12rem; color: var(--ink-soft);
}
blockquote p { margin: 0; }

.fig { margin: 2em 0; }
.fig img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-s); aspect-ratio: 3 / 2; object-fit: cover; }
.fig figcaption { font-size: .85rem; color: var(--muted); margin-top: 10px; text-align: left; }

.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; margin: 1.7em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--bg-alt); font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; }
tbody th { font-weight: 600; color: var(--ink); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

.callout {
  margin: 1.9em 0; padding: 18px 20px; border-radius: var(--radius);
  background: var(--brand-soft); border: 1px solid color-mix(in oklab, var(--brand) 22%, transparent);
}
.callout p:last-child { margin-bottom: 0; }
.callout__title { font-family: var(--sans); font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-dark); margin: 0 0 .6em; }
.callout--alerte { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 28%, transparent); }
.callout--alerte .callout__title { color: var(--accent); }
.callout--chiffre { background: var(--surface); border-color: var(--line-strong); }
.callout--chiffre .callout__title { color: var(--muted); }
.callout ul { margin-bottom: 0; }

.faq-q { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; margin-top: 1.7em; }

/* ---------- Sommaire ---------- */

.toc { position: sticky; top: 92px; font-size: .9rem; }
.toc__box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 20px; }
.toc h2 { font-family: var(--sans); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.toc h2::after { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); color: var(--ink-soft); text-decoration: none; line-height: 1.4; }
.toc a:hover { border-left-color: var(--brand); color: var(--brand-dark); }
.toc .lvl-3 a { padding-left: 22px; font-size: .86rem; color: var(--muted); }
@media (max-width: 1039px) {
  .toc { position: static; margin: 24px 0 0; }
  .toc__box details > summary { cursor: pointer; font-weight: 600; }
}

.aside-stack { display: flex; flex-direction: column; gap: 20px; }
.aside-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; font-size: .92rem; }
.aside-card h2 { font-family: var(--sans); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.aside-card h2::after { display: none; }
.aside-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.aside-card a { text-decoration: none; color: var(--ink); font-weight: 500; line-height: 1.35; display: block; }
.aside-card a:hover { color: var(--brand-dark); }

/* ---------- Bas d article ---------- */

.next-read { padding: 44px 0 10px; border-top: 1px solid var(--line); }
.author-box { display: flex; gap: 16px; align-items: flex-start; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 34px 0 0; font-size: .94rem; }
.author-box p { margin: 0; color: var(--muted); }
.author-box strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.05rem; margin-bottom: 4px; }

.disclaimer { font-size: .85rem; color: var(--muted); background: var(--bg-alt); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 16px 18px; margin: 30px 0 0; }
.disclaimer p { margin: 0; }

/* ---------- Liste de rubrique ---------- */

.section-hero { padding: 26px 0 34px; border-bottom: 1px solid var(--line); }
.section-hero .lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 68ch; }

.index-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.index-list li { border-bottom: 1px solid var(--line); }
.index-list a { display: grid; gap: 4px; padding: 20px 0; text-decoration: none; color: inherit; grid-template-columns: 1fr; }
@media (min-width: 760px) { .index-list a { grid-template-columns: 1fr 180px; align-items: center; gap: 24px; } }
.index-list a:hover .index-list__t { color: var(--brand-dark); }
.index-list a > span:first-child { display: block; }
.index-list__t { display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.index-list__d { display: block; font-size: .93rem; color: var(--muted); max-width: 62ch; }
.index-list__m { font-size: .82rem; color: var(--muted); }

/* ---------- Pied de page ---------- */

.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 52px 0 32px; margin-top: 40px; font-size: .93rem; }
.footer-grid { display: grid; gap: 30px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; } }
.site-footer h2 { font-family: var(--sans); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; font-weight: 700; }
.site-footer h2::after { display: none; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--brand-dark); }
.site-footer__note { color: var(--muted); max-width: 42ch; margin: 12px 0 0; font-size: .89rem; }
.footer-legal { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line-strong); display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.footer-legal ul { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; }

/* ---------- Divers ---------- */

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.pill { font-size: .84rem; padding: 6px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); text-decoration: none; }
.pill:hover { border-color: var(--brand); color: var(--brand-dark); }

.notfound { text-align: center; padding: 80px 0 60px; }
.notfound p { color: var(--muted); max-width: 52ch; margin-inline: auto; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
