/* =========================================================
   MyCodeSolution – pages "Liste des questions" et solutions (v2)
   Même système que l'accueil : sombre par défaut, clair au choix.
   ========================================================= */
:root, html[data-theme="dark"] {
  --ink: #14161b; --panel: #1c1f26; --panel-2: #22262e; --line: #2c313b; --line-strong: #3a404c;
  --text: #eef0f4; --muted: #9aa1ad; --soft: #c9ced7;
  --mint: #5ef0a8; --mint-text: #5ef0a8; --mint-ink: #0c2b1d; --amber: #ffc24b;
  --code-bg: #0f1115; --header-bg: rgba(20,22,27,.82); --bar-bg: rgba(28,31,38,.94);
  --k: #ff7ab6; --s: #9ee493; --c: #6b7280; --n: #f9c97c; --t: #7cc4ff; --p: #c9ced7;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --wrap: 1200px;
  color-scheme: dark;
}
html[data-theme="light"] {
  --ink: #f6f7f9; --panel: #ffffff; --panel-2: #f0f2f5; --line: #e2e5ea; --line-strong: #cfd4dc;
  --text: #14161b; --muted: #5a6270; --soft: #2b2f37;
  --mint: #4fe39c; --mint-text: #0a8a52; --mint-ink: #08291a; --amber: #b7791f;
  --code-bg: #f3f5f8; --header-bg: rgba(246,247,249,.86); --bar-bg: rgba(255,255,255,.95);
  --k: #c2185b; --s: #2e7d32; --c: #8a9099; --n: #b25d00; --t: #1565c0; --p: #2b2f37;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.sv2 { margin: 0; background: var(--ink); color: var(--text); font: 16px/1.65 var(--body); -webkit-font-smoothing: antialiased; }
.sv2 a { color: inherit; }
.sv2 img { max-width: 100%; }
.sv2 ::selection { background: var(--mint); color: var(--mint-ink); }
.sv2 :focus-visible { outline: 2px solid var(--mint-text); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--mint); color: var(--mint-ink); border-radius: 8px; }
.skip:focus { left: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sv2 h1, .sv2 h2, .sv2 h3 { font-family: var(--display); letter-spacing: -.025em; text-wrap: balance; }
.sv2 p { text-wrap: pretty; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 13px 22px; border-radius: 12px;
  font-weight: 700; font-size: 15.5px; text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), filter .18s, border-color .18s, background-color .18s; }
.btn:active { transform: scale(.97); }
.btn i { font-size: 1.15em; }
.btn-primary { background: var(--mint); color: var(--mint-ink) !important; box-shadow: 0 8px 20px -10px rgba(0,0,0,.55); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text) !important; border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--text); }
.btn-sm { padding: 9px 15px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }

/* En-tête */
.top { position: sticky; top: 0; z-index: 40; background: var(--header-bg); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); }
.top-in { max-width: var(--wrap); margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 20px; font-weight: 500; letter-spacing: -.02em; color: var(--muted) !important; white-space: nowrap; }
.brand b { color: var(--text); font-weight: 700; }
.brand img { border-radius: 7px; }
.brand span { display: inline-flex; gap: 5px; }
.top-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.top-nav a { padding: 7px 11px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14.5px; white-space: nowrap; }
.top-nav a:hover { color: var(--text); background: var(--panel); }
.top-nav a.ico { font-size: 16px; padding: 7px 9px; }
.top-nav a.ico:hover .fa-youtube { color: #ff0033; }
.top-nav a.ico:hover .fa-telegram { color: #29a9eb; }
.top-tools { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.lang-switch a { padding: 5px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--text); }
.theme-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 15px; }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle .fa-sun { display: none; }
html[data-theme="light"] .theme-toggle .fa-sun { display: inline; }
html[data-theme="light"] .theme-toggle .fa-moon { display: none; }

/* Mise en page : article + carte d'installation collante */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding-top: 40px; padding-bottom: 72px; align-items: start; }
.side { position: sticky; top: 84px; }
.side-card { padding: 24px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 20px 40px -24px rgba(0,0,0,.6); }
.side-card img { border-radius: 13px; display: block; }
.side-t { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; margin: 14px 0 6px; }
.side-p { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; line-height: 1.55; }
.side-card ul { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 7px; font-size: 14px; color: var(--soft); }
.side-card li i { color: var(--mint-text); width: 16px; }
.side-r { margin: 12px 0 0; text-align: center; color: var(--amber); font-weight: 600; font-size: 13.5px; }

/* Article */
.article { min-width: 0; max-width: 760px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs i { font-size: 9px; opacity: .6; }
.article h1 { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.08; font-weight: 700; margin: 0 0 16px; }
.article h2 { font-size: 1.55rem; line-height: 1.2; font-weight: 700; margin: 46px 0 14px; }
.article h3 { font-size: 1.12rem; font-weight: 600; margin: 26px 0 8px; letter-spacing: -.01em; }
.article p { color: var(--soft); margin: 0 0 14px; max-width: 70ch; }
.lead { font-size: 1.12rem; color: var(--muted) !important; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 24px; font-size: 13px; color: var(--muted); }
.meta .date { margin-left: auto; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; }
.d-easy { background: #1f9d5c; } .d-medium { background: #d4851a; } .d-hard { background: #d9473f; } .d-very-hard { background: #a23a8d; }
.tag { padding: 3px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.answer { padding: 18px 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 8px; }
.answer strong { display: block; font-family: var(--display); font-size: 15px; color: var(--mint-text); margin-bottom: 4px; }
.answer p { margin: 0; color: var(--text) !important; font-size: 16.5px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 56px; border-radius: 12px; border: 1px solid var(--line); }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mint); color: var(--mint-ink); font-weight: 700; font-size: 13px; }
.steps strong, .pitfalls strong { display: block; color: var(--text); margin-bottom: 2px; }
.steps span, .pitfalls span { color: var(--soft); font-size: 15px; }
.cx { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cx div { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); display: flex; gap: 10px; align-items: baseline; }
.cx span { color: var(--muted); font-size: 13px; }
.cx code { font-family: var(--mono); font-size: 15px; color: var(--text); }
.fix { padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 14.5px; }
.fix strong { color: var(--amber); }
.code-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); margin: 6px 0 4px; }
.code-tabs button { border: 0; background: transparent; color: var(--muted); font: 600 13.5px var(--body); padding: 7px 13px; border-radius: 8px; cursor: pointer; }
.code-tabs button[aria-selected="true"] { background: var(--ink); color: var(--text); }
.code { position: relative; }
.code pre { margin: 0; padding: 18px 20px; border-radius: 14px; background: var(--code-bg) !important; border: 1px solid var(--line) !important;
  font: 13.5px/1.6 var(--mono); color: var(--p); overflow-x: auto; white-space: pre; tab-size: 4; }
