/* ==========================================================================
   Page /guide-viager/rente-viagere/ — complément scopé à body.page-rv
   Réutilise les tokens de design-system.css. N’introduit pas de second
   système : navy de marque comme unique accent, Instrument Sans, blanc.
   ========================================================================== */

body.page-rv{
  background:#FAFAF9;
  color:#1C1C1E;
  font-family:var(--font-display);
  font-size:18px;
  line-height:1.7;
}
body.page-rv[data-pb]{
  background:#FAFAF9;
  color:#1C1C1E;
}

body.page-rv a:focus-visible,
body.page-rv button:focus-visible,
body.page-rv summary:focus-visible{
  outline:2px solid #1B3A5C;
  outline-offset:3px;
  border-radius:4px;
}

/* ---- Mise en page document ---- */
.rv{
  --rv-ink:#1C1C1E;
  --rv-muted:#3A3A3C;
  --rv-accent:#1B3A5C;
  --rv-bg:#FAFAF9;
  --rv-paper:#FFFFFF;
  --rv-tint:#F3F5F8;
  --rv-line:#D8DEE6;
  --rv-radius:10px;
  --rv-measure:720px;
  --rv-gap-d:96px;
  --rv-gap-m:64px;
}

.rv-article{
  max-width:var(--rv-measure);
}

