/* Best Matelas — thème "neutral"
   Palette neutre : blanc, gris, accent ardoise discret. Aucun dégradé, aucune couleur vive. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: #1f2933;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

:root {
  --ink: #1f2933;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --paper: #ffffff;
  --paper-2: #f7f8fa;
  --accent: #3a5a78;
  --accent-ink: #2b4560;
  --accent-soft: #eef2f6;
  --radius: 6px;
  --wrap: 1120px;
}

/* Base typographique */
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; color: var(--ink); font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
strong { font-weight: 650; }
.muted { color: var(--ink-3); }
.small { font-size: .9rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 820px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 4px; }
.skip:focus { left: 8px; z-index: 1000; }

/* Topbar */
.topbar { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 50; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 14px; height: 14px; border-radius: 3px; background: var(--accent); display: inline-block; }
.brand-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-name span { font-weight: 400; color: var(--ink-2); }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 12px; border-radius: var(--radius); font-size: .97rem; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: var(--radius); width: 40px; height: 36px; cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); }

/* Fil d'Ariane */
.crumbs { font-size: .9rem; color: var(--ink-3); padding-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-2); }

/* Hero */
.hero-plain { border-bottom: 1px solid var(--line); background: var(--paper); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .9fr); gap: 48px; padding: 64px 22px 56px; align-items: start; }
.eyebrow { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; margin-bottom: 12px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; padding: 12px 20px; border-radius: var(--radius); font-weight: 600; font-size: .97rem; border: 1px solid var(--accent); }
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink-3); color: var(--ink); }
.hero-aside { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; background: var(--paper-2); }
.aside-title { font-weight: 650; margin-bottom: 12px; }
.aside-list { margin: 0; padding-left: 22px; }
.aside-list li { margin-bottom: 12px; }
.aside-list li:last-child { margin-bottom: 0; }
.aside-list strong { display: block; }
.aside-list span { color: var(--ink-2); font-size: .95rem; }

/* Sections */
.section { padding: 56px 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.link-more { font-size: .95rem; }

/* Cartes */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.cards-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--paper); transition: border-color .15s; }
.card:hover { border-color: var(--ink-3); color: var(--ink); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-2); font-size: .97rem; margin-bottom: 0; }
.card-kicker { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; margin-bottom: 10px; }
.card-cta { margin-top: auto; padding-top: 16px; color: var(--accent); font-weight: 600; font-size: .93rem; }

/* Bandeau méthode */
.band { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding: 48px 22px; align-items: start; }
.band p { color: var(--ink-2); max-width: 58ch; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 26px; color: var(--ink); }
.checks li::before { content: ""; position: absolute; left: 0; top: .55em; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); }

/* Listes (section) */
.page-head { margin-bottom: 28px; }
.list { display: grid; gap: 12px; margin-top: 28px; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; transition: border-color .15s; }
.list-item:hover { border-color: var(--ink-3); color: var(--ink); }
.list-item h2 { font-size: 1.15rem; margin-bottom: 6px; }
.list-item p { color: var(--ink-2); margin: 0; font-size: .97rem; }
.chev { color: var(--ink-3); font-size: 1.2rem; flex: none; }

/* Article */
.article { padding: 32px 22px 64px; }
.meta { color: var(--ink-3); font-size: .9rem; }
.article-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: 84px; border-left: 2px solid var(--line); padding-left: 16px; font-size: .92rem; }
.toc-title { font-weight: 650; margin-bottom: 8px; color: var(--ink); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 6px 0; }
.toc li ul { padding-left: 14px; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); }

/* Prose */
.prose { max-width: 72ch; }
.section > .prose, .section.prose { margin-left: 0; }
.prose h2 { margin-top: 2em; padding-top: .4em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.4em 0; padding: 12px 18px; border-left: 3px solid var(--line-2); color: var(--ink-2); background: var(--paper-2); border-radius: 0 var(--radius) var(--radius) 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 650; color: var(--ink); background: var(--paper-2); }

/* Tableau responsive : chaque ligne devient une carte empilée en mobile */
@media (max-width: 720px) {
  .prose table, .prose thead, .prose tbody, .prose th, .prose td, .prose tr { display: block; }
  .prose thead { display: none; }
  .prose tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; background: var(--paper); }
  .prose td { border: 0; padding: 5px 0; display: flex; align-items: baseline; gap: 8px; }
  .prose td::before { content: attr(data-label); font-weight: 650; font-size: .82rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; flex: 0 0 130px; }
  .prose td:first-child { font-weight: 650; padding-top: 0; }
  .prose td:last-child { padding-bottom: 0; }
}
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.4em 0; }
.callout p:last-child { margin-bottom: 0; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; color: var(--ink-3); font-size: 1.2rem; }
.faq details[open] summary::after { content: "–"; }
.faq-a { padding: 0 0 14px; color: var(--ink-2); }

/* À lire aussi */
.related { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.25rem; margin-bottom: 18px; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--paper-2); margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: 44px 22px; font-size: .95rem; }
.footer-brand { font-weight: 700; margin-bottom: 8px; }
.footer-title { font-weight: 650; margin-bottom: 10px; color: var(--ink); }
.footer-col a { display: block; color: var(--ink-2); text-decoration: none; margin-bottom: 8px; }
.footer-col a:hover { color: var(--ink); text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .band-inner, .article-grid { grid-template-columns: 1fr; gap: 28px; }
  .toc { position: static; border-left: 0; padding-left: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .menu-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px 12px 12px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .hero-grid { padding: 40px 22px 36px; }
  .section { padding: 40px 22px; }
}
