/* ============================================================
   AchatRentable.ca — Styles partagés du blogue
   Un seul fichier pour tous les articles : une correction ici
   se propage partout, et le navigateur le met en cache une
   seule fois pour tout le blogue.
   ============================================================ */

:root {
  --ink: #0e0e14;
  --ink-soft: #3d3d52;
  --ink-faint: #7c7c98;
  --bg: #f5f4f0;
  --bg-card: #ffffff;
  --purple: #6c5ce7;
  --purple-dark: #4834d4;
  --purple-light: #a29bfe;
  --teal: #00b894;
  --amber: #f39c12;
  --red: #e17055;
  --border: #e4e3df;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg); color: var(--ink);
  line-height: 1.7; -webkit-font-smoothing: antialiased;
}

/* ── NAV ──
   Sélecteur volontairement restreint au <nav> de premier niveau :
   le sommaire d'article est lui aussi un <nav> et ne doit pas
   hériter de la mise en page du menu. */
body > nav {
  position: sticky; top: 0; z-index: 100;
  padding: 15px 48px;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(245, 244, 240, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800; font-size: 1.3rem;
  color: var(--ink); text-decoration: none;
}
.nav-logo span { color: var(--purple); }
.nav-right { display: flex; align-items: center; gap: 26px; }
.nav-link { color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.nav-link:hover { color: var(--purple); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff;
  padding: 10px 22px; border-radius: 100px;
  font-weight: 500; font-size: 0.9rem; text-decoration: none;
  transition: background .2s, transform .2s;
}
.nav-cta:hover { background: var(--purple); transform: translateY(-1px); }

/* ── FIL D'ARIANE ── */
.fil { max-width: 760px; margin: 0 auto; padding: 26px 32px 0; font-size: 0.82rem; color: var(--ink-faint); }
.fil a { color: var(--ink-faint); text-decoration: none; }
.fil a:hover { color: var(--purple); }

/* ── ARTICLE ── */
.article { max-width: 760px; margin: 0 auto; padding: 18px 32px 80px; }
.kicker {
  display: inline-block; font-size: 0.74rem; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--purple);
  margin-bottom: 14px;
}
.article h1 {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.1;
  letter-spacing: -1.5px; margin-bottom: 16px;
}
.meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
  font-size: 0.86rem; color: var(--ink-faint);
  padding-bottom: 26px; border-bottom: 1px solid var(--border); margin-bottom: 32px;
}
.chapo {
  font-size: 1.14rem; line-height: 1.65; color: var(--ink-soft);
  margin-bottom: 34px;
}

.article h2 {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 1.6rem; letter-spacing: -0.7px; line-height: 1.25;
  margin: 52px 0 16px; scroll-margin-top: 80px;
}
.article h3 { font-size: 1.12rem; font-weight: 700; margin: 32px 0 10px; }
.article p { margin-bottom: 18px; color: var(--ink-soft); }
.article ul, .article ol { margin: 0 0 20px; padding-left: 24px; }
.article li { margin-bottom: 10px; color: var(--ink-soft); }
.article strong { color: var(--ink); font-weight: 700; }
.article a { color: var(--purple); text-underline-offset: 2px; }
.article a:hover { color: var(--purple-dark); }
.article img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 26px 0; }
.article figcaption { font-size: 0.85rem; color: var(--ink-faint); text-align: center; margin-top: -14px; margin-bottom: 26px; }

/* ── SOMMAIRE ── */
.sommaire {
  display: block;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 40px;
}
.sommaire strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-faint); margin-bottom: 12px; }
.sommaire ol { margin: 0; padding-left: 20px; }
.sommaire li { margin-bottom: 7px; }
.sommaire a { color: var(--ink-soft); text-decoration: none; }
.sommaire a:hover { color: var(--purple); text-decoration: underline; }

