/*
 * Guide d'utilisation public (vitrine/guide.php). Préfixe gd-. S'appuie sur les jetons de site.css (--sx-*).
 * Mobile d'abord : onglets défilants, sommaire repliable ; deux colonnes à partir de 992 px.
 */

/* ---------- En-tête + recherche ---------- */
.gd-hero { background: var(--sx-cream); border-bottom: 1px solid var(--sx-line); padding: 1.6rem 0 2rem; }
.gd-hero h1 { font-size: var(--sx-fs-t40); font-weight: 800; color: var(--sx-navy); line-height: 1.1; margin: 0 0 .6rem; }
.gd-hero .sx-lead { margin: 0; }

.gd-search { position: relative; max-width: 640px; margin-top: 1.4rem; }
.gd-search[hidden] { display: none; }
.gd-search-ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--sx-muted); display: inline-flex; pointer-events: none; }
.gd-search-ico .sx-i { width: 18px; height: 18px; }
.gd-search input {
    width: 100%; box-sizing: border-box; min-height: 52px; padding: .8rem 1rem .8rem 46px;
    font: inherit; font-size: var(--sx-fs-16); color: var(--sx-text);
    background: var(--sx-white); border: 1px solid var(--sx-line-strong); border-radius: var(--sx-r-sm);
    box-shadow: var(--sx-shadow-sm);
}
.gd-search input:focus { outline: 3px solid rgba(12, 108, 208, .35); outline-offset: 1px; border-color: var(--sx-action); }
.gd-results {
    position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
    background: var(--sx-white); border: 1px solid var(--sx-line); border-radius: var(--sx-r-sm); box-shadow: var(--sx-shadow);
    max-height: min(420px, 60vh); overflow-y: auto;
}
.gd-results[hidden] { display: none; }
.gd-results li a { display: block; padding: .6rem .75rem; border-radius: 6px; color: var(--sx-text); text-decoration: none; }
.gd-results li a strong { display: block; color: var(--sx-navy); font-weight: 700; }
.gd-results li a small { display: block; color: var(--sx-muted); font-size: var(--sx-fs-14); }
.gd-results li a mark { background: var(--sx-gold-pale); color: inherit; padding: 0 1px; border-radius: 2px; }
.gd-results li[aria-selected="true"] a, .gd-results li a:hover { background: var(--sx-action-pale); }
.gd-results .gd-noresult { padding: .7rem .75rem; color: var(--sx-text-mid); font-size: var(--sx-fs-14); }
.gd-tag { display: inline-block; font-size: var(--sx-fs-12); font-weight: 700; color: var(--sx-sage-ink); margin-left: .35rem; }

/* ---------- Onglets ---------- */
.gd-tabs { position: sticky; top: var(--sx-header); z-index: 20; background: var(--sx-white); border-bottom: 1px solid var(--sx-line); }
.gd-tabs ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.gd-tabs a {
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; min-height: 48px; padding: 0 14px;
    color: var(--sx-text-mid); font-weight: 600; font-size: var(--sx-fs-14); text-decoration: none;
    border-bottom: 3px solid transparent;
}
.gd-tabs a .sx-i { width: 16px; height: 16px; }
.gd-tabs a:hover { color: var(--sx-navy); background: var(--sx-cream); }
.gd-tabs a[aria-current="page"] { color: var(--sx-action); border-bottom-color: var(--sx-action); }
.gd-tabs a:focus-visible { outline: 3px solid rgba(12, 108, 208, .35); outline-offset: -3px; }

.gd-h2 { font-size: var(--sx-fs-t32); color: var(--sx-navy); font-weight: 800; line-height: 1.2; margin: 0 0 1.2rem; }

