/* ============================================================================
 * aide.css — Centre d'aide public (accueil, sommaire latéral, chapitres, recherche)
 * Requiert : webcore.css, content.css
 * Une seule feuille pour tous les logiciels (plan 15) : les encadrés, tableaux et
 * étapes des chapitres sont stylés sous .aide-chapitre.
 * ==========================================================================*/
.aide-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem; /* 1rem = marge gauche/droite (smartphone) */
}
.aide-wrapper--large { max-width: 1200px; }

.aide-header { margin-bottom: 2rem; }
.aide-title {
    font-size: var(--font-h1);
    color: var(--color-text);
    margin: 0 0 0.75rem;
}
.aide-intro {
    color: var(--color-text-muted, var(--color-text));
    font-size: var(--font-base);
    line-height: 1.6;
    max-width: 65ch;
}
.aide-fil { color: var(--color-text-muted, var(--color-text)); margin: 0 0 1rem; font-size: 0.9rem; }
.aide-fil a { color: var(--color-primary, var(--color-text)); }
.aide-vide { color: var(--color-text-muted, var(--color-text)); }

/* ---------- Recherche ---------- */
.aide-recherche { display: flex; gap: 0.5rem; margin: 1rem 0; max-width: 520px; }
.aide-recherche input {
    flex: 1; min-width: 0; padding: 0.55rem 0.8rem;
    border: 1px solid var(--color-border); border-radius: var(--radius);
    background: var(--color-surface); color: var(--color-text); font: inherit;
}
.aide-recherche button {
    padding: 0.55rem 1rem; border: 0; border-radius: var(--radius); cursor: pointer;
    background: var(--color-primary, #0b5cad); color: #fff; font: inherit;
}

.aide-resultats { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.75rem; }
.aide-resultats a {
    display: block; padding: 0.9rem 1.1rem; text-decoration: none; color: var(--color-text);
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
}
.aide-resultats a:hover { border-color: var(--color-primary, var(--color-text)); }
.aide-resultats small { display: block; color: var(--color-text-muted, var(--color-text)); }
.aide-resultats span { display: block; margin-top: 0.25rem; color: var(--color-text-muted, var(--color-text)); font-size: 0.92rem; }

/* ---------- Accueil : cartes ---------- */
.aide-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.aide-carte {
    display: block; padding: 1.1rem 1.25rem; text-decoration: none; color: var(--color-text);
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
}
a.aide-carte:hover { border-color: var(--color-primary, var(--color-text)); }
.aide-carte b { display: block; font-size: 1.15rem; margin-bottom: 0.3rem; text-transform: capitalize; }
.aide-carte span { display: block; color: var(--color-text-muted, var(--color-text)); line-height: 1.5; }
.aide-carte small { display: block; margin-top: 0.6rem; color: var(--color-primary, var(--color-text)); }
.aide-carte--attente { opacity: 0.6; }

/* ---------- Chapitre : sommaire latéral + contenu ---------- */
.aide-disposition { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 2rem; align-items: start; }
.aide-menu {
    position: sticky; top: 5rem; padding: 1rem;
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
}
.aide-menu .aide-recherche { flex-direction: column; margin: 0 0 1rem; }
.aide-menu ol { list-style: none; margin: 0; padding: 0; }
.aide-menu a {
    display: block; padding: 0.4rem 0.6rem; border-radius: 6px;
    color: var(--color-text); text-decoration: none; font-size: 0.95rem;
}
.aide-menu a:hover { background: var(--color-border); }
.aide-menu a[aria-current="page"] { background: var(--color-primary, #0b5cad); color: #fff; font-weight: 600; }

.aide-chapitre { min-width: 0; }
.aide-chapitre h2 {
    font-size: var(--font-h2); color: var(--color-text);
    margin: 2rem 0 0.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--color-border);
    scroll-margin-top: 5rem;
}
.aide-chapitre h3 { font-size: var(--font-h3); color: var(--color-text); margin: 1.25rem 0 0.5rem; }
.aide-chapitre p, .aide-chapitre li, .aide-chapitre dd { line-height: 1.6; color: var(--color-text); }
.aide-chapitre p, .aide-chapitre li { max-width: 75ch; }
.aide-chapitre ul, .aide-chapitre ol { padding-left: 1.4rem; margin: 0 0 0.75rem; }
.aide-chapitre li { margin-bottom: 0.3rem; }
.aide-chapitre a { color: var(--color-primary, var(--color-text)); }
.aide-chapitre .chapeau { font-size: 1.1rem; color: var(--color-text-muted, var(--color-text)); }

.aide-chapitre code, .aide-chapitre kbd {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.9em;
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 4px; padding: 0.05em 0.4em;
}
.aide-chapitre pre { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.8rem 1rem; overflow-x: auto; }
.aide-chapitre pre code { border: 0; padding: 0; background: none; }
.aide-chapitre .ui { font-weight: 600; }

.aide-chapitre .defilement { overflow-x: auto; }
.aide-chapitre table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.95rem; }
.aide-chapitre th, .aide-chapitre td { border: 1px solid var(--color-border); padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; }
.aide-chapitre th { background: var(--color-surface); }
.aide-chapitre dt { font-weight: 700; margin-top: 1rem; }
.aide-chapitre dd { margin: 0.15rem 0 0; }

/* Encadrés : À savoir / Astuce / Attention / Danger */
.aide-chapitre .note, .aide-chapitre .astuce, .aide-chapitre .attention, .aide-chapitre .danger {
    --aide-encadre: #0b5cad;
    margin: 1.2rem 0; padding: 0.7rem 1rem; border-left: 4px solid var(--aide-encadre); border-radius: 6px;
    background: color-mix(in srgb, var(--aide-encadre) 12%, transparent);
}
.aide-chapitre .astuce    { --aide-encadre: #1d7a46; }
.aide-chapitre .attention { --aide-encadre: #c26a00; }
.aide-chapitre .danger    { --aide-encadre: #b3261e; }
.aide-chapitre .note::before, .aide-chapitre .astuce::before, .aide-chapitre .attention::before, .aide-chapitre .danger::before {
    display: block; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--aide-encadre);
}
.aide-chapitre .note::before { content: "À savoir"; }
.aide-chapitre .astuce::before { content: "Astuce"; }
.aide-chapitre .attention::before { content: "Attention"; }
.aide-chapitre .danger::before { content: "Danger"; }
.aide-chapitre .note p, .aide-chapitre .astuce p, .aide-chapitre .attention p, .aide-chapitre .danger p { margin: 0.3rem 0; }

/* Étapes numérotées */
.aide-chapitre ol.etapes { list-style: none; counter-reset: etape; padding: 0; }
.aide-chapitre ol.etapes > li { counter-increment: etape; position: relative; padding-left: 2.8rem; margin: 1rem 0; }
.aide-chapitre ol.etapes > li::before {
    content: counter(etape); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem;
    border-radius: 50%; background: var(--color-primary, #0b5cad); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 0.9rem;
}

/* Précédent / suivant */
.aide-navigation { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--color-border); }
.aide-navigation a {
    flex: 1; max-width: 48%; padding: 0.8rem 1rem; text-decoration: none; color: var(--color-text);
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
}
.aide-navigation a:hover { border-color: var(--color-primary, var(--color-text)); }
.aide-navigation small { display: block; color: var(--color-text-muted, var(--color-text)); }
.aide-navigation__suivant { text-align: right; margin-left: auto; }

@media (max-width: 900px) {
    .aide-disposition { grid-template-columns: 1fr; }
    .aide-menu { position: static; }
    .aide-navigation { flex-direction: column; }
    .aide-navigation a { max-width: none; }
}
