/* ============================================================
   GuideCyclo — feuille de style v2
   Principe : la photo d'abord, la typographie ensuite, le décor jamais.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f6f4;
  --ink: #10201a;
  --ink-2: #3d4f47;
  --muted: #6b7a73;
  --line: #e2e8e4;
  --accent: #0f7a55;
  --accent-dark: #0a5b3f;
  --amber: #c8871a;
  --radius: 14px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(16,32,26,.04), 0 8px 24px rgba(16,32,26,.06);
  --shadow-lg: 0 2px 4px rgba(16,32,26,.05), 0 18px 48px rgba(16,32,26,.12);
  --wrap: 1180px;
  --measure: 44rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; max-width: 100%; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }

.wrap { width: min(var(--wrap), calc(100% - 40px)); margin-inline: auto; }

/* ---------- En-tête ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(var(--wrap), calc(100% - 40px));
  margin-inline: auto;
  display: flex; align-items: center; gap: 28px;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: .82rem; letter-spacing: .02em;
}
.brand-name { font-weight: 800; font-size: 1.08rem; letter-spacing: -.02em; }

.site-nav { display: flex; gap: 22px; margin-left: auto; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.site-nav a { flex: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  text-decoration: none; white-space: nowrap;
  font-size: .935rem; font-weight: 600; color: var(--ink-2);
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Étiquettes ---------- */

.kicker {
  display: inline-block;
  font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.kicker.on-photo { color: #fff; opacity: .95; }

.badge {
  display: inline-block;
  font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px;
  background: var(--accent); color: #fff;
}
.badge.amber { background: var(--amber); }
.badge.ghost { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); color: #fff; }

/* ---------- Une : article vedette ---------- */

.lede { margin: 30px 0 56px; }
.lede-card {
  position: relative; display: block; text-decoration: none;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.lede-card img { width: 100%; height: clamp(340px, 52vw, 560px); object-fit: cover; }
.lede-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,20,15,.92) 0%, rgba(8,20,15,.62) 34%, rgba(8,20,15,.05) 68%);
}
.lede-text {
  position: absolute; inset: auto 0 0 0; z-index: 1;
  padding: clamp(22px, 4vw, 44px);
  color: #fff;
}
.lede-text h1 {
  font-size: clamp(1.65rem, 3.6vw, 2.9rem);
  font-weight: 850; margin: 12px 0 10px; max-width: 22ch;
}
.lede-text p { margin: 0; font-size: clamp(.98rem, 1.4vw, 1.12rem); color: rgba(255,255,255,.86); max-width: 60ch; }
.lede-meta { margin-top: 14px; font-size: .85rem; color: rgba(255,255,255,.72); font-weight: 600; }

/* ---------- Grille d'articles ---------- */

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  margin: 0 0 22px;
}
.section-head h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); font-weight: 850; }
.section-head a { font-size: .92rem; font-weight: 700; color: var(--accent); text-decoration: none; white-space: nowrap; }
.section-head a:hover { text-decoration: underline; }