/* ---------- Accueil du guide ---------- */
.gd-home { padding-top: 2.2rem; }
.gd-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .gd-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .gd-cards { grid-template-columns: repeat(3, 1fr); } }
.gd-card {
    display: flex; gap: 14px; height: 100%; box-sizing: border-box; padding: 18px; text-decoration: none; color: var(--sx-text);
    background: var(--sx-white); border: 1px solid var(--sx-line); border-radius: var(--sx-r-card); box-shadow: var(--sx-shadow-sm);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.gd-card:hover, .gd-card:focus-visible { border-color: var(--sx-action); box-shadow: var(--sx-shadow); transform: translateY(-2px); }
.gd-card:focus-visible { outline: 3px solid rgba(12, 108, 208, .35); outline-offset: 2px; }
.gd-card-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--sx-action-pale); color: var(--sx-action); }
.gd-card-ico .sx-i { width: 22px; height: 22px; }
.gd-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gd-card-body strong { font-size: var(--sx-fs-18); color: var(--sx-navy); }
.gd-card-aud { color: var(--sx-sage-ink); font-weight: 700; font-size: var(--sx-fs-12); text-transform: uppercase; letter-spacing: .06em; }
.gd-card-lead { color: var(--sx-text-mid); font-size: var(--sx-fs-14); margin-top: 4px; }
.gd-card-count { margin-top: auto; padding-top: 10px; color: var(--sx-action); font-weight: 700; font-size: var(--sx-fs-14); display: inline-flex; align-items: center; gap: 6px; }
.gd-card-count .sx-i { width: 14px; height: 14px; }

.gd-popular { margin-top: 2.8rem; }
.gd-popular ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .gd-popular ul { grid-template-columns: repeat(3, 1fr); } }
.gd-popular a {
    display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; height: 100%; box-sizing: border-box;
    background: var(--sx-white); border: 1px solid var(--sx-line); border-radius: var(--sx-r-sm); text-decoration: none;
}
.gd-popular a span { color: var(--sx-navy); font-weight: 700; }
.gd-popular a small { color: var(--sx-muted); font-size: var(--sx-fs-12); }
.gd-popular a:hover { border-color: var(--sx-action); }

.gd-help {
    margin-top: 2.8rem; padding: 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
    background: var(--sx-white); border: 1px solid var(--sx-line); border-radius: var(--sx-r-card);
}
.gd-help .gd-h2 { font-size: var(--sx-fs-24); margin-bottom: .4rem; }
.gd-help p { margin: 0; color: var(--sx-text-mid); max-width: 640px; }

/* ---------- Onglet : sommaire + articles ---------- */
.gd-body { padding: 1.6rem 0 3.5rem; }
.gd-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .gd-grid { grid-template-columns: 280px minmax(0, 1fr); gap: 36px; align-items: start; } }

.gd-toc-box { background: var(--sx-white); border: 1px solid var(--sx-line); border-radius: var(--sx-r-sm); }
@media (min-width: 992px) { .gd-toc { position: sticky; top: calc(var(--sx-header) + 64px); max-height: calc(100vh - var(--sx-header) - 88px); overflow-y: auto; } }
.gd-toc-box summary {
    display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; cursor: pointer;
    font-weight: 700; color: var(--sx-navy); list-style: none;
}
.gd-toc-box summary::-webkit-details-marker { display: none; }
.gd-toc-box summary .sx-i { width: 18px; height: 18px; }
.gd-toc-box ol { list-style: none; margin: 0; padding: 0 8px 10px; counter-reset: gd; }
.gd-toc-box li a {
    display: block; padding: 7px 10px; border-radius: 6px; color: var(--sx-text-mid); text-decoration: none; font-size: var(--sx-fs-14); line-height: 1.35;
    border-left: 3px solid transparent;
}
.gd-toc-box li a:hover { background: var(--sx-cream); color: var(--sx-navy); }
.gd-toc-box li a.is-active { color: var(--sx-action); font-weight: 700; border-left-color: var(--sx-action); background: var(--sx-action-pale); }

.gd-aud { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 1rem; padding: 6px 12px; border-radius: var(--sx-r-pill); background: var(--sx-sage-pale); color: var(--sx-success); font-weight: 700; font-size: var(--sx-fs-14); }
.gd-aud .sx-i { width: 16px; height: 16px; }

