/* avis-linkavista.com : Design system */

/* Tokens */
:root {
  --bg:            #ffffff;
  --bg-soft:       #f7f8fa;
  --bg-sunk:       #eef1f5;
  --surface:       #ffffff;
  --border:        #e2e6ec;
  --border-strong: #cbd2dc;

  --text:          #12161c;
  --text-soft:     #4a5361;
  --text-mute:     #6b7482;

  --brand:         #2b5cff;
  --brand-dark:    #1e42c4;
  --brand-soft:    #eaf0ff;

  --good:          #0f9d58;
  --good-soft:     #e6f6ee;
  --bad:           #d93025;
  --bad-soft:      #fdecea;
  --warn:          #b7791f;
  --warn-soft:     #fdf6e3;

  --star:          #f5a623;

  --radius:        12px;
  --radius-lg:     18px;
  --shadow:        0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
  --shadow-lg:     0 2px 4px rgba(16,24,40,.04), 0 12px 40px rgba(16,24,40,.10);

  --font:          "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --wrap:          1120px;
  --wrap-narrow:   760px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0d1117;
    --bg-soft:       #141a22;
    --bg-sunk:       #1b222c;
    --surface:       #151b24;
    --border:        #262e3a;
    --border-strong: #38424f;

    --text:          #e9edf3;
    --text-soft:     #b3bccb;
    --text-mute:     #8993a3;

    --brand:         #6b8fff;
    --brand-dark:    #8aa6ff;
    --brand-soft:    #1a2440;

    --good:          #35c07d;
    --good-soft:     #10261c;
    --bad:           #f0685e;
    --bad-soft:      #2b1512;
    --warn:          #e0a83a;
    --warn-soft:     #2a2110;

    --shadow:        0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    --shadow-lg:     0 2px 4px rgba(0,0,0,.3), 0 12px 40px rgba(0,0,0,.4);
  }
}

:root[data-theme="dark"] {
  --bg:            #0d1117;
  --bg-soft:       #141a22;
  --bg-sunk:       #1b222c;
  --surface:       #151b24;
  --border:        #262e3a;
  --border-strong: #38424f;
  --text:          #e9edf3;
  --text-soft:     #b3bccb;
  --text-mute:     #8993a3;
  --brand:         #6b8fff;
  --brand-dark:    #8aa6ff;
  --brand-soft:    #1a2440;
  --good:          #35c07d;
  --good-soft:     #10261c;
  --bad:           #f0685e;
  --bad-soft:      #2b1512;
  --warn:          #e0a83a;
  --warn-soft:     #2a2110;
  --shadow:        0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --shadow-lg:     0 2px 4px rgba(0,0,0,.3), 0 12px 40px rgba(0,0,0,.4);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.68;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.021em;
  margin: 0 0 .55em;
  font-weight: 750;
  color: var(--text);
}
h1 { font-size: clamp(2.05rem, 5.2vw, 3.15rem); letter-spacing: -0.032em; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.15rem); margin-top: 2.6em; }
h3 { font-size: clamp(1.18rem, 2.2vw, 1.4rem); margin-top: 2em; }
h4 { font-size: 1.05rem; margin-top: 1.6em; }

p  { margin: 0 0 1.15em; }
ul, ol { margin: 0 0 1.3em; padding-left: 1.35em; }
li { margin-bottom: .5em; }

strong { font-weight: 680; color: var(--text); }

::selection { background: var(--brand); color: #fff; }

:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

/* Layout */
.wrap   { max-width: var(--wrap);        margin-inline: auto; padding-inline: 22px; }
.narrow { max-width: var(--wrap-narrow); margin-inline: auto; }

section { scroll-margin-top: 84px; }

.rule { height: 1px; background: var(--border); border: 0; margin: 3.5rem 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 20px;
  min-height: 62px;
}
.logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 1.02rem; letter-spacing: -.032em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.logo-mark { flex-shrink: 0; border-radius: 9px; box-shadow: 0 1px 3px rgba(43,92,255,.32); }
.logo-text { line-height: 1; }
.logo-dash { color: var(--brand); }
.logo-tld  { color: var(--text-mute); font-weight: 700; }
@media (max-width: 430px) { .logo-tld { display: none; } }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a {
  font-size: .88rem; font-weight: 560; color: var(--text-soft);
  text-decoration: none; white-space: nowrap;
}
.nav a:hover { color: var(--text); }
@media (max-width: 900px) { .nav a.hide-sm { display: none; } }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-family: var(--font); font-weight: 640; font-size: .95rem; line-height: 1;
  padding: .92em 1.5em; border-radius: 10px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(43,92,255,.2), 0 6px 20px rgba(43,92,255,.28);
}
.btn-primary:hover { background: var(--brand-dark); color: #fff; }

.btn-ghost {
  background: var(--surface); color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }

.btn-sm { padding: .62em 1.05em; font-size: .84rem; border-radius: 8px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: .4em;
  font-size: .76rem; font-weight: 650; letter-spacing: .012em;
  padding: .36em .78em; border-radius: 100px;
  background: var(--bg-sunk); color: var(--text-soft);
  border: 1px solid var(--border);
}
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); border-color: transparent; }
.badge-good  { background: var(--good-soft);  color: var(--good);  border-color: transparent; }
.badge-bad   { background: var(--bad-soft);   color: var(--bad);   border-color: transparent; }
.badge-warn  { background: var(--warn-soft);  color: var(--warn);  border-color: transparent; }

