/* Guide utilisateur du portail DGH.

   La coque - barre du haut, navigation laterale, page - vient de
   `portal.css` : ce sont les memes classes que le portail, pas des
   imitations. Ce fichier ne couvre que ce que le portail n'a pas :
   le texte redige, la recherche instantanee et l'agrandissement des
   captures. Il reprend les variables du portail, sans en redefinir. */

/* ---- Numero de rubrique, dans la nav et les resultats ---- */
.guide-num {
    display: inline-grid;
    place-items: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 .25rem;
    border-radius: 6px;
    background: var(--dgh-primary-50, #e8f3ec);
    color: var(--dgh-primary, #1b5e20);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
}
.dgh-nav-item.active .guide-num {
    background: var(--dgh-primary, #1b5e20);
    color: #fff;
}

/* ---- Recherche instantanee ---- */
.guide-recherche { position: relative; }
.guide-recherche-champ { cursor: text; margin: 0; }
.guide-recherche-saisie {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    outline: none;
    font: inherit;
    color: inherit;
}
.guide-recherche-saisie::-webkit-search-cancel-button { appearance: none; }
.guide-recherche-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: min(460px, 92vw);
    max-height: 70vh;
    overflow-y: auto;
    padding: .3rem;
    background: var(--dgh-surface, #fff);
    border: 1px solid var(--dgh-border, #e4e9e5);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(16, 24, 40, .14);
    z-index: 1040;
}
.guide-recherche-item {
    display: block;
    padding: .55rem .65rem;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}
.guide-recherche-item.actif { background: var(--dgh-primary-50, #e8f3ec); }
.guide-recherche-item:hover { text-decoration: none; }
.guide-recherche-tete {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
    margin-bottom: .15rem;
}
.guide-recherche-tete strong { font-size: .92rem; }
.guide-recherche-groupe {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--dgh-text-muted, #7a857d);
}
.guide-recherche-extrait {
    display: block;
    font-size: .82rem;
    line-height: 1.45;
    color: var(--dgh-text-secondary, #47534b);
}
.guide-recherche-extrait mark,
.guide-resultat-extrait mark {
    background: #fff3cd;
    padding: 0 .12rem;
    border-radius: 3px;
}
.guide-recherche-info {
    padding: .7rem .75rem;
    font-size: .85rem;
    color: var(--dgh-text-muted, #7a857d);
}

/* ---- Sommaire et resultats, en cartes du portail ---- */
.guide-cartes { display: flex; flex-direction: column; gap: .5rem; }
.guide-carte,
.guide-resultat {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .8rem .95rem;
    border: 1px solid var(--dgh-border, #e4e9e5);
    border-radius: 10px;
    background: var(--dgh-surface, #fff);
    color: inherit;
    text-decoration: none;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.guide-carte:hover,
.guide-resultat:hover {
    border-color: var(--dgh-primary-200, #b7d8bb);
    box-shadow: 0 4px 14px rgba(27, 94, 32, .09);
    transform: translateY(-1px);
    text-decoration: none;
}
.guide-resultat { flex-direction: column; align-items: stretch; }
.guide-carte-texte { flex: 1; min-width: 0; }
.guide-carte-texte strong { display: block; font-size: .95rem; }
.guide-carte-texte small {
    display: block;
    font-size: .82rem;
    line-height: 1.45;
    color: var(--dgh-text-muted, #7a857d);
}
.guide-carte-fleche { color: var(--dgh-text-muted, #7a857d); }
.guide-resultat-tete { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; }
.guide-resultat-groupe {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--dgh-text-muted, #7a857d);
}
.guide-resultat-extrait { margin: 0; font-size: .86rem; color: var(--dgh-text-secondary, #47534b); }
.guide-resultats { display: flex; flex-direction: column; gap: .5rem; }
.guide-compte { color: var(--dgh-text-secondary, #47534b); margin-bottom: 1rem; }
.guide-vide {
    padding: 1.3rem;
    border: 1px dashed var(--dgh-border, #e4e9e5);
    border-radius: 10px;
    background: var(--dgh-bg, #f7f9f7);
    color: var(--dgh-text-secondary, #47534b);
}

/* ---- Texte redige par la DGH ---- */
.guide-article { max-width: 880px; }
.guide-fil { display: flex; gap: .4rem; font-size: .82rem; color: var(--dgh-text-muted, #7a857d); margin-bottom: .8rem; }
.guide-h1 { display: flex; align-items: center; gap: .7rem; font-size: 1.7rem; line-height: 1.25; margin: 0 0 .5rem; }
.guide-h1-num {
    flex: none;
    width: 2.1rem; height: 2.1rem;
    border-radius: 9px;
    display: grid; place-items: center;
    background: var(--dgh-primary, #1b5e20);
    color: #fff;
    font-size: 1rem; font-weight: 700;
}
.guide-h2 { font-size: 1.05rem; margin: 2rem 0 .75rem; color: var(--dgh-text-secondary, #47534b); }
.guide-chapo { font-size: 1rem; color: var(--dgh-text-secondary, #47534b); margin: 0 0 1.5rem; }
.guide-bloc { margin-bottom: 1.6rem; }
.guide-intro { margin-bottom: 1.8rem; }

.guide-redige { line-height: 1.65; }
.guide-redige h3 { font-size: 1.02rem; margin: 1.7rem 0 .55rem; }
.guide-redige h4 { font-size: .94rem; margin: 1.2rem 0 .45rem; color: var(--dgh-text-secondary, #47534b); }
.guide-redige ul, .guide-redige ol { padding-left: 1.3rem; }
.guide-redige li { margin-bottom: .28rem; }
.guide-redige table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .9rem; }
.guide-redige th, .guide-redige td {
    border: 1px solid var(--dgh-border, #e4e9e5);
    padding: .5rem .65rem;
    text-align: left;
}
.guide-redige th { background: var(--dgh-bg, #f7f9f7); font-weight: 600; }
.guide-redige .ui {
    background: var(--dgh-bg, #f7f9f7);
    border: 1px solid var(--dgh-border, #e4e9e5);
    border-radius: 5px;
    padding: .05rem .35rem;
    font-size: .88em;
    font-weight: 600;
}
.guide-redige .callout {
    border: 1px solid var(--dgh-border, #e4e9e5);
    border-left: 4px solid var(--dgh-primary, #1b5e20);
    border-radius: 8px;
    padding: .8rem 1rem;
    margin: 1.2rem 0;
    background: var(--dgh-bg, #f7f9f7);
}
.guide-redige .callout .ct { font-weight: 700; margin-bottom: .2rem; }
.guide-redige .callout.info { border-left-color: #2d6cb5; background: #eef4fb; }
.guide-redige .callout.warn { border-left-color: #b7791f; background: #fff7e6; }
.guide-redige figure { margin: 1.4rem 0; }
.guide-redige .shot {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--dgh-border, #e4e9e5);
    border-radius: 10px;
    background: none;
    cursor: zoom-in;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.guide-redige .shot:hover {
    border-color: var(--dgh-primary-200, #b7d8bb);
    box-shadow: 0 4px 14px rgba(27, 94, 32, .09);
}
.guide-redige .shot img { display: block; width: 100%; height: auto; }
.guide-redige figcaption {
    font-size: .82rem;
    color: var(--dgh-text-muted, #7a857d);
    margin-top: .4rem;
    text-align: center;
}

/* ---- Rubrique precedente / suivante ---- */
.guide-pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.6rem;
    padding-top: 1.3rem;
    border-top: 1px solid var(--dgh-border, #e4e9e5);
}
.guide-pager-lien {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem .9rem;
    border: 1px solid var(--dgh-border, #e4e9e5);
    border-radius: 10px;
    background: var(--dgh-surface, #fff);
    color: inherit;
    text-decoration: none;
    max-width: 48%;
    transition: border-color .2s ease, transform .2s ease;
}
.guide-pager-lien:hover {
    border-color: var(--dgh-primary-200, #b7d8bb);
    transform: translateY(-1px);
    text-decoration: none;
}
.guide-pager-suite { margin-left: auto; text-align: right; }
.guide-pager-lien small {
    display: block;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--dgh-text-muted, #7a857d);
}
.guide-pager-lien strong { display: block; font-size: .88rem; }

/* ---- Agrandissement d'une capture ---- */
.guide-loupe {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(13, 31, 14, .82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.guide-loupe[hidden] { display: none; }
.guide-loupe img { max-width: 100%; max-height: 92vh; border-radius: 8px; }
.guide-loupe-fermer {
    position: absolute;
    top: 1rem;
    right: 1.4rem;
    border: 0;
    background: none;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 991.98px) {
    .guide-pager { flex-direction: column; }
    .guide-pager-lien { max-width: 100%; }
    .guide-pager-suite { margin-left: 0; text-align: left; }
    .guide-recherche-menu { width: min(460px, 92vw); right: -40px; }
}

/* ---- Cartes de choix du guide ---- */
.guide-carte-guide { padding: 1.1rem 1.2rem; }
.guide-carte-icone {
    flex: none;
    width: 2.6rem; height: 2.6rem;
    border-radius: 10px;
    display: grid; place-items: center;
    background: var(--dgh-primary-50, #e8f3ec);
    color: var(--dgh-primary, #1b5e20);
    font-size: 1.15rem;
}
.guide-carte-sous {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--dgh-text-muted, #7a857d);
    margin-bottom: .15rem;
}

/* ---- Texte redige : la livraison 2 utilise h2 et des tableaux larges ---- */
.guide-redige h2 {
    font-size: 1.12rem;
    margin: 1.9rem 0 .6rem;
    padding-bottom: .3rem;
    border-bottom: 1px solid var(--dgh-border, #e4e9e5);
}
.guide-redige table { display: block; overflow-x: auto; white-space: normal; }
.guide-redige img { max-width: 100%; height: auto; border-radius: 10px; display: block; }
.guide-redige figure img { border: 1px solid var(--dgh-border, #e4e9e5); }