.gd-art {
    background: var(--sx-white); border: 1px solid var(--sx-line); border-radius: var(--sx-r-card); padding: 22px 20px; margin-bottom: 18px;
    scroll-margin-top: calc(var(--sx-header) + 64px);
}
@media (min-width: 768px) { .gd-art { padding: 28px 30px; } }
.gd-art:target { border-color: var(--sx-action); box-shadow: 0 0 0 3px rgba(12, 108, 208, .15); }
.gd-art-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gd-art h2 { font-size: var(--sx-fs-24); color: var(--sx-navy); font-weight: 800; line-height: 1.25; margin: 0; }
.gd-copy {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--sx-r-sm);
    border: 1px solid var(--sx-line); background: var(--sx-white); color: var(--sx-text-mid); cursor: pointer;
}
.gd-copy[hidden] { display: none; }
.gd-copy:hover { color: var(--sx-action); border-color: var(--sx-action); }
.gd-copy.is-done { color: var(--sx-success); border-color: var(--sx-success); }
.gd-copy .sx-i { width: 18px; height: 18px; }
.gd-sum { color: var(--sx-text-mid); margin: .5rem 0 1rem; font-size: var(--sx-fs-16); }
.gd-module { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 1rem; padding: 6px 12px; border-radius: var(--sx-r-sm); background: var(--sx-gold-pale); color: var(--sx-gold-ink); font-size: var(--sx-fs-14); font-weight: 600; }
.gd-module .sx-i { width: 16px; height: 16px; }

.gd-steps { list-style: none; counter-reset: gdstep; margin: 0; padding: 0; display: grid; gap: 12px; }
.gd-steps li { counter-increment: gdstep; position: relative; padding-left: 46px; min-height: 32px; line-height: 1.55; }
.gd-steps li::before {
    content: counter(gdstep); position: absolute; left: 0; top: -1px; width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--sx-navy); color: var(--sx-white); font-weight: 800; font-size: var(--sx-fs-14);
}
.gd-answer { margin: 0; line-height: 1.6; }
.gd-ui {
    display: inline; padding: 1px 7px; border-radius: 6px; white-space: normal;
    background: var(--sx-action-pale); color: var(--sx-navy-900); font-weight: 700; font-size: .95em;
    box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.gd-tip { display: flex; gap: 10px; margin-top: 1.2rem; padding: 12px 14px; border-radius: var(--sx-r-sm); background: var(--sx-cream); border-left: 4px solid var(--sx-sage); }
.gd-tip .sx-i { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--sx-success); }
.gd-tip p { margin: 0; color: var(--sx-text-mid); font-size: var(--sx-fs-14); line-height: 1.6; }
.gd-tip strong { color: var(--sx-navy); }
.gd-open { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 1.2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--sx-line); }
.gd-open a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 700; color: var(--sx-action); }
.gd-open a .sx-i { width: 16px; height: 16px; }
.gd-open small { color: var(--sx-muted); font-size: var(--sx-fs-12); }

.gd-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.gd-pager a {
    display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; max-width: 48%; box-sizing: border-box;
    background: var(--sx-white); border: 1px solid var(--sx-line); border-radius: var(--sx-r-sm); text-decoration: none; color: var(--sx-navy); font-weight: 700;
}
.gd-pager a:hover { border-color: var(--sx-action); }
.gd-pager a span { display: flex; flex-direction: column; }
.gd-pager small { color: var(--sx-muted); font-weight: 600; font-size: var(--sx-fs-12); }
.gd-pager-next { margin-left: auto; text-align: right; }
.gd-pager .sx-i { flex: none; width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
    .gd-card { transition: none; }
    .gd-card:hover { transform: none; }
}
@media print {
    .gd-tabs, .gd-toc, .gd-search, .gd-copy, .gd-pager, .gd-open small { display: none !important; }
    .gd-grid { display: block; }
    .gd-art { break-inside: avoid; border: 0; padding: 0 0 12px; }
}
