/* Hub Guide et sous-pages du guide. Chargé seulement par ces pages.
   Jetons du site (_path_.css) uniquement : aucune nouvelle palette. */

.gh { --gh-top: 84px; --gh-ease: cubic-bezier(.2, .7, .2, 1); }
.gh section { padding: 0; border-top: 0; }
.gh h1, .gh h2 { text-align: left; }

/* ---- en-tête de page, aligné à gauche ---- */
.gh .gh-hero {
  padding: 48px 0 32px;
  background: radial-gradient(900px 300px at 12% -120px, var(--accent-weak), transparent 70%), var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.gh-hero__in { text-align: left; }
.gh-hero h1 { margin: 6px 0 12px; max-width: 22ch; letter-spacing: -.015em; line-height: 1.12; }
.gh-hero--sub h1 { max-width: 28ch; font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.gh-lead { font-size: 1.08rem; color: var(--text-dim); max-width: 68ch; margin: 0 0 22px; }
.gh-hero--sub .gh-lead { margin-bottom: 4px; }

.gh-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0 0 14px; padding: 0; font-size: .84rem; color: var(--text-faint); }
.gh-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.gh-crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--border-strong); }
.gh-crumbs a { color: var(--text-faint); text-decoration: none; }
.gh-crumbs a:hover { color: var(--text); text-decoration: underline; }
.gh-crumbs [aria-current] { color: var(--text-dim); overflow-wrap: anywhere; }

.gh-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .86rem; font-weight: 600; color: var(--text-dim); }
.gh-eyebrow a { color: inherit; text-decoration: none; }
.gh-eyebrow a:hover { text-decoration: underline; }
.gh-ico { width: 20px; height: 20px; flex: none; }

/* ---- recherche ---- */
.gh-search { max-width: 640px; margin: 0 0 16px; }
.gh-search label { display: block; font-size: .86rem; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.gh-search__box {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: border-color .2s var(--gh-ease), box-shadow .2s var(--gh-ease);
}
.gh-search__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-weak), var(--shadow-md); }
.gh-search__box svg { width: 20px; height: 20px; margin-left: 14px; color: var(--text-faint); flex: none; }
.gh-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.02rem;
  color: var(--text); padding: 14px 12px; -webkit-appearance: none; appearance: none;
}
.gh-search kbd {
  margin-right: 12px; font-family: var(--mono); font-size: .78rem; color: var(--text-faint);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; background: var(--surface-2);
}

/* ---- filtres ---- */
.gh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gh-chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .88rem; font-weight: 550;
  color: var(--text-dim); background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; transition: background .18s, color .18s, border-color .18s, transform .18s var(--gh-ease);
}
.gh-chip:hover { border-color: var(--border-strong); color: var(--text); }
.gh-chip:active { transform: scale(.97); }
.gh-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.gh-chip__n { font-size: .78rem; opacity: .7; font-variant-numeric: tabular-nums; }
.gh-status { min-height: 1.4em; margin: 12px 0 0; font-size: .86rem; color: var(--text-faint); }

/* ---- mise en page : navigation latérale collante ---- */
.gh-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 48px; padding-top: 36px; padding-bottom: 56px; align-items: start; }
.gh-side { position: sticky; top: var(--gh-top); max-height: calc(100vh - var(--gh-top) - 16px); overflow-y: auto; padding-bottom: 8px; }
.gh-side__h { margin: 0 0 8px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.gh-side ul, .gh-side ol { list-style: none; margin: 0; padding: 0; }
.gh-side a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius);
  color: var(--text-dim); text-decoration: none; font-size: .92rem; line-height: 1.35; transition: background .15s, color .15s;
}
.gh-side a:hover { background: var(--surface-hover); color: var(--text); }
.gh-side a.is-active, .gh-side a[aria-current="page"] { background: var(--accent-weak); color: var(--text); font-weight: 600; }
.gh-side a.is-active::before, .gh-side a[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent);
}
.gh-side .gh-ico { width: 18px; height: 18px; color: var(--text-faint); }
.gh-side__n { margin-left: auto; font-size: .78rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.gh-side__more { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.gh-sib a { font-size: .87rem; padding: 5px 10px; }

/* ---- domaines et cartes ---- */
.gh-domain { scroll-margin-top: var(--gh-top); }
.gh-domain + .gh-domain { margin-top: 48px; }
.gh-domain[hidden] { display: none; }
.gh-domain__head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.gh-domain__head > .gh-ico {
  width: 40px; height: 40px; padding: 9px; border-radius: var(--radius-lg); background: var(--accent-weak);
  border: 1px solid var(--border-soft); color: var(--text); box-sizing: border-box;
}
.gh-domain__head h2 { margin: 0 0 4px; font-size: clamp(1.3rem, 2vw, 1.6rem); }
.gh-domain__head p { margin: 0; color: var(--text-dim); max-width: 68ch; }

.gh-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.gh-card[hidden] { display: none; }
.gh-card a {
  display: flex; flex-direction: column; gap: 6px; height: 100%; box-sizing: border-box; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .22s var(--gh-ease), box-shadow .22s var(--gh-ease), border-color .22s;
}
.gh-card a:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.gh-card a:focus-visible, .gh-side a:focus-visible, .gh-chip:focus-visible, .gh-pager a:focus-visible, .gh-article a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.gh-card__eyebrow { font-size: .76rem; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.gh-card__title { font-weight: 650; line-height: 1.3; }
.gh-card__text { font-size: .9rem; color: var(--text-dim); line-height: 1.5; }
.gh-card__meta { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-faint); }
.gh-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--warn-weak); color: var(--warn); font-weight: 600; }
.gh-card mark, .gh-card__title mark { background: var(--warn-weak); color: inherit; border-radius: 3px; padding: 0 1px; }
.gh-empty { padding: 28px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-dim); max-width: 68ch; }