/* ── ENCADRÉS ── */
.encadre {
  border-radius: var(--radius); padding: 20px 24px; margin: 26px 0;
  border: 1px solid var(--border); border-left-width: 4px; background: var(--bg-card);
}
.encadre p:last-child { margin-bottom: 0; }
.encadre-titre { font-weight: 700; color: var(--ink); margin-bottom: 8px; display: block; }
.encadre.cle   { border-left-color: var(--teal); }
.encadre.piege { border-left-color: var(--red);  background: #fef6f4; }
.encadre.note  { border-left-color: var(--amber); background: #fffaf0; }
.encadre.loi   { border-left-color: var(--purple); }

/* ── EXEMPLE CHIFFRÉ ── */
.exemple {
  background: var(--ink); color: #e6e5f0; border-radius: var(--radius);
  padding: 26px 28px; margin: 30px 0;
}
.exemple .encadre-titre { color: #fff; font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.05rem; }
.exemple table { width: 100%; border-collapse: collapse; margin: 14px 0 0; font-size: 0.94rem; }
.exemple td { padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.75); }
.exemple td:last-child { text-align: right; color: #fff; font-weight: 500; }
.exemple tr:last-child td { border-bottom: none; font-weight: 700; padding-top: 14px; }
.exemple tr:last-child td:last-child { color: var(--purple-light); font-size: 1.1rem; }

/* ── TABLEAUX ── */
.article table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.93rem; }
.article th, .article td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.article th { background: var(--bg-card); font-weight: 700; font-size: 0.86rem; }
.article td { color: var(--ink-soft); }

/* ── APPEL À L'ACTION VERS L'OUTIL ── */
.cta-outil {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: #fff; border-radius: 18px; padding: 32px 34px; margin: 40px 0;
  text-align: center;
}
.cta-outil h3 {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 1.4rem; color: #fff; margin: 0 0 10px; letter-spacing: -0.5px;
}
.cta-outil p { color: rgba(255,255,255,0.82); margin-bottom: 22px; }
.cta-outil .btn {
  display: inline-block; background: #fff; color: var(--purple);
  padding: 14px 32px; border-radius: 100px; text-decoration: none;
  font-weight: 700; font-size: 1rem; transition: transform .2s, box-shadow .2s;
}
.cta-outil .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.18); color: var(--purple); }

