/* ============================================================================
   Aide contextuelle — bouton flottant et panneau latéral.

   Le bouton reste discret : c'est un recours, pas un élément de navigation.
   Le panneau s'ouvre par la droite et ne bloque pas la lecture de la page.
   ============================================================================ */

.aide-trigger {
    position: fixed;
    right: var(--space-5);
    bottom: var(--space-5);
    z-index: 850;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}
.aide-trigger:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    transform: translateY(-1px);
}
.aide-trigger:focus-visible { outline: var(--focus-ring); }

/* --------------------------------------------------------------- Panneau */

.aide { position: fixed; inset: 0; z-index: 900; }

.aide__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .35);
    animation: aideFade .18s ease-out;
}

.aide__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(430px, 92vw);
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: -12px 0 40px -12px rgba(17, 24, 39, .35);
    animation: aideSlide .22s cubic-bezier(.32, .72, 0, 1);
}

@keyframes aideFade  { from { opacity: 0; } }
@keyframes aideSlide { from { transform: translateX(28px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .aide__backdrop, .aide__panel { animation: none; }
    .aide-trigger:hover { transform: none; }
}

.aide__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}
.aide__eyebrow {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--color-primary);
    margin-bottom: 4px;
}
.aide__title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 650;
    line-height: 1.25;
}
.aide__close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.aide__close:hover { background: var(--color-surface-alt); color: var(--color-text); }
.aide__close:focus-visible { outline: var(--focus-ring); }

.aide__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--space-5);
}

.aide__resume {
    margin: 0 0 var(--space-5);
    font-size: var(--font-size-base);
    line-height: 1.65;
    color: var(--color-text);
}

.aide__points {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.aide__point dt {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-primary);
    margin-bottom: 3px;
}
.aide__point dd {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.6;
    color: var(--color-text);
}

/* ---- Tutoriel vidéo ---------------------------------------------------- */

.aide__tuto {
  margin: 0 0 var(--space-4);
}

/* Le cadre garde le rapport 16/9 quelle que soit la largeur du panneau.
   Sans lui, l'iframe prendrait une hauteur arbitraire et la vidéo
   s'afficherait dans une bande noire. */
.aide__tuto-cadre {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #0d0b1e;
  border: 1px solid var(--color-border);
}

.aide__tuto-cadre iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.aide__tuto-legende {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.aide__tuto-legende small {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Emplacement vidéo vide — n'apparaît que pour l'éditeur. */
.aide__tuto-vide {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border: 1px dashed var(--color-border-strong);
  border-radius: 10px;
  background: var(--color-surface-alt);
  color: var(--color-text);
  text-decoration: none;
}

.aide__tuto-vide:hover {
  border-color: var(--color-primary);
  border-style: solid;
}

.aide__tuto-vide-ico {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: .8rem;
}

.aide__tuto-vide strong { display: block; font-size: var(--font-size-sm); }
.aide__tuto-vide small {
  display: block;
  font-size: .75rem;
  color: var(--color-text-muted);
}

.aide__warn {
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--color-warning-light);
    border: 1px solid color-mix(in srgb, var(--color-warning) 35%, transparent);
}
.aide__warn-label {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #92400e;
    margin-bottom: 4px;
}
.aide__warn p { margin: 0; font-size: var(--font-size-sm); line-height: 1.6; }

.aide__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    font-size: var(--font-size-sm);
}

/* Empêche la page de défiler derrière le panneau. */
body.aide-open { overflow: hidden; }

/* Sur mobile, le bouton laisse la place aux actions principales. */
@media (max-width: 768px) {
    .aide-trigger { right: var(--space-3); bottom: var(--space-3); }
}

/* ==========================================================================
   Guides de fond

   Une colonne étroite et du texte suivi : ces pages se LISENT. Une mise en
   page de tableau de bord — cartes, colonnes, pastilles — inviterait à
   survoler, et c'est précisément ce qu'il ne faut pas faire ici.
   ========================================================================== */

.guide-intro {
  max-width: 42rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.guides-sommaire {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  max-width: 60rem;
}

.guide-carte {
  display: grid;
  gap: .4rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}

.guide-carte:hover { border-color: var(--accent, #1a7f5a); }

.guide-carte h2 { margin: 0; font-size: 1.02rem; }

.guide-carte p {
  margin: 0;
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.guide-carte__duree {
  font-size: .74rem;
  color: var(--text-muted);
  opacity: .8;
}

/* --- Le guide lui-même ---------------------------------------------------- */

.guide {
  /* 65 caractères environ : au-delà, l'œil perd la ligne au retour. */
  max-width: 40rem;
}

.guide__tete { margin-bottom: 2rem; }
.guide__tete h1 { margin: 0 0 .4rem; font-size: 1.5rem; }

.guide__accroche {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.guide__section { margin-bottom: 2rem; }

.guide__section h2 {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.08rem;
  margin: 0 0 .7rem;
}

.guide__numero {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent, #1a7f5a);
  color: #fff;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.guide__section p {
  margin: 0 0 .85rem;
  line-height: 1.7;
}

.guide__retenir {
  padding: 1.1rem 1.35rem;
  background: var(--bg);
  border-left: 3px solid var(--accent, #1a7f5a);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.5rem;
}

.guide__retenir h2 { margin: 0 0 .6rem; font-size: .95rem; }

.guide__retenir ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: .35rem;
  line-height: 1.55;
}

.guide__suite {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