.grid { display: grid; gap: 30px 26px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card { display: flex; flex-direction: column; text-decoration: none; }
.card-media {
  border-radius: var(--radius-s); overflow: hidden; background: var(--bg-soft);
  aspect-ratio: 16 / 10; margin-bottom: 14px;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.card:hover .card-media img { transform: scale(1.035); }
.card-media.contain { background: #eef1ef; }
.card-media.contain img { object-fit: contain; padding: 12px; }
.card h3 {
  font-size: 1.14rem; font-weight: 750; letter-spacing: -.015em;
  margin: 6px 0 8px; line-height: 1.3;
}
.card:hover h3 { color: var(--accent-dark); }
.card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.6; }
.card-meta { margin-top: 12px; font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .01em; }

.section { margin: 0 0 62px; }

/* ---------- Filtres catégorie ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 32px; }
.filters button {
  font: inherit; font-size: .9rem; font-weight: 650;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  transition: all .16s ease;
}
.filters button:hover { border-color: var(--accent); color: var(--accent); }
.filters button.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Page article ---------- */

.article-head { margin: 34px 0 0; }
.article-head h1 {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 850; margin: 10px 0 16px;
  max-width: 24ch;
}
.article-standfirst {
  font-size: clamp(1.08rem, 1.7vw, 1.28rem);
  line-height: 1.6; color: var(--ink-2); font-weight: 400;
  max-width: var(--measure); margin: 0;
}
.article-byline {
  margin: 20px 0 0; font-size: .875rem; font-weight: 650; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.article-byline .dot { opacity: .4; }

.hero-figure { margin: 30px 0 40px; }
.hero-figure img {
  width: 100%; height: clamp(240px, 36vw, 440px); object-fit: cover;
  border-radius: var(--radius);
}
.hero-figure.contain img { object-fit: contain; background: #eef1ef; height: clamp(260px, 38vw, 460px); }
figcaption { margin-top: 10px; font-size: .85rem; color: var(--muted); line-height: 1.5; }

.prose { max-width: var(--measure); margin-inline: auto; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem); font-weight: 800;
  margin-top: 2.2em; margin-bottom: .1em;
}
.prose h3 { font-size: 1.16rem; font-weight: 750; margin-top: 1.7em; margin-bottom: .1em; }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.25em; color: var(--ink-2); }
.prose li + li { margin-top: .5em; }
.prose a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose figure { margin-inline: 0; }
.prose figure img { width: 100%; height: auto; border-radius: var(--radius-s); }

/* Encadrés */

.keyfacts {
  max-width: var(--measure); margin: 34px auto;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.keyfacts dl { margin: 0; display: grid; grid-template-columns: minmax(120px, 34%) 1fr; }
.keyfacts dt, .keyfacts dd {
  margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: .96rem;
}
.keyfacts dt { font-weight: 750; background: var(--bg-soft); color: var(--ink); }
.keyfacts dd { color: var(--ink-2); }
.keyfacts dl > :nth-last-child(-n+2) { border-bottom: 0; }

.verdict {
  max-width: var(--measure); margin: 38px auto;
  padding: 26px 28px; border-radius: var(--radius);
  background: #f0f7f3; border: 1px solid #cde3d8;
}
.verdict h2 { font-size: 1.32rem; font-weight: 800; margin: 8px 0 12px; }
.verdict p { margin: 0; color: var(--ink-2); }

.callout {
  max-width: var(--measure); margin: 28px auto;
  padding: 18px 20px; border-radius: var(--radius-s);
  background: #fdf7e8; border: 1px solid #ecd9a8; color: #63481a;
  font-size: .97rem;
}
.callout p { margin: 0; }

.stats { max-width: var(--measure); margin: 32px auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 16px 14px; }
.stat b { display: block; font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em; }
.stat span { display: block; margin-top: 6px; font-size: .84rem; color: var(--muted); line-height: 1.45; }

.sources { max-width: var(--measure); margin: 52px auto 0; padding-top: 26px; border-top: 1px solid var(--line); }
.sources h2 { font-size: 1.12rem; font-weight: 800; margin-bottom: 12px; }
.sources ul { padding-left: 1.1em; font-size: .92rem; color: var(--muted); }

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

.site-footer {
  margin-top: 76px; padding: 42px 0 54px;
  background: var(--bg-soft); border-top: 1px solid var(--line);
}
.footer-inner {
  width: min(var(--wrap), calc(100% - 40px)); margin-inline: auto;
  display: flex; flex-wrap: wrap; gap: 22px; justify-content: space-between; align-items: center;
}
.site-footer p { margin: 0; font-size: .9rem; color: var(--muted); max-width: 48ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { font-size: .9rem; font-weight: 650; color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Adaptatif ---------- */

@media (max-width: 900px) {
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  body { font-size: 1.02rem; }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .grid { gap: 26px; }
  .header-inner { gap: 16px; height: 60px; }
  .brand-name { font-size: 1rem; }
  .site-nav { gap: 16px; }
  .keyfacts dl { grid-template-columns: 1fr; }
  .keyfacts dt { border-bottom: 0; padding-bottom: 2px; }
  .keyfacts dd { padding-top: 4px; }
  .lede-text { padding: 20px; }
  .lede-text h1 { font-size: 1.55rem; }
  .lede-card img { height: clamp(360px, 96vw, 460px); }
  .lede-text p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .lede-meta { margin-top: 10px; }
  .header-inner { gap: 14px; }
  .site-nav { gap: 18px; }
  .wrap { width: calc(100% - 32px); }
}

/* ---- page head (index guides) ---- */
.page-head { margin: 40px 0 26px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 850; }
.page-head p { margin: 14px 0 0; color: var(--muted); font-size: 1.02rem; max-width: 62ch; line-height: 1.6; }
.empty { color: var(--muted); }

/* ---- credits table ---- */
.credits { max-width: 100%; overflow-x: auto; }
.credits table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.credits th, .credits td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.credits th { font-weight: 750; background: var(--bg-soft); white-space: nowrap; }
.credits td a { color: var(--accent-dark); }

/* =========================================================
   Compatibilité v1 → v2 : mise en forme du contenu existant
   ========================================================= */

.content-page { max-width: var(--measure); margin: 34px auto 0; }
.content-page > * + * { margin-top: 1.15em; }
.content-page p { color: var(--ink-2); }
.content-page strong { color: var(--ink); font-weight: 700; }
.content-page a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.content-page ul, .content-page ol { padding-left: 1.25em; color: var(--ink-2); }
.content-page li + li { margin-top: .5em; }

.content-page > h1 {
  font-size: clamp(1.9rem, 3.9vw, 2.85rem); font-weight: 850; margin: 6px 0 0;
}
.content-page h2 {
  font-size: clamp(1.32rem, 2.2vw, 1.6rem); font-weight: 800;
  margin-top: 2.1em; margin-bottom: .15em; color: var(--ink);
}
.content-page h3 { font-size: 1.16rem; font-weight: 750; margin-top: 1.7em; margin-bottom: .1em; }

.content-page .eyebrow {
  font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent); margin: 0;
}
.content-page .lead {
  font-size: clamp(1.06rem, 1.7vw, 1.22rem); line-height: 1.55;
  color: var(--ink-2); margin-top: .7em;
}
.content-page .article-meta {
  font-size: .87rem; color: var(--muted); font-weight: 600; margin-top: .8em;
}

/* Visuels dans le corps de l'article */
.content-page figure { margin: 32px 0; }
.content-page figure img { width: 100%; height: auto; border-radius: var(--radius-s); }
.article-visual.product-visual img,
.article-visual.product-visual > img { background: #fff; border: 1px solid var(--line); object-fit: contain; padding: 16px; height: clamp(220px, 26vw, 320px); }
.card-media.product img { background: #eef1ef; object-fit: contain; padding: 14px; }
.image-grid figure img { height: clamp(180px, 20vw, 240px); object-fit: cover; }
.image-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.image-grid figure { margin: 0; }

/* Le visuel principal déborde de la colonne de texte */
.content-page > .hero-figure {
  width: min(var(--wrap), calc(100vw - 40px));
  margin: 32px 0 40px; margin-left: 50%; transform: translateX(-50%);
}
.content-page > .hero-figure img {
  width: 100%; height: clamp(240px, 36vw, 440px); object-fit: cover; border-radius: var(--radius);
}
.content-page > .hero-figure.contain img { object-fit: contain; background: #eef1ef; height: clamp(240px, 32vw, 400px); }
.content-page > .hero-figure figcaption { max-width: var(--measure); margin-inline: auto; }

/* Encadrés */
.verdict-box {
  background: var(--bg-soft); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius-s); padding: 22px 24px; margin: 34px 0;
}
.verdict-box .eyebrow { margin-bottom: 6px; }
.verdict-box h2 { font-size: 1.28rem; font-weight: 800; margin: 6px 0 12px; }
.verdict-box p:last-child { margin-bottom: 0; }

.notice {
  background: #fdf7e8; border: 1px solid #ecdcb4; border-radius: var(--radius-s);
  padding: 18px 20px; margin: 30px 0; font-size: .97rem;
}
.notice p { margin: 0; color: var(--ink-2); }

.evidence-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 30px 0; }
.evidence-grid > div { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 16px 15px; }
.evidence-grid strong { display: block; font-size: 1.08rem; font-weight: 800; letter-spacing: -.02em; }
.evidence-grid span { display: block; margin-top: 6px; font-size: .86rem; color: var(--muted); line-height: 1.45; }

.recommendation-table {
  border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; margin: 30px 0;
}
.recommendation-table > div {
  display: grid; grid-template-columns: minmax(140px, 38%) 1fr;
  border-bottom: 1px solid var(--line);
}
.recommendation-table > div:last-child { border-bottom: 0; }
.recommendation-table strong { padding: 12px 14px; background: var(--bg-soft); font-weight: 750; font-size: .93rem; }
.recommendation-table span { padding: 12px 14px; color: var(--ink-2); font-size: .95rem; }

.table-wrap { overflow-x: auto; margin: 30px 0; border: 1px solid var(--line); border-radius: var(--radius-s); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.table-wrap caption { caption-side: bottom; padding: 12px 14px; font-size: .82rem; color: var(--muted); text-align: left; line-height: 1.5; }
.table-wrap th, .table-wrap td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table-wrap thead th { background: var(--bg-soft); font-weight: 750; white-space: nowrap; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }

.num { font-variant-numeric: tabular-nums; font-weight: 750; }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-2); border: 1px solid var(--line);
}

.related-guides { margin: 52px 0 0; padding-top: 26px; border-top: 1px solid var(--line); }
.related-guides h2 { font-size: 1.12rem; font-weight: 800; margin-bottom: 14px; }
.related-guides a {
  display: block; padding: 13px 16px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  text-decoration: none; font-weight: 700; color: var(--ink); font-size: .96rem;
}
.related-guides a:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--bg-soft); }

.button {
  display: inline-block; padding: 11px 20px; border-radius: 999px; font-weight: 750;
  background: var(--accent); color: #fff; text-decoration: none; font-size: .95rem;
}
.button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }

@media (max-width: 620px) {
  .evidence-grid, .image-grid { grid-template-columns: 1fr; }
  .recommendation-table > div { grid-template-columns: 1fr; }
  .recommendation-table strong { border-bottom: 1px solid var(--line); }
}
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.credits td:last-child, .credits th:last-child { white-space: nowrap; }

/* --- filtres : masquage réel des cartes (.card est en display:flex) --- */
.card[hidden], #guide-grid .card[hidden] { display: none !important; }

/* --- navigation : tenir 8 entrées sans déborder --- */
.site-nav { gap: 18px; }
.site-nav a { font-size: .875rem; }
@media (max-width: 1150px) {
  .site-nav { gap: 14px; }
  .site-nav a { font-size: .84rem; }
}