/* Étoiles */
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars svg { width: 18px; height: 18px; }
.stars .on  { fill: var(--star); }
.stars .off { fill: var(--border-strong); }

/* Cartes */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Tableaux (scroll horizontal isolé) */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table { border-collapse: collapse; width: 100%; min-width: 680px; font-size: .92rem; }
thead th {
  background: var(--bg-sunk);
  font-weight: 660; font-size: .8rem; letter-spacing: .02em; text-transform: uppercase;
  color: var(--text-soft);
  text-align: left; padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
tbody td { padding: 13px 15px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-soft); }
tbody th { padding: 13px 15px; text-align: left; font-weight: 650; border-bottom: 1px solid var(--border); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-highlight { background: var(--brand-soft) !important; }

/* Pour / Contre */
.pros-cons { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.pc { border-radius: var(--radius-lg); padding: 24px; border: 1px solid var(--border); }
.pc h3 { margin-top: 0; font-size: 1.08rem; display: flex; align-items: center; gap: .5em; }
.pc ul { list-style: none; padding: 0; margin: 0; }
.pc li { position: relative; padding-left: 1.75em; margin-bottom: .7em; font-size: .95rem; line-height: 1.55; }
.pc li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.pc-pro { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 24%, transparent); }
.pc-pro h3 { color: var(--good); }
.pc-pro li::before { content: "✓"; color: var(--good); }
.pc-con { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 24%, transparent); }
.pc-con h3 { color: var(--bad); }
.pc-con li::before { content: "✕"; color: var(--bad); }

/* Encadrés */
.callout {
  border-left: 3px solid var(--brand);
  background: var(--bg-soft);
  padding: 18px 22px; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.8em 0; font-size: .96rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout-good { border-left-color: var(--good); background: var(--good-soft); }

/* Notes / scores */
.score-grid { display: grid; gap: 14px; }
.score-row { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; }
.score-label { font-size: .93rem; font-weight: 560; }
.score-val { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .93rem; white-space: nowrap; }
.bar { grid-column: 1 / -1; height: 7px; border-radius: 100px; background: var(--bg-sunk); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--brand), var(--brand-dark)); }

/* FAQ */
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 17px 20px; font-weight: 620; font-size: 1rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-size: 1.35rem; font-weight: 400; color: var(--text-mute);
  transition: transform .2s ease; line-height: 1; flex-shrink: 0;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq .faq-body { padding: 17px 20px; font-size: .96rem; color: var(--text-soft); }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* Sommaire */
.toc { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 26px; }
.toc h2 { margin: 0 0 .8em; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-mute); }
.toc ol { margin: 0; padding-left: 1.25em; columns: 2; column-gap: 34px; }
.toc li { margin-bottom: .5em; font-size: .93rem; break-inside: avoid; }
.toc a { text-decoration: none; color: var(--text-soft); }
.toc a:hover { color: var(--brand); text-decoration: underline; }
@media (max-width: 640px) { .toc ol { columns: 1; } }

/* Footer */
.site-footer {
  margin-top: 5rem; padding: 44px 0 34px;
  border-top: 1px solid var(--border); background: var(--bg-soft);
  font-size: .87rem; color: var(--text-mute);
}
.site-footer a { color: var(--text-soft); }