/* ---- sous-page : colonne de lecture ---- */
.gh-article { max-width: 68ch; min-width: 0; }
.gh-sec { scroll-margin-top: var(--gh-top); }
.gh-sec + .gh-sec { margin-top: 36px; }
.gh-sec h2 { font-size: 1.32rem; margin: 0 0 12px; }
.gh-sec p { margin: 0 0 12px; }
.gh-ui { font-weight: 600; color: var(--text); white-space: normal; }

.gh-path { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gh-path li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: .92rem; }
.gh-path li + li::before { content: "›"; color: var(--text-faint); font-weight: 400; margin-right: 6px; }
.gh-path li + li { padding-left: 10px; }

.gh-steps { list-style: none; counter-reset: gh-step; margin: 0; padding: 0; }
.gh-steps li { counter-increment: gh-step; position: relative; padding: 2px 0 20px 50px; scroll-margin-top: var(--gh-top); }
.gh-steps li::before {
  content: counter(gh-step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums;
  background: var(--surface); border: 1.5px solid var(--accent); color: var(--text);
}
.gh-steps li::after { content: ""; position: absolute; left: 15.5px; top: 36px; bottom: 4px; width: 1px; background: var(--border-strong); transform-origin: top; }
.gh-steps li:last-child { padding-bottom: 0; }
.gh-steps li:last-child::after { display: none; }
.gh-steps li > span { display: block; padding-top: 4px; }
/* Un libelle cite reste dans la phrase: jamais seul sur sa ligne. */
.gh-ui, .gh-steps li > span .gh-ui { display: inline; padding: 0; }

.gh-tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gh-tips li { position: relative; padding: 12px 14px 12px 40px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.gh-tips li::before { content: "i"; position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 700 .72rem/1 var(--font); color: var(--text-dim); border: 1.5px solid var(--text-faint); }

.gh-custom { padding: 18px 20px; border-radius: var(--radius-lg); background: var(--warn-weak); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.gh-custom h2 { font-size: 1.08rem; color: var(--warn); }
.gh-custom p:last-child { margin-bottom: 0; }

.gh-cards--rel { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.gh-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border-soft); }
.gh-pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); text-decoration: none; color: var(--text); transition: border-color .2s, box-shadow .2s, transform .2s var(--gh-ease); }
.gh-pager a:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.gh-pager span { font-size: .8rem; color: var(--text-faint); }
.gh-pager b { font-weight: 600; line-height: 1.3; }
.gh-pager__prev:hover { transform: translateX(-2px); }
.gh-pager__next { grid-column: 2; text-align: right; }
.gh-pager__next:hover { transform: translateX(2px); }
.gh-back { margin-top: 20px; font-size: .92rem; }
.gh-back a { color: var(--text-dim); }

