/* ==========================================================================
   CENTRE DE RESSOURCES — DA minimaliste des pages modernisées (ct-/dl-/cc-)
   Le minimalisme vient de la RETENUE : filets au lieu des ombres et des
   cartes, rouge réservé aux accents, vert réservé aux liens et aux réussites.
   Tout est préfixé rs- ; cette feuille s'ajoute à style.css, elle ne le
   modifie pas. La sidebar, le fil d'Ariane, la pagination et la recherche
   sont construits par ressources.js à partir de ressources-nav.js : une
   page de doc ne décrit QUE son contenu.
   ========================================================================== */

:root {
  --rs-mono: ui-monospace, 'Cascadia Code', 'Consolas', 'SF Mono', Menlo, monospace;
  --rs-encre: var(--gris-fonce);
  --rs-corps: #6b6b6b;
}

/* ==========================================================================
   SQUELETTE — sidebar | contenu | « Sur cette page »
   ========================================================================== */
.rs-page { padding: calc(var(--header-h) + 46px) 0 110px; }
.rs-conteneur { width: min(1360px, 94%); margin-inline: auto; }

.rs-grille {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 196px;
  gap: 56px;
  align-items: start;
}
/* Sans min-width:0, un enfant de grid refuse de rétrécir sous la largeur de
   son contenu : une seule commande longue ferait déborder toute la page. */
.rs-grille > * { min-width: 0; }

/* ---------- Sidebar ---------- */
.rs-sidebar {
  position: sticky; top: calc(var(--header-h) + 10px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 14px 30px 2px;
  scrollbar-width: thin;
}
.rs-sidebar-titre {
  display: flex; align-items: baseline; gap: 8px;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14.5px;
  color: var(--rs-encre); padding-bottom: 16px;
}
.rs-sidebar-titre b { color: var(--rouge); font-weight: 600; }

.rs-nav-cat { margin-top: 22px; }
.rs-nav-cat:first-of-type { margin-top: 4px; }
.rs-nav-cat > p {
  font-family: 'Poppins', sans-serif; font-size: 10.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--sourdine);
  padding-bottom: 6px;
}
.rs-nav-cat ul { list-style: none; border-left: 1px solid var(--filet); }
.rs-nav-cat a {
  display: block; padding: 6px 12px;
  margin-left: -1px; border-left: 1px solid transparent;
  font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 500;
  color: var(--rs-corps); line-height: 1.45;
  transition: color .18s ease, border-color .18s ease;
}
.rs-nav-cat a:hover { color: var(--rs-encre); border-color: var(--sourdine); }
.rs-nav-cat li.rs-actif a {
  color: var(--rouge); border-color: var(--rouge); font-weight: 600;
}

/* ---------- Colonne « Sur cette page » ---------- */
.rs-toc {
  position: sticky; top: calc(var(--header-h) + 10px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto; padding-bottom: 30px;
  scrollbar-width: thin;
}
.rs-toc > p {
  font-family: 'Poppins', sans-serif; font-size: 10.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--sourdine);
  padding-bottom: 8px;
}
.rs-toc ul { list-style: none; border-left: 1px solid var(--filet); }
.rs-toc a {
  display: block; padding: 5px 12px;
  margin-left: -1px; border-left: 1px solid transparent;
  font-size: 12.5px; color: var(--rs-corps); line-height: 1.45;
  transition: color .18s ease, border-color .18s ease;
}
.rs-toc a:hover { color: var(--rs-encre); }
.rs-toc li.rs-vu a { color: var(--rouge); border-color: var(--rouge); }
.rs-toc li.rs-toc-h3 a { padding-left: 24px; font-size: 12px; }

/* ==========================================================================
   TÊTE DE PAGE — recherche + fil d'Ariane + titre
   ========================================================================== */
.rs-fil {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 500;
  color: var(--sourdine); margin-bottom: 22px;
}
.rs-fil a { color: var(--sourdine); transition: color .18s ease; }
.rs-fil a:hover { color: var(--rouge); }
.rs-fil span[aria-hidden] { color: #cfcfcf; }
.rs-fil b { color: var(--rs-encre); font-weight: 600; }

.rs-surtitre {
  font-family: 'Poppins', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--sourdine);
}
.rs-h1 {
  font-family: 'Poppins', sans-serif; font-weight: 500;
  font-size: clamp(2rem, 1.4rem + 2vw, 2.9rem);
  color: var(--rs-encre); letter-spacing: -.015em; line-height: 1.12;
  margin-top: 10px;
}
.rs-h1 b { font-weight: 600; color: var(--rouge); }
.rs-chapo { color: var(--rs-corps); line-height: 1.75; max-width: 640px; margin-top: 14px; }
.rs-chapo a, .rs-corps a { color: var(--vert); font-weight: 600; }
.rs-chapo a:hover, .rs-corps a:hover { text-decoration: underline; }