/* Utilitaires */
.muted   { color: var(--text-mute); }
.small   { font-size: .86rem; }
.center  { text-align: center; }
.mt-0    { margin-top: 0; }
.lead    { font-size: 1.16rem; line-height: 1.6; color: var(--text-soft); }
.stack > * + * { margin-top: 1rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Figures et graphiques */
.figure {
  margin: 2em 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px 20px;
}
.figure > svg { width: 100%; height: auto; display: block; }
.figure-head { margin-bottom: 16px; }
.figure-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  letter-spacing: -.015em; margin: 0 0 .25em; color: var(--text);
}
.figure-sub { font-size: .86rem; color: var(--text-mute); margin: 0; }
.figure figcaption {
  font-size: .8rem; color: var(--text-mute); margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.figure-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.figure-scroll > svg { min-width: 520px; }

/* Couleurs de data-viz : une seule teinte, intensite pour le highlight */
:root {
  --viz-bar:        #6f8fe0;
  --viz-bar-strong: #2b5cff;
  --viz-grid:       #e8ecf2;
  --viz-ink:        #4a5361;
  --viz-ink-mute:   #6b7482;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --viz-bar:        #5570b8;
    --viz-bar-strong: #6b8fff;
    --viz-grid:       #262e3a;
    --viz-ink:        #b3bccb;
    --viz-ink-mute:   #8993a3;
  }
}
:root[data-theme="dark"] {
  --viz-bar:        #5570b8;
  --viz-bar-strong: #6b8fff;
  --viz-grid:       #262e3a;
  --viz-ink:        #b3bccb;
  --viz-ink-mute:   #8993a3;
}

.viz-label      { font: 600 12.5px var(--font); fill: var(--viz-ink); }
.viz-label-hl   { font: 750 12.5px var(--font); fill: var(--text); }
.viz-value      { font: 700 12.5px var(--font); fill: var(--viz-ink); }
.viz-value-hl   { font: 800 12.5px var(--font); fill: var(--viz-bar-strong); }
.viz-axis       { font: 500 11px var(--font); fill: var(--viz-ink-mute); }
.viz-note       { font: 500 11px var(--font); fill: var(--viz-ink-mute); }
.viz-grid-line  { stroke: var(--viz-grid); stroke-width: 1; }
.viz-bar        { fill: var(--viz-bar); }
.viz-bar-strong { fill: var(--viz-bar-strong); }

/* Schema de fonctionnement */
.diagram-box    { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.diagram-box-hl { fill: var(--warn-soft); stroke: var(--warn); stroke-width: 1.5; }
.diagram-box-br { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1.5; }
.diagram-title  { font: 700 13px var(--font); fill: var(--text); }
.diagram-text   { font: 500 11.5px var(--font); fill: var(--text-soft); }
.diagram-arrow  { stroke: var(--border-strong); stroke-width: 1.8; fill: none; }
.diagram-arrow-hl { stroke: var(--warn); stroke-width: 1.8; fill: none; }

/* Pictogrammes des formats de liens */
.fmt-card { display: flex; gap: 14px; align-items: flex-start; }
.fmt-icon {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 11px;
  background: var(--brand-soft); display: grid; place-items: center;
}
.fmt-icon svg { width: 22px; height: 22px; stroke: var(--brand); fill: none;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Bloc partenaire de bas de page */
.promo {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(115deg, #1e42c4 0%, #2b5cff 55%, #5b7dff 100%);
  border-radius: var(--radius-lg); padding: 24px 26px;
  text-decoration: none; color: #fff;
  box-shadow: 0 2px 6px rgba(30,66,196,.22), 0 16px 44px rgba(30,66,196,.24);
  transition: transform .16s ease, box-shadow .22s ease;
}
.promo:hover {
  transform: translateY(-2px); color: #fff;
  box-shadow: 0 3px 8px rgba(30,66,196,.26), 0 22px 56px rgba(30,66,196,.32);
}
.promo-mark { flex-shrink: 0; line-height: 0; }
.promo-body { flex: 1; min-width: 230px; display: block; }
.promo-kicker {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; opacity: .78; margin-bottom: .3em;
}
.promo-title {
  display: block; font-family: var(--font-display); font-size: 1.3rem;
  font-weight: 780; letter-spacing: -.024em; line-height: 1.15; margin-bottom: .3em;
}
.promo-text { display: block; font-size: .9rem; line-height: 1.5; opacity: .9; }
.promo-cta {
  flex-shrink: 0; background: #fff; color: #1e42c4;
  font-weight: 680; font-size: .9rem; padding: .78em 1.35em;
  border-radius: 10px; white-space: nowrap;
}
@media (max-width: 620px) {
  .promo { padding: 22px; }
  .promo-cta { width: 100%; text-align: center; }
}
