/* ═══════════════════════════════════════════════════════════════════════════
   Documents officiels : page de choix et page de lecture.

   Mise en page de documentation : texte au centre, sommaire à droite qui suit
   la lecture. Le confort de lecture prime, d'où une colonne de texte étroite
   même sur un grand écran : une ligne de 200 caractères est illisible.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Page de choix ── */
.doc-grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 380px));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.doc-carte {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.35rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.doc-carte:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.18);
}

.doc-carte.vide { opacity: 0.62; cursor: default; }
.doc-carte.vide:hover { transform: none; border-color: var(--border-color); box-shadow: none; }

.doc-icone {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
    background: rgba(99, 102, 241, 0.14);
    color: var(--primary-color);
}

.doc-icone .material-symbols-outlined { font-size: 1.5rem; }
.doc-icone.bleu  { background: rgba(56, 189, 248, 0.14); color: #38bdf8; }
.doc-icone.rouge { background: rgba(248, 113, 113, 0.14); color: #f87171; }
.doc-icone.rose  { background: rgba(236, 72, 153, 0.14); color: #ec4899; }
.doc-icone.vert  { background: rgba(34, 197, 94, 0.14); color: #22c55e; }

.doc-carte h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.35rem; }
.doc-carte p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55; flex: 1; }

.doc-pied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.9rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.doc-compte { font-size: 0.78rem; font-weight: 700; }
.doc-attente { font-size: 0.75rem; font-weight: 700; opacity: 0.8; }

.doc-aide {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 1rem 1.2rem;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.doc-aide .material-symbols-outlined { color: var(--primary-color); flex: none; }
.doc-aide p { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.6; }

/* ── Page de lecture ── */
.lc-entete { margin-bottom: 1.75rem; }

.lc-retour {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 1rem;
}

.lc-retour:hover { color: var(--primary-color); }
.lc-retour .material-symbols-outlined { font-size: 1.1rem; }

.lc-entete h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; letter-spacing: -0.02em; }
.lc-entete p { color: var(--text-secondary); margin-top: 0.5rem; max-width: 62ch; line-height: 1.65; }

.lc-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.9rem; }

.lc-puce {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.lc-puce .material-symbols-outlined { font-size: 0.95rem; }

.lc-corps {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: clamp(1.5rem, 3vw, 3rem);
    align-items: start;
}

.lc-texte { max-width: 78ch; }

.lc-section { scroll-margin-top: calc(var(--nav-height) + 1.5rem); margin-bottom: 2.5rem; }

.lc-section h2 {
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 0.9rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-color);
}

.lc-texte p { line-height: 1.75; margin-bottom: 0.9rem; color: var(--text-primary); }
.lc-texte strong { font-weight: 800; }

.lc-liste { margin: 0 0 1rem 1.1rem; }
.lc-liste li { line-height: 1.7; margin-bottom: 0.45rem; }
.lc-liste li::marker { color: var(--primary-color); }

/* Une règle numérotée se lit mieux dans son propre cadre : on retrouve du
   regard celle qu'on cherche sans relire tout le paragraphe. */
.lc-regles { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.1rem; }

.lc-regle {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary-color);
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
}

.lc-regle-titre { font-weight: 800; font-size: 0.95rem; margin-bottom: 0.3rem; }
.lc-regle p { font-size: 0.9rem; color: var(--text-secondary); margin: 0; line-height: 1.65; }

.lc-lexique { display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 1.1rem; }

.lc-terme {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem 1.05rem;
}

.lc-terme dt { font-weight: 800; font-size: 0.95rem; color: var(--primary-color); margin-bottom: 0.25rem; }
.lc-terme dd { margin: 0; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; }

.lc-note {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    margin-bottom: 1.1rem;
    border: 1px solid;
}

.lc-note p { margin: 0; font-size: 0.9rem; line-height: 1.65; }
.lc-note .material-symbols-outlined { flex: none; font-size: 1.2rem; }
.lc-note.info      { background: rgba(99, 102, 241, 0.10); border-color: rgba(99, 102, 241, 0.3); }
.lc-note.info .material-symbols-outlined { color: var(--primary-color); }
.lc-note.attention { background: rgba(249, 115, 22, 0.10); border-color: rgba(249, 115, 22, 0.35); }
.lc-note.attention .material-symbols-outlined { color: #f97316; }
.lc-note.interdit  { background: rgba(248, 113, 113, 0.10); border-color: rgba(248, 113, 113, 0.35); }
.lc-note.interdit .material-symbols-outlined { color: #f87171; }

.lc-sommaire { position: sticky; top: calc(var(--nav-height) + 1.5rem); }

.lc-sommaire-titre {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.lc-sommaire nav { display: flex; flex-direction: column; gap: 0.1rem; }

.lc-sommaire a {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.4rem 0.7rem;
    border-left: 2px solid var(--border-color);
    line-height: 1.45;
}

.lc-sommaire a:hover { color: var(--text-primary); }
.lc-sommaire a.actif { color: var(--primary-color); border-left-color: var(--primary-color); font-weight: 700; }

.lc-vide { text-align: center; padding: 3.5rem 1rem; color: var(--text-secondary); }
.lc-vide .material-symbols-outlined { font-size: 2.8rem; opacity: 0.5; display: block; margin-bottom: 0.7rem; }
.lc-vide p { line-height: 1.65; max-width: 44ch; margin: 0 auto 1.2rem; }

.lc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.2rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    color: #fff;
    background: var(--gradient-primary);
}

@media (max-width: 1000px) {
    .lc-corps { grid-template-columns: 1fr; }
    /* Le sommaire passe au-dessus du texte : collé en bas d'un écran étroit,
       il se retrouvait après le document, donc jamais lu. */
    .lc-sommaire {
        position: static;
        order: -1;
        padding: 0.9rem 1rem;
        background: var(--background-secondary);
        border: 1px solid var(--border-color);
        border-radius: 14px;
    }
    .lc-sommaire nav { flex-direction: row; flex-wrap: wrap; gap: 0.35rem; }
    .lc-sommaire a { border-left: none; border: 1px solid var(--border-color); border-radius: 999px; }
    .lc-sommaire a.actif { border-color: var(--primary-color); }
}