body.page-rv[data-pb] .hero-interne__subtitle{
  max-width:720px;
}
body.page-rv[data-pb] .hero-interne__subtitle a{
  color:var(--gold-400);
  text-decoration:underline;
  text-underline-offset:3px;
}
body.page-rv[data-pb] .hero-interne__subtitle a:hover{ color:#fff; }

/* Sommaire mobile */
.rv-toc-mobile{
  display:none;
  max-width:var(--rv-measure);
  width:calc(100% - 40px);
  margin:32px auto 0;
  border:1px solid var(--rv-line);
  border-radius:var(--rv-radius);
  background:var(--rv-paper);
}
.rv-toc-mobile > summary{
  list-style:none;
  cursor:pointer;
  padding:16px 20px;
  font-size:16px;
  font-weight:600;
  color:var(--rv-ink);
}
.rv-toc-mobile > summary::-webkit-details-marker{ display:none; }
.rv-toc-mobile > summary::after{
  content:"▾";
  float:right;
  color:var(--rv-accent);
}
.rv-toc-mobile[open] > summary::after{ content:"▴"; }
.rv-toc-mobile ol{
  margin:0;
  padding:0 20px 18px;
  list-style:none;
  counter-reset:toc;
}
.rv-toc-mobile li{ margin:0 0 8px; counter-increment:toc; }
.rv-toc-mobile a{
  color:var(--rv-ink);
  text-decoration:none;
  font-size:16px;
  line-height:1.45;
  display:inline-flex;
  gap:8px;
}
.rv-toc-mobile a::before{
  content:counter(toc, decimal-leading-zero);
  color:var(--rv-accent);
  font-size:13px;
  font-weight:600;
  min-width:1.6em;
}
.rv-toc-mobile a:hover{ text-decoration:underline; }

/* Layout desktop : TOC sticky + article */
.rv-layout{
  display:grid;
  grid-template-columns:240px minmax(0,720px);
  justify-content:center;
  gap:48px;
  max-width:1100px;
  margin:0 auto;
  padding:0 24px 96px;
}

.rv-toc{
  position:sticky;
  top:88px;
  align-self:start;
  max-height:calc(100vh - 112px);
  overflow-y:auto;
  padding:8px 0 24px;
}
.rv-toc__title{
  margin:0 0 12px;
  font-size:13px;
  font-weight:700;
  letter-spacing:0.04em;
  text-transform:uppercase;
  color:var(--rv-accent);
}
.rv-toc ol{
  margin:0;
  padding:0;
  list-style:none;
  counter-reset:toc;
}
.rv-toc li{ margin:0 0 6px; counter-increment:toc; }
.rv-toc a{
  display:flex;
  gap:8px;
  color:var(--rv-ink);
  text-decoration:none;
  font-size:15px;
  line-height:1.4;
  padding:6px 8px 6px 10px;
  border-left:3px solid transparent;
  border-radius:0 6px 6px 0;
}
.rv-toc a::before{
  content:counter(toc, decimal-leading-zero);
  color:var(--rv-accent);
  font-size:12px;
  font-weight:600;
  min-width:1.7em;
  flex-shrink:0;
  margin-top:1px;
}
.rv-toc a:hover{ background:var(--rv-tint); }
.rv-toc a.is-active{
  border-left-color:var(--rv-accent);
  background:var(--rv-tint);
  font-weight:600;
}

.rv-article{ min-width:0; }

.rv-section{
  padding-top:var(--rv-gap-d);
  scroll-margin-top:88px;
}
.rv-section:first-child{ padding-top:64px; }

body.page-rv[data-pb] .rv-section h2{
  font-family:var(--font-display);
  font-weight:700;
  font-size:29px;
  line-height:1.25;
  letter-spacing:-0.015em;
  color:var(--rv-ink);
  margin:0 0 28px;
}
body.page-rv[data-pb] .rv-section h3,
body.page-rv[data-pb] .rv-cases h3{
  font-family:var(--font-display);
  font-weight:600;
  font-size:21px;
  line-height:1.35;
  color:var(--rv-ink);
  margin:36px 0 14px;
}
body.page-rv[data-pb] .rv-cases h3{
  margin:0 0 12px;
  font-size:16px;
  font-weight:700;
  color:var(--rv-accent);
}
.rv-prose p,
.rv-prose li{
  margin:0 0 20px;
  font-size:18px;
  line-height:1.7;
  color:var(--rv-ink);
}
.rv-prose p:last-child,
.rv-prose li:last-child{ margin-bottom:0; }
.rv-prose ul,
.rv-prose ol{ margin:0 0 20px; padding-left:1.3em; }
.rv-prose a{
  color:var(--rv-accent);
  text-decoration:underline;
  text-underline-offset:3px;
}
.rv-prose a:hover{ color:var(--rv-ink); }

/* DefinitionBlock */
.rv-def{
  background:var(--rv-tint);
  border-left:3px solid var(--rv-accent);
  border-radius:0 var(--rv-radius) var(--rv-radius) 0;
  padding:22px 24px;
  margin:0 0 28px;
}
.rv-def p{
  margin:0;
  font-size:20px;
  line-height:1.65;
  color:var(--rv-ink);
}

/* UpdateBox */
.rv-update{
  border:1px solid var(--rv-line);
  border-radius:var(--rv-radius);
  background:var(--rv-paper);
  padding:24px 24px 8px;
}
.rv-update__badge{
  display:inline-block;
  margin:0 0 16px;
  padding:4px 10px;
  border-radius:999px;
  background:var(--rv-tint);
  color:var(--rv-accent);
  font-size:15px;
  font-weight:600;
  line-height:1.4;
}
.rv-update ul{ margin:0; padding:0 0 8px 1.15em; }
.rv-update li{
  margin:0 0 16px;
  font-size:17px;
  line-height:1.7;
  color:var(--rv-ink);
}
.rv-update a{
  color:var(--rv-accent);
  text-decoration:underline;
  text-underline-offset:3px;
}

/* Tables — desktop */
.rv-table-wrap{ margin:28px 0; }
.rv-table{
  width:100%;
  border-collapse:collapse;
  font-size:16px;
  line-height:1.5;
  color:var(--rv-ink);
  background:var(--rv-paper);
}
.rv-table caption{
  caption-side:top;
}
.rv-table thead th{
  background:var(--rv-tint);
  color:var(--rv-accent);
  font-weight:700;
  font-size:15px;
  text-align:left;
  padding:16px;
  border-bottom:1px solid var(--rv-line);
  vertical-align:bottom;
}
.rv-table tbody th,
.rv-table tbody td{
  padding:16px;
  text-align:left;
  vertical-align:top;
  border-bottom:1px solid var(--rv-line);
  font-size:16px;
  font-weight:400;
  color:var(--rv-ink);
}
.rv-table tbody th{ font-weight:600; }
.rv-table tbody tr:nth-child(even){ background:#F7F8FA; }
.rv-table tbody tr:nth-child(odd){ background:var(--rv-paper); }
.rv-table--example tfoot th,
.rv-table--example tfoot td,
.rv-table--example .rv-table__total th,
.rv-table--example .rv-table__total td{
  font-weight:700;
  border-bottom:none;
  background:var(--rv-tint);
}

/* Timeline */
.rv-timeline{
  list-style:none;
  margin:36px 0 8px;
  padding:0;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:16px;
  position:relative;
}
.rv-timeline::before{
  content:"";
  position:absolute;
  top:11px;
  left:6%;
  right:6%;
  height:1px;
  background:var(--rv-line);
}
.rv-timeline li{ position:relative; margin:0; }
.rv-timeline__dot{
  width:12px;
  height:12px;
  border-radius:50%;
  background:var(--rv-accent);
  margin-bottom:14px;
}
.rv-timeline__n{
  display:block;
  font-size:13px;
  font-weight:700;
  color:var(--rv-accent);
  margin-bottom:6px;
}
.rv-timeline p{
  margin:0;
  font-size:15px;
  line-height:1.55;
  color:var(--rv-ink);
}

/* Case cards */
.rv-cases{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
  margin:28px 0;
  padding:0;
  list-style:none;
}
.rv-cases li{
  margin:0;
  background:var(--rv-paper);
  border:1px solid var(--rv-line);
  border-radius:var(--rv-radius);
  padding:20px;
}
.rv-cases h3{
  margin:0 0 12px;
  font-size:16px;
  font-weight:700;
  line-height:1.4;
  color:var(--rv-accent);
}
.rv-cases p{
  margin:0;
  font-size:16px;
  line-height:1.65;
  color:var(--rv-ink);
}

/* FAQ */
.rv-faq{ margin:8px 0 0; }
.rv-faq details{
  border:1px solid var(--rv-line);
  border-radius:var(--rv-radius);
  background:var(--rv-paper);
  margin:0 0 10px;
  padding:0;
}
.rv-faq summary{
  cursor:pointer;
  list-style:none;
  padding:16px 20px;
  font-size:17px;
  font-weight:600;
  line-height:1.45;
  color:var(--rv-ink);
}
.rv-faq summary::-webkit-details-marker{ display:none; }
.rv-faq summary::after{
  content:"+";
  float:right;
  color:var(--rv-accent);
  font-weight:700;
}
.rv-faq details[open] summary::after{ content:"−"; }
.rv-faq details p{
  margin:0;
  padding:0 20px 18px;
  font-size:17px;
  line-height:1.7;
  color:var(--rv-ink);
}

/* Sources */
.rv-sources{
  margin:0;
  padding-left:1.3em;
}
.rv-sources li{
  margin:0 0 12px;
  font-size:16px;
  line-height:1.6;
  color:var(--rv-ink);
}
.rv-sources a{
  color:var(--rv-accent);
  text-decoration:underline;
  text-underline-offset:3px;
}

/* CTA final discret */
.rv-cta{
  margin-top:64px;
  padding:28px 28px 24px;
  border:1px solid var(--rv-line);
  border-radius:var(--rv-radius);
  background:var(--rv-paper);
}
.rv-cta p{
  margin:0 0 16px;
  font-size:18px;
  line-height:1.65;
  color:var(--rv-ink);
}
.rv-cta__btn{
  display:inline-block;
  padding:12px 20px;
  background:var(--rv-accent);
  color:#FFFFFF;
  font-size:16px;
  font-weight:600;
  text-decoration:none;
  border-radius:8px;
}
.rv-cta__btn:hover{ color:#FFFFFF; filter:brightness(1.08); }
.rv-cta__btn:focus-visible{ outline-color:#1B3A5C; }
.rv-cta__alt{
  display:inline-block;
  margin-left:16px;
  font-size:16px;
  color:var(--rv-accent);
  text-decoration:underline;
  text-underline-offset:3px;
}

@media (max-width:960px){
  .rv-layout{
    grid-template-columns:1fr;
    padding:0 20px 72px;
  }
  .rv-toc{ display:none; }
  .rv-toc-mobile{ display:block; }
}

@media (max-width:639px){
  body.page-rv{ font-size:17px; }
  .rv-section{ padding-top:var(--rv-gap-m); }
  .rv-section:first-child{ padding-top:48px; }
  body.page-rv[data-pb] .rv-section h2{ font-size:26px; }
  body.page-rv[data-pb] .rv-section h3{ font-size:20px; }
  .rv-prose p,
  .rv-prose li{ font-size:17px; }
  .rv-def p{ font-size:19px; }

  .rv-timeline{
    grid-template-columns:1fr;
    gap:0;
  }
  .rv-timeline::before{
    top:0;
    bottom:0;
    left:5px;
    right:auto;
    width:1px;
    height:auto;
  }
  .rv-timeline li{
    display:grid;
    grid-template-columns:12px 1fr;
    column-gap:16px;
    padding-bottom:24px;
  }
  .rv-timeline__dot{ margin:0; grid-row:1 / span 2; }

  .rv-cases{ grid-template-columns:1fr; }

  .rv-cta__alt{ display:block; margin:14px 0 0; }

  /* Tables → cartes, aucun scroll horizontal */
  .rv-table-wrap{ overflow:visible; }
  .rv-table,
  .rv-table thead,
  .rv-table tbody,
  .rv-table tfoot,
  .rv-table tr,
  .rv-table th,
  .rv-table td{
    display:block;
    width:100%;
  }
  .rv-table{ border:0; }
  .rv-table thead{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
  .rv-table tbody tr,
  .rv-table tfoot tr{
    border:1px solid var(--rv-line);
    border-radius:var(--rv-radius);
    background:var(--rv-paper);
    margin:0 0 12px;
    padding:4px 0;
  }
  .rv-table tbody tr:nth-child(even),
  .rv-table tbody tr:nth-child(odd){ background:var(--rv-paper); }
  .rv-table tbody th,
  .rv-table tbody td,
  .rv-table tfoot th,
  .rv-table tfoot td,
  .rv-table .rv-table__total th,
  .rv-table .rv-table__total td{
    border:0;
    padding:10px 16px;
    background:transparent;
  }
  .rv-table tbody th[scope="row"]{
    padding-bottom:4px;
    font-size:16px;
  }
  .rv-table td[data-label]::before{
    content:attr(data-label);
    display:block;
    font-size:15px;
    font-weight:700;
    color:var(--rv-accent);
    margin-bottom:4px;
  }
  .rv-table td:empty,
  .rv-table td.rv-table__empty{ display:none; }
}

@media (prefers-reduced-motion:reduce){
  html{ scroll-behavior:auto; }
  body.page-rv *,
  body.page-rv *::before,
  body.page-rv *::after{
    animation:none !important;
    transition:none !important;
  }
}