/* Méta sous le titre : version, source officielle, badges */
.rs-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 20px; padding-bottom: 28px; border-bottom: 1px solid var(--filet);
}
.rs-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--filet); border-radius: 36px; padding: 5px 13px;
  font-family: 'Poppins', sans-serif; font-size: 11.5px; font-weight: 600;
  color: var(--rs-corps); white-space: nowrap;
}
.rs-badge.rouge { border-color: rgba(219, 53, 53, .35); color: var(--rouge); }
.rs-badge.vert { border-color: rgba(134, 214, 41, .5); color: #64a41c; }
a.rs-badge:hover { border-color: var(--rouge); color: var(--rouge); }

/* ==========================================================================
   CORPS DE DOC — titres, prose, listes
   ========================================================================== */
.rs-corps { color: var(--rs-corps); line-height: 1.75; }
.rs-corps > * + * { margin-top: 16px; }

.rs-corps h2 {
  font-family: 'Poppins', sans-serif; font-weight: 600;
  font-size: 1.5rem; letter-spacing: -.01em; color: var(--rs-encre);
  margin-top: 58px; padding-top: 34px; border-top: 1px solid var(--filet);
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.rs-corps h2:first-child { margin-top: 34px; padding-top: 0; border-top: 0; }
.rs-corps h3 {
  font-family: 'Poppins', sans-serif; font-weight: 600;
  font-size: 1.1rem; color: var(--rs-encre);
  margin-top: 38px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.rs-corps h4 {
  font-family: 'Poppins', sans-serif; font-weight: 600;
  font-size: .95rem; color: var(--rs-encre); margin-top: 28px;
}
.rs-corps strong, .rs-corps b { color: var(--rs-encre); font-weight: 600; }
.rs-corps ul, .rs-corps ol { padding-left: 22px; }
.rs-corps li { margin-top: 7px; }
.rs-corps li::marker { color: var(--rouge); }

/* L'ancre ¶ n'apparaît qu'au survol du titre. */
.rs-ancre {
  margin-left: 10px; color: #d8d8d8; font-weight: 400; text-decoration: none;
  opacity: 0; transition: opacity .15s ease, color .15s ease;
}
h2:hover .rs-ancre, h3:hover .rs-ancre { opacity: 1; }
.rs-ancre:hover { color: var(--rouge); }

/* Code en ligne */
.rs-corps code, .rs-c {
  font-family: var(--rs-mono); font-size: .86em;
  background: var(--gris-clair); border-radius: 6px; padding: 2px 7px;
  color: var(--rs-encre); white-space: nowrap;
}

/* Touche clavier */
.rs-kbd {
  display: inline-block; font-family: var(--rs-mono); font-size: .8em;
  color: var(--rs-encre); background: #fff;
  border: 1px solid #d5d5d5; border-bottom-width: 2px; border-radius: 7px;
  padding: 2px 8px; margin: 0 1px; white-space: nowrap;
}

/* ==========================================================================
   FICHE COMMANDE — le cœur du centre. Un filet, la commande en mono,
   la description, l'usage en sourdine, et un bouton copier discret.
   ========================================================================== */
.rs-cmds { margin-top: 26px; border-top: 1px solid var(--filet); }
.rs-cmd { border-bottom: 1px solid var(--filet); padding: 18px 0 20px; }
.rs-cmd-l1 { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.rs-cmd-l1 code {
  font-family: var(--rs-mono); font-size: 14.5px; font-weight: 600;
  color: var(--rs-encre); background: none; padding: 0; white-space: pre-wrap;
}
.rs-cmd-l1 .rs-badge { padding: 3px 10px; font-size: 10.5px; }
.rs-copier {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1px solid transparent; border-radius: 36px;
  padding: 4px 11px; cursor: pointer;
  font-family: 'Poppins', sans-serif; font-size: 11px; font-weight: 600;
  color: var(--sourdine);
  transition: color .18s ease, border-color .18s ease, opacity .18s ease;
  opacity: 0;
}
.rs-cmd:hover .rs-copier, .rs-copier:focus-visible { opacity: 1; }
.rs-copier:hover { color: var(--rouge); border-color: var(--filet); }
.rs-copier.ok { color: #64a41c; border-color: rgba(134, 214, 41, .5); opacity: 1; }
/* Au doigt, pas de survol : le bouton reste visible. */
@media (hover: none) { .rs-copier { opacity: 1; } }

.rs-cmd p { margin-top: 8px; line-height: 1.7; }
.rs-usage {
  display: block; margin-top: 8px;
  font-family: var(--rs-mono); font-size: 12.5px; color: var(--sourdine);
  line-height: 1.7; white-space: pre-wrap;
}
.rs-usage b { color: var(--rs-corps); font-weight: 600; }

/* Bloc de code multi-lignes (suites de commandes, exemples complets) */
.rs-bloc {
  position: relative; margin-top: 18px;
  background: #fbfbfb; border: 1px solid var(--filet); border-radius: 14px;
  overflow: hidden;
}
.rs-bloc pre {
  overflow-x: auto; padding: 18px 20px;
  font-family: var(--rs-mono); font-size: 13px; line-height: 1.8;
  color: var(--rs-encre);
}
.rs-bloc .rs-copier { position: absolute; top: 10px; right: 10px; background: #fbfbfb; }
.rs-bloc:hover .rs-copier { opacity: 1; }
.rs-bloc-titre {
  display: block; padding: 10px 20px 0;
  font-family: 'Poppins', sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--sourdine);
}

/* ==========================================================================
   CALLOUTS — un filet coloré à gauche, pas de fond criard
   ========================================================================== */
.rs-note, .rs-astuce, .rs-attention {
  margin-top: 20px; padding: 14px 20px;
  border-left: 2px solid var(--sourdine);
  background: #fafafa; border-radius: 0 12px 12px 0;
  line-height: 1.7; font-size: 14.5px;
}
.rs-note b:first-child, .rs-astuce b:first-child, .rs-attention b:first-child {
  display: block; font-family: 'Poppins', sans-serif; font-size: 11px;
  font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 4px;
}
.rs-astuce { border-left-color: var(--vert); }
.rs-astuce b:first-child { color: #64a41c; }
.rs-attention { border-left-color: var(--rouge); }
.rs-attention b:first-child { color: var(--rouge); }
.rs-note b:first-child { color: var(--sourdine); }

/* ==========================================================================
   TABLEAUX — filets seuls, défilement horizontal auto
   ========================================================================== */
.rs-table { margin-top: 20px; overflow-x: auto; }
.rs-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rs-table th {
  text-align: left; font-family: 'Poppins', sans-serif; font-size: 11px;
  font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sourdine); padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--rs-encre);
  white-space: nowrap;
}
.rs-table td {
  padding: 11px 14px 11px 0; border-bottom: 1px solid var(--filet);
  line-height: 1.6; vertical-align: top;
}
.rs-table td code { white-space: nowrap; }

/* ==========================================================================
   ACCORDÉONS — le langage de la FAQ contact, repris tel quel
   ========================================================================== */
.rs-faq { margin-top: 26px; }
.rs-faq details { border-top: 1px solid var(--filet); }
.rs-faq details:last-of-type { border-bottom: 1px solid var(--filet); }
.rs-faq summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 19px 0;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1rem;
  color: var(--rs-encre); transition: color .25s ease;
}
.rs-faq summary::-webkit-details-marker { display: none; }
.rs-faq summary:hover { color: var(--rouge); }
.rs-faq summary::after { content: '+'; color: var(--sourdine); font-weight: 400; font-size: 1.5rem; line-height: 1; flex: none; }
.rs-faq details[open] summary { color: var(--rouge); }
.rs-faq details[open] summary::after { content: '−'; color: var(--vert); font-weight: 600; }
.rs-faq .rs-reponse { padding: 0 0 22px; line-height: 1.75; max-width: 680px; }
.rs-faq .rs-reponse > * + * { margin-top: 12px; }

/* ==========================================================================
   CARTES DU HUB — un bloc découpé par des filets (bento de la page contact)
   ========================================================================== */
.rs-cartes {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--filet);
  border: 1px solid var(--filet); border-radius: 22px; overflow: hidden;
  margin-top: 34px;
}
.rs-carte {
  position: relative; background: var(--blanc);
  padding: 28px; min-height: 168px;
  display: flex; flex-direction: column; gap: 8px;
  transition: background .25s ease;
}
.rs-carte:hover { background: #fafafa; }
.rs-carte-pic { font-size: 1.4rem; line-height: 1; }
.rs-carte-nom {
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1.1rem;
  color: var(--rs-encre); letter-spacing: -.01em; transition: color .25s ease;
}
a.rs-carte:hover .rs-carte-nom { color: var(--rouge); }
.rs-carte-sous { font-size: 13px; color: var(--rs-corps); line-height: 1.6; }
.rs-carte-nb {
  margin-top: auto; font-family: 'Poppins', sans-serif;
  font-size: 11.5px; font-weight: 600; color: var(--sourdine);
}
.rs-carte-fl {
  position: absolute; top: 26px; right: 26px;
  color: var(--sourdine); font-size: 13px;
  transition: color .25s ease, transform .25s ease;
}
a.rs-carte:hover .rs-carte-fl { color: var(--rouge); transform: translate(3px, -3px); }

/* Liste de fiches (index mods / plugins) : mêmes filets, en rangées. */
.rs-fiches { margin-top: 26px; border-top: 1px solid var(--filet); }
.rs-fiche {
  display: grid; grid-template-columns: 200px minmax(0, 1fr) auto;
  gap: 8px 24px; align-items: baseline;
  padding: 15px 0; border-bottom: 1px solid var(--filet);
}
.rs-fiche-nom {
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14.5px;
  color: var(--rs-encre);
}
a.rs-fiche-nom:hover, .rs-fiche-nom a:hover { color: var(--rouge); }
.rs-fiche-desc { font-size: 13.5px; color: var(--rs-corps); line-height: 1.6; }
.rs-fiche-liens { display: flex; gap: 12px; font-size: 12px; white-space: nowrap; }
.rs-fiche-liens a {
  font-family: 'Poppins', sans-serif; font-weight: 600; color: var(--sourdine);
  transition: color .18s ease;
}
.rs-fiche-liens a:hover { color: var(--rouge); }

/* ==========================================================================
   TUTORIELS — la fiche crédite avant tout : auteur, source, durée, niveau
   ========================================================================== */
.rs-tutos { margin-top: 26px; border-top: 1px solid var(--filet); }
.rs-tuto { padding: 24px 0 26px; border-bottom: 1px solid var(--filet); }
.rs-tuto-tete { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.rs-tuto-titre {
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1.15rem;
  color: var(--rs-encre); letter-spacing: -.01em;
}
a.rs-tuto-titre:hover { color: var(--rouge); }
.rs-tuto-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px;
  font-family: 'Poppins', sans-serif; font-size: 12px; color: var(--sourdine);
}
.rs-tuto-meta b { color: var(--rs-corps); font-weight: 600; }
.rs-tuto-meta span[aria-hidden] { color: #d5d5d5; }
.rs-tuto p { margin-top: 10px; font-size: 14.5px; line-height: 1.7; }
/* Le crédit n'est pas une petite ligne grise : c'est le sujet. */
.rs-credit {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px; border: 1px solid var(--filet); border-radius: 36px;
  padding: 6px 14px;
  font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600;
  color: var(--rs-corps);
}
.rs-credit:hover { border-color: var(--rouge); color: var(--rouge); }
.rs-credit em { font-style: normal; color: var(--sourdine); font-weight: 500; }

/* ==========================================================================
   VIDÉO — façade cliquable : rien ne se charge avant le clic
   ========================================================================== */
.rs-video {
  position: relative; margin-top: 20px;
  aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background: var(--gris-fonce);
  border: 1px solid var(--filet);
  cursor: pointer; width: 100%; display: block; padding: 0;
}
.rs-video img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .25s ease, transform .4s ease; }
.rs-video:hover img { opacity: 1; transform: scale(1.02); }
.rs-video::after {
  content: '▶'; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 1.5rem; padding-left: 4px;
  background: radial-gradient(circle at center, rgba(0,0,0,.35) 0%, transparent 60%);
}
.rs-video:hover::after { color: var(--vert); }
.rs-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rs-video.rs-video-on::after { display: none; }
.rs-video-legende { margin-top: 10px; font-size: 12.5px; color: var(--sourdine); }
.rs-video-legende b { color: var(--rs-corps); }

/* ==========================================================================
   PAGINATION — précédent / suivant
   ========================================================================== */
.rs-pagination {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-top: 70px; padding-top: 26px; border-top: 1px solid var(--filet);
}
.rs-pagination a {
  display: flex; flex-direction: column; gap: 5px;
  padding: 16px 18px; border: 1px solid var(--filet); border-radius: 14px;
  transition: border-color .2s ease, background .2s ease;
}
.rs-pagination a:hover { border-color: var(--rouge); background: #fefafa; }
.rs-pagination a.rs-suiv { text-align: right; grid-column: 2; }
.rs-pagination small {
  font-family: 'Poppins', sans-serif; font-size: 10.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--sourdine);
}
.rs-pagination b {
  font-family: 'Poppins', sans-serif; font-size: 14.5px; font-weight: 600;
  color: var(--rs-encre);
}
.rs-pagination a:hover b { color: var(--rouge); }

/* ==========================================================================
   RECHERCHE — champ dans la tête du contenu + résultats en direct
   ========================================================================== */
.rs-cherche { position: relative; max-width: 480px; margin-bottom: 34px; }
.rs-cherche input {
  width: 100%; border: 1px solid var(--filet); border-radius: 36px;
  background: #fbfbfb; padding: 12px 84px 12px 44px;
  font-family: 'Poppins', sans-serif; font-size: 13.5px; font-weight: 500;
  color: var(--rs-encre);
  transition: border-color .2s ease, background .2s ease;
}
.rs-cherche input:focus { outline: none; border-color: var(--rouge); background: #fff; }
.rs-cherche input::placeholder { color: #b5b5b5; }
.rs-cherche .rs-loupe {
  position: absolute; left: 18px; top: 50%; translate: 0 -52%;
  color: var(--sourdine); font-size: 1.05rem; pointer-events: none;
}
.rs-cherche .rs-raccourci {
  position: absolute; right: 14px; top: 50%; translate: 0 -50%;
  font-family: var(--rs-mono); font-size: 10.5px; color: var(--sourdine);
  border: 1px solid var(--filet); border-radius: 7px; padding: 2px 7px;
  background: #fff; pointer-events: none;
}

.rs-resultats {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 90;
  background: #fff; border: 1px solid var(--filet); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .1);
  max-height: min(430px, 60vh); overflow-y: auto; overscroll-behavior: contain;
  display: none;
}
.rs-resultats.on { display: block; }
.rs-resultats .rs-r-groupe {
  padding: 12px 18px 4px;
  font-family: 'Poppins', sans-serif; font-size: 10.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--sourdine);
}
.rs-resultats a {
  display: block; padding: 10px 18px;
  border-top: 1px solid #f4f4f4;
}
.rs-resultats a b {
  display: block; font-family: 'Poppins', sans-serif; font-size: 13.5px;
  font-weight: 600; color: var(--rs-encre);
}
.rs-resultats a span { display: block; font-size: 12.5px; color: var(--sourdine); line-height: 1.55; margin-top: 2px; }
.rs-resultats a mark { background: none; color: var(--rouge); font-weight: 700; }
.rs-resultats a:hover, .rs-resultats a.rs-sel { background: #fbf6f6; }
.rs-resultats a:hover b, .rs-resultats a.rs-sel b { color: var(--rouge); }
.rs-resultats .rs-r-vide { padding: 18px; font-size: 13.5px; color: var(--sourdine); }
.rs-resultats .rs-r-vide b { color: var(--rs-corps); }

/* ==========================================================================
   BARRE MOBILE — sommaire + recherche quand la sidebar disparaît
   ========================================================================== */
.rs-mobilebar { display: none; }
.rs-voile { display: none; }

@media (max-width: 1279px) {
  .rs-grille { grid-template-columns: 236px minmax(0, 1fr); }
  .rs-toc { display: none; }
}

@media (max-width: 1023px) {
  .rs-page { padding: calc(var(--header-h) + 26px) 0 80px; }
  .rs-grille { grid-template-columns: 1fr; gap: 0; }

  .rs-mobilebar {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 26px;
  }
  .rs-mobilebar button {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--filet); border-radius: 36px; background: #fff;
    padding: 10px 18px; cursor: pointer;
    font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 600;
    color: var(--rs-encre);
    transition: border-color .2s ease, color .2s ease;
  }
  .rs-mobilebar button:hover { border-color: var(--rouge); color: var(--rouge); }

  /* La sidebar devient un volet : fixe, au-dessus de la page. */
  .rs-sidebar {
    position: fixed; z-index: 300; top: 0; left: 0; bottom: 0;
    width: min(320px, 86vw); max-height: none;
    background: #fff; border-right: 1px solid var(--filet);
    padding: 26px 22px 40px;
    transform: translateX(-102%);
    transition: transform .28s ease;
  }
  .rs-sidebar.on { transform: none; }
  .rs-voile {
    display: block; position: fixed; inset: 0; z-index: 290;
    background: rgba(0, 0, 0, .3);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .rs-voile.on { opacity: 1; pointer-events: auto; }
}

@media (max-width: 640px) {
  /* Sur petit écran, le code en ligne préfère se couper que faire défiler. */
  .rs-corps code, .rs-c { white-space: normal; overflow-wrap: anywhere; }
  .rs-cmd-l1 code { overflow-wrap: anywhere; }
  .rs-usage { overflow-wrap: anywhere; }
  .rs-cartes { grid-template-columns: 1fr; }
  .rs-fiche { grid-template-columns: 1fr; gap: 4px; }
  .rs-pagination { grid-template-columns: 1fr; }
  .rs-pagination a.rs-suiv { grid-column: 1; }
  .rs-cherche { max-width: none; }
  .rs-cherche .rs-raccourci { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rs-sidebar, .rs-voile, .rs-video img { transition: none; }
}

/* ==========================================================================
   MODE SOMBRE — Centre de ressources
   Les tokens partagés (--blanc, --gris-clair, --gris-fonce, --sourdine,
   --filet) sont déjà basculés par style.css. Ici : --rs-corps (littéral
   #6b6b6b), les surfaces claires propres au centre (#fff, #fbfbfb, #fafafa)
   et les séparateurs très clairs. Le vert des liens/réussites reste tel quel.
   ========================================================================== */
:root[data-theme="dark"] { --rs-corps: #a9a8a5; }

/* Champs, pilules et surfaces blanches → charbon */
:root[data-theme="dark"] .rs-kbd,
:root[data-theme="dark"] .rs-cherche input,
:root[data-theme="dark"] .rs-cherche .rs-raccourci,
:root[data-theme="dark"] .rs-resultats,
:root[data-theme="dark"] .rs-mobilebar button,
:root[data-theme="dark"] .rs-sidebar { background: #242429; }
:root[data-theme="dark"] .rs-kbd { border-color: var(--filet); }
:root[data-theme="dark"] .rs-cherche input:focus { background: #2a2a30; }
/* En sombre la sidebar reçoit un fond charbon (règle ci-dessus) : sans rayon
   ni marge interne, c'est un bloc à angles vifs collé au contenu. On l'adoucit
   en carte — bords arrondis + un peu d'air. Desktop seul : sur mobile la
   sidebar est un volet plein écran (bord à bord), qui ne s'arrondit pas. */
@media (min-width: 1024px) {
  :root[data-theme="dark"] .rs-sidebar {
    border-radius: 16px;
    padding: 22px 18px 26px 20px;
  }
}

/* Blocs de code & callouts (ex-#fbfbfb / #fafafa) */
:root[data-theme="dark"] .rs-bloc,
:root[data-theme="dark"] .rs-bloc .rs-copier,
:root[data-theme="dark"] .rs-note,
:root[data-theme="dark"] .rs-astuce,
:root[data-theme="dark"] .rs-attention { background: #1b1b1e; }

/* Survols (ex-#fafafa / #fbf6f6 / #fefafa) */
:root[data-theme="dark"] .rs-carte:hover { background: #26262b; }
:root[data-theme="dark"] .rs-resultats a:hover,
:root[data-theme="dark"] .rs-resultats a.rs-sel { background: #2a2022; }
:root[data-theme="dark"] .rs-pagination a:hover { background: #201b1b; }
:root[data-theme="dark"] .rs-resultats a { border-top-color: var(--filet); }

/* La façade vidéo utilise var(--gris-fonce) (→ quasi-blanc en sombre) : on la
   repose sur une surface charbon, sinon flash blanc avant chargement. */
:root[data-theme="dark"] .rs-video { background: #242429; }

/* Séparateurs très clairs devenus invisibles sur charbon */
:root[data-theme="dark"] .rs-fil span[aria-hidden],
:root[data-theme="dark"] .rs-ancre,
:root[data-theme="dark"] .rs-tuto-meta span[aria-hidden] { color: #55555a; }
:root[data-theme="dark"] .rs-cherche input::placeholder { color: #6a6a6f; }
