/* ==========================================================================
   help.css — #6.10 : Aide contextuelle (drawer + FAB)
   ========================================================================== */

/* ----- Bouton flottant "?" ----------------------------------------------- */
.help-fab {
  position: fixed;
  bottom: var(--s-4);
  right: var(--s-4);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-3);
  cursor: pointer;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.help-fab:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(0,0,0,0.2); }
.help-fab:focus-visible {
  outline: 3px solid var(--c-focus, var(--c-primary));
  outline-offset: 3px;
}

/* Sur mobile, remonter le FAB au-dessus de la mobile-nav */
@media (max-width: 768px) {
  .help-fab { bottom: calc(64px + var(--s-3)); right: var(--s-3); width: 48px; height: 48px; }
}

/* ----- Backdrop + drawer ------------------------------------------------- */
.help-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9500;
  opacity: 0;
  transition: opacity .22s ease;
  display: flex;
  justify-content: flex-end;
}
.help-backdrop--visible { opacity: 1; }

.help-drawer {
  width: min(460px, 100%);
  max-width: 100%;
  height: 100%;
  background: var(--c-bg-elev-1);
  color: var(--c-text);
  box-shadow: -4px 0 18px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s ease;
}
.help-drawer--visible { transform: translateX(0); }

.help-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4);
  border-bottom: 1px solid var(--c-border);
}
.help-drawer__head h2 { margin: 0; font-size: var(--fs-lg); }

.help-drawer__search {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-border);
}
.help-drawer__search .input { width: 100%; }

.help-drawer__results {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-3) var(--s-4);
}

.help-drawer__foot {
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--c-border);
  text-align: center;
  font-size: var(--fs-sm);
}

/* ----- Liste d'articles -------------------------------------------------- */
.help-section-title {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-text-muted);
  margin: var(--s-3) 0 var(--s-2);
  font-weight: 700;
}
.help-section-title:first-child { margin-top: 0; }

.help-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.help-article {
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  overflow: hidden;
}
.help-article__head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  padding: var(--s-3);
  background: transparent;
  border: none;
  text-align: left;
  color: var(--c-text);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--fs-md);
}
.help-article__head:hover { background: var(--c-bg-elev-1); }
.help-article__category {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--c-bg-elev-1);
  border-radius: var(--r-xs);
  flex-shrink: 0;
}
.help-article__title { flex: 1; font-weight: 500; line-height: var(--lh-tight); }
.help-article__chev {
  flex-shrink: 0;
  color: var(--c-text-muted);
  transition: transform .15s ease;
}
.help-article__head[aria-expanded="true"] .help-article__chev {
  transform: rotate(180deg);
}
.help-article__body {
  padding: 0 var(--s-3) var(--s-3);
  font-size: var(--fs-sm);
  color: var(--c-text);
  line-height: var(--lh-normal);
}
.help-article__body p { margin: 0 0 var(--s-2); }
.help-article__body p:last-child { margin-bottom: 0; }
.help-related {
  font-size: var(--fs-xs);
  padding-top: var(--s-2);
  border-top: 1px dashed var(--c-border);
  margin-top: var(--s-2);
  color: var(--c-text-muted);
}
.help-related a { color: var(--c-primary); }

/* ----- Mobile : drawer pleine largeur ----------------------------------- */
@media (max-width: 520px) {
  .help-drawer { width: 100%; }
}

/* ----- Dark mode : bordure un peu plus marquée -------------------------- */
[data-theme="dark"] .help-drawer { background: var(--c-bg-elev-1); }
[data-theme="dark"] .help-article { background: var(--c-bg); }

/* ----- Reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .help-backdrop, .help-drawer, .help-article__chev { transition: none; }
}