.copy { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.copy:hover { color: var(--text); }
/* Coloration (prettify) aux couleurs du thème */
.code .pln { color: var(--p); } .code .kwd { color: var(--k); } .code .str { color: var(--s); } .code .com { color: var(--c); font-style: italic; }
.code .typ { color: var(--t); } .code .lit { color: var(--n); } .code .pun, .code .opn, .code .clo { color: var(--muted); } .code .tag { color: var(--k); background: none; border: 0; padding: 0; }
.code .atn { color: var(--t); } .code .atv { color: var(--s); } .code .dec { color: var(--n); }
.pitfalls { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pitfalls li { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); border-left-width: 1px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; color: var(--mint-text); }
.faq details p { margin: 10px 0 0; }
.rels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rel { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; font-weight: 600;
  transition: transform .2s, border-color .2s; }
.rel:hover { transform: translateY(-2px); border-color: var(--mint-text); }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14.5px; }
.pager a { color: var(--muted); text-decoration: none; }
.pager a:hover { color: var(--text); }

/* Index */
.idx-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin: 22px 0 28px; }
.idx-cta > span { color: var(--amber); font-weight: 600; font-size: 14px; }
.lang-link { color: var(--muted); font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.filters button { border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: 600 14px var(--body); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.filters button span { opacity: .6; margin-left: 4px; }
.filters button[aria-pressed="true"] { background: var(--text); color: var(--ink); border-color: var(--text); }
.cat { margin-top: 34px; }
.cat-h { display: flex; align-items: center; gap: 10px; }
.cat-h h2 { margin: 0; }
.cat > p { color: var(--muted) !important; margin: 6px 0 16px; }
.pz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pz { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-decoration: none;
  transition: transform .2s, border-color .2s; }
.pz:hover { transform: translateY(-2px); border-color: var(--mint-text); }
.pz-t { font-weight: 700; color: var(--text); }
.pz-c { font-size: 13px; color: var(--muted); }
.pz-l { font-size: 12px; color: var(--mint-text); font-weight: 600; }

/* Pied de page : les extensions */
.foot { border-top: 1px solid var(--line); background: var(--panel); padding: 64px 0 120px; }
html[data-theme="light"] .foot { background: #eef0f3; }
.foot h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 0 0 8px; }
.foot-intro { color: var(--muted); margin: 0 0 26px; max-width: 60ch; }
.fx-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; }
.fx-card { padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--ink); display: flex; flex-direction: column; }
.fx-card.is-main { border-color: var(--mint-text); }
.fx-card img { border-radius: 12px; }
.fx-card h3 { margin: 12px 0 6px; font-size: 1.15rem; }
.fx-card p { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; flex: 1; }
.fx-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fx-link { color: var(--muted); font-size: 14px; }
.foot-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-right: auto; }
.foot-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.foot-links a:hover { color: var(--text); }
.foot-links i { margin-right: 4px; }
.foot-legal { width: 100%; color: var(--muted); font-size: 12.5px; margin: 0; }

/* Barre d'installation collante (toujours là sur mobile) */
.sticky-install { position: fixed; z-index: 50; left: 12px; right: 12px; bottom: 12px; display: none; align-items: center; gap: 12px;
  padding: 10px 10px 10px 12px; border-radius: 16px; background: var(--bar-bg); border: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); box-shadow: 0 18px 40px -12px rgba(0,0,0,.6); }
.sticky-install img { border-radius: 9px; }
.sticky-install-rate { color: var(--amber); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.sticky-install a { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; background: var(--mint); color: var(--mint-ink); font-weight: 700; text-decoration: none; white-space: nowrap; }

/* Responsive */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: none; }
  .sticky-install { display: flex; }
  .top-nav a:not(.ico) { display: none; }
}
@media (max-width: 760px) {
  .wrap, .top-in { padding-left: 16px; padding-right: 16px; }
  .top-in { gap: 10px; }
  .top-nav { gap: 0; }
  .top-tools .btn span { display: none; }
  .brand { font-size: 17px; }
  .layout { padding-top: 24px; }
  .meta .date { margin-left: 0; }
  .rels, .fx-grid { grid-template-columns: 1fr; }
  .article h2 { margin-top: 36px; }
}
@media (max-width: 420px) { .sticky-install-rate { display: none; } .lang-switch a { padding: 5px 7px; } }
@media (prefers-reduced-motion: reduce) { .sv2 * { transition: none !important; } html { scroll-behavior: auto; } }
@media (prefers-reduced-transparency: reduce) { .top, .sticky-install { background: var(--panel); backdrop-filter: none; } }