/* ── FAQ ── */
.faq-bloc { margin-top: 50px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 18px 34px 18px 0; font-family: inherit; font-size: 1rem; font-weight: 700;
  color: var(--ink); position: relative;
}
.faq-q::after { content: '+'; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--purple); font-weight: 400; }
.faq-item.open .faq-q::after { content: '−'; }
.faq-r { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
.faq-item.open .faq-r { max-height: 700px; }
.faq-r p { padding-bottom: 18px; margin: 0; color: var(--ink-soft); }

/* ── ARTICLES LIÉS ── */
.lies { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.lies h2 { font-size: 1.25rem; margin: 0 0 18px; }
.lies-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.lie-card {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.lie-card:hover { border-color: var(--purple); transform: translateY(-2px); }
.lie-card span { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--purple); margin-bottom: 6px; }
.lie-card strong { display: block; color: var(--ink); font-size: 0.98rem; line-height: 1.4; }

/* ── LISTE DU BLOGUE (index) ── */
.blog-hero { max-width: 900px; margin: 0 auto; padding: 60px 32px 34px; }
.blog-hero h1 {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: clamp(2.1rem, 5vw, 3rem); letter-spacing: -1.5px; line-height: 1.08; margin-bottom: 14px;
}
.blog-hero h1 span { color: var(--purple); }
.blog-hero p { font-size: 1.1rem; color: var(--ink-soft); max-width: 620px; }
.filtres { max-width: 900px; margin: 0 auto; padding: 0 32px 26px; display: flex; gap: 9px; flex-wrap: wrap; }
.filtre {
  padding: 8px 18px; border-radius: 100px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--ink-soft); cursor: pointer;
  font-family: inherit; font-size: 0.86rem; transition: .2s;
}
.filtre:hover { border-color: var(--purple); color: var(--purple); }
.filtre.actif { background: var(--ink); color: #fff; border-color: var(--ink); }
.liste { max-width: 900px; margin: 0 auto; padding: 0 32px 80px; display: grid; gap: 18px; }
.post {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 28px; text-decoration: none;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.post:hover { border-color: var(--purple); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.05); }
.post-cat { font-size: 0.72rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--purple); }
.post h2 {
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800;
  font-size: 1.32rem; letter-spacing: -0.5px; line-height: 1.3;
  color: var(--ink); margin: 8px 0 10px;
}
.post p { color: var(--ink-soft); font-size: 0.96rem; margin-bottom: 12px; }
.post-meta { font-size: 0.82rem; color: var(--ink-faint); }
.vide { text-align: center; padding: 50px 20px; color: var(--ink-faint); }

/* ── FOOTER ── */
footer {
  background: var(--ink); color: rgba(255,255,255,0.55);
  padding: 34px 48px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 20px;
}
.footer-logo { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.1rem; font-weight: 800; color: #fff; }
.footer-logo span { color: var(--purple-light); }
footer p { font-size: 0.82rem; color: rgba(255,255,255,0.4); margin: 0; }
.footer-links { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.footer-links a, .footer-links button {
  color: rgba(255,255,255,0.4); text-decoration: none; font-size: 0.82rem;
  background: none; border: none; cursor: pointer; font-family: inherit; padding: 0;
  transition: color .2s;
}
.footer-links a:hover, .footer-links button:hover { color: var(--purple-light); }

/* ── BANNIÈRE DE CONSENTEMENT (identique au reste du site) ── */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; width: 100%;
  background: var(--ink); color: #f5f4f0;
  padding: 16px 28px; box-sizing: border-box;
  display: none; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px; z-index: 9999;
  font-size: 0.88rem; border-top: 3px solid var(--purple);
  box-shadow: 0 -6px 24px rgba(0,0,0,0.22);
}
#cookie-banner p { margin: 0; flex: 1; min-width: 260px; line-height: 1.55; color: rgba(255,255,255,0.72); }
#cookie-banner p strong { color: #fff; font-weight: 500; }
#cookie-banner a { color: var(--purple-light); }
.cookie-btns { display: flex; gap: 10px; flex-shrink: 0; }
.btn-cookie {
  padding: 10px 26px; border-radius: 100px; cursor: pointer;
  font-family: inherit; font-size: 0.88rem; font-weight: 500;
  border: 1px solid transparent; transition: background .2s, transform .2s;
  min-width: 118px;
}
.btn-accept { background: var(--purple); color: #fff; }
.btn-accept:hover { background: #5a4bcf; transform: translateY(-1px); }
.btn-refuse { background: #40405a; color: #fff; }
.btn-refuse:hover { background: #4e4e6b; transform: translateY(-1px); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  body > nav { padding: 15px 20px; }
  .nav-right { gap: 14px; }
  .nav-link { display: none; }
  .fil, .article { padding-left: 20px; padding-right: 20px; }
  .blog-hero, .filtres, .liste { padding-left: 20px; padding-right: 20px; }
  .exemple, .cta-outil { padding: 24px 20px; }
  footer { flex-direction: column; align-items: flex-start; padding: 30px 20px; }
  .article table, .article thead, .article tbody, .article th, .article td, .article tr { display: block; }
  .article thead { display: none; }
  .article td { border: none; padding: 4px 0; }
  .article tr { border-bottom: 1px solid var(--border); padding: 12px 0; }
  .article td::before { content: attr(data-label); display: block; font-weight: 700; color: var(--ink); font-size: 0.8rem; }
}
@media (max-width: 600px) {
  #cookie-banner { padding: 16px 20px; }
  .cookie-btns { width: 100%; }
  .btn-cookie { flex: 1; min-width: 0; }
}
@media print {
  body > nav, footer, #cookie-banner, .cta-outil, .lies, .sommaire { display: none !important; }
}