/* ---- animations : seulement quand le script a posé .gh-js ---- */
.gh-js .gh-reveal { opacity: 0; transform: translateY(10px); }
.gh-js .gh-reveal.is-in { opacity: 1; transform: none; transition: opacity .5s var(--gh-ease), transform .5s var(--gh-ease); transition-delay: var(--gh-delay, 0ms); }
.gh-js .gh-steps li.gh-reveal::after { transform: scaleY(0); }
.gh-js .gh-steps li.gh-reveal.is-in::after { transform: scaleY(1); transition: transform .6s var(--gh-ease) .2s; }
.gh-card.is-match a { animation: gh-pop .3s var(--gh-ease); }
@keyframes gh-pop { from { opacity: .4; transform: scale(.985); } to { opacity: 1; transform: none; } }
.gh-sec:target h2, .gh-steps li:target span { animation: gh-flash 1.4s ease; }
@keyframes gh-flash { 0%, 30% { background: var(--warn-weak); } 100% { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
  .gh *, .gh *::before, .gh *::after { animation: none !important; transition: none !important; }
  .gh-js .gh-reveal { opacity: 1; transform: none; }
  .gh-js .gh-steps li.gh-reveal::after { transform: none; }
  .gh-card a:hover, .gh-pager a:hover { transform: none; }
}

/* ---- tablette et téléphone ---- */
@media (max-width: 960px) {
  .gh-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; }
  .gh--hub .gh-side { display: none; }
  .gh--sub .gh-side { position: static; max-height: none; overflow: visible; order: -1; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); }
  .gh--sub .gh-toc { display: flex; flex-wrap: wrap; gap: 4px; }
  .gh--sub .gh-toc a { padding: 4px 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; font-size: .85rem; }
  .gh--sub .gh-toc a::before { display: none; }
  .gh-side__more { display: none; }
}
@media (max-width: 720px) {
  .gh .gh-hero { padding: 28px 0 22px; }
  .gh-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; -webkit-overflow-scrolling: touch; }
  .gh-chips::-webkit-scrollbar { display: none; }
  .gh-chip { flex: none; }
  .gh-search kbd { display: none; }
  .gh-cards, .gh-cards--rel { grid-template-columns: minmax(0, 1fr); }
  .gh-domain__head > .gh-ico { width: 34px; height: 34px; padding: 7px; }
  .gh-pager { grid-template-columns: minmax(0, 1fr); }
  .gh-pager__next { grid-column: 1; }
  .gh-steps li { padding-left: 44px; }
}

@media print {
  .gh-js .gh-reveal { opacity: 1; transform: none; }
  .gh-side, .gh-search, .gh-chips, .gh-pager { display: none; }
}

/* ---- repli vers l'assistant ---- */
.gh-askbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 10px; }
.gh-askbar[hidden] { display: none; }
.gh-askbtn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: .92rem; font-weight: 600;
  color: var(--text); background: var(--accent-weak); border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; transition: background .18s, border-color .18s, transform .18s var(--gh-ease);
  animation: gh-pop .25s var(--gh-ease);
}
.gh-askbtn:hover { border-color: var(--accent); background: var(--surface); }
.gh-askbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gh-askbtn:disabled { opacity: .6; cursor: progress; }
.gh-askbtn svg { width: 18px; height: 18px; flex: none; }
.gh-askbtn kbd { font-family: var(--mono); font-size: .75rem; color: var(--text-faint); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; background: var(--surface); }
.gh-askbar__hint { font-size: .82rem; color: var(--text-faint); }

.gh-answer {
  position: relative; max-width: 68ch; margin: 14px 0 4px; padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  animation: gh-pop .3s var(--gh-ease);
}
.gh-answer[hidden] { display: none; }
.gh-answer p { margin: 0 0 10px; }
.gh-answer__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gh-answer__title { margin: 0 !important; font-weight: 700; font-size: .92rem; }
.gh-answer__tag { font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--warn-weak); color: var(--warn); }
.gh-answer__close { margin-left: auto; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text-dim); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.gh-answer__close:hover { color: var(--text); border-color: var(--border-strong); }
.gh-answer__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gh-answer__more { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin: 12px 0 6px !important; }
.gh-answer__links { margin: 0 0 10px; padding-left: 18px; }
.gh-answer__links li { margin: 2px 0; }
.gh-answer__links a { color: var(--text); font-weight: 550; }
.gh-answer__feature { margin-top: 4px; }
.gh-answer--error { border-left-color: var(--bad); }
.gh-answer--error p[role="alert"] { color: var(--bad); }
.gh-answer.is-loading .gh-answer__wait { display: flex; align-items: center; gap: 10px; color: var(--text-dim); margin: 0; }
.gh-answer.is-loading .gh-answer__wait::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: gh-spin .8s linear infinite;
}
@keyframes gh-spin { to { transform: rotate(360deg); } }
.gh-results .gh-domain__head h2 { font-size: 1.2rem; }
@media (prefers-reduced-motion: reduce) {
  .gh-answer.is-loading .gh-answer__wait::before { animation: none !important; border-top-color: var(--border-strong); }
}
@media (max-width: 720px) {
  .gh-askbar__hint { flex-basis: 100%; }
  .gh-answer { padding: 14px; }
}
