/* ============================================================
   CrumpIT — Guides (Knowledge Hub index + single guide) (@layer pages)
   Loads with help.css (page-hero, kb-cards, prose).
   ============================================================ */

@layer pages {

  /* ---------- Knowledge Hub index ---------- */
  .kb-tools { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-10); }
  .kb-search { position: relative; display: block; max-width: 560px; }
  .kb-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
  .kb-search .input { padding-left: 42px; }
  .kb-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
  .kb-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0.4rem 0.9rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
    font-family: var(--font-ui); font-weight: 600; font-size: var(--fs-14); cursor: pointer;
    transition: color var(--dur-base) var(--ease), background-color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
  }
  .kb-chip span { font-size: var(--fs-12); color: var(--text-muted); font-weight: 500; }
  .kb-chip:hover { color: var(--text); border-color: var(--accent-24); }
  .kb-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
  .kb-chip.is-on span { color: rgba(255, 255, 255, 0.8); }
  .kb-empty { color: var(--text-muted); padding: var(--sp-8) 0; }
  .kb-empty a { color: var(--accent); }
  .kb-card__date { display: block; margin-top: var(--sp-3); font-family: var(--font-ui); font-size: var(--fs-12); color: var(--text-muted); }

  /* ---------- Single guide ---------- */
  .guide-body { padding-top: var(--sp-12); padding-bottom: var(--sp-20); }
  .guide-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-12); align-items: start; }
  .guide-article { min-width: 0; }
  .guide-byline {
    display: flex; flex-wrap: wrap; gap: var(--sp-2);
    font-family: var(--font-ui); font-size: var(--fs-14); color: var(--text-muted);
    margin-bottom: var(--sp-8); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--border);
  }
  .guide-byline__who { color: var(--text); font-weight: 600; }
  .guide-figure { margin: 0 0 var(--sp-8); border-radius: var(--r-md); overflow: hidden; }
  .guide-figure img { width: 100%; height: auto; display: block; }
  .guide-prose { max-width: 70ch; }
  .guide-prose h2 { font-family: var(--font-display); font-size: var(--fs-24); margin: var(--sp-10) 0 var(--sp-3); }
  .guide-prose h3 { font-family: var(--font-ui); font-weight: 700; font-size: var(--fs-18); margin: var(--sp-8) 0 var(--sp-2); }
  .guide-prose ol { padding-left: 1.4em; margin-bottom: var(--sp-4); color: var(--text); }
  .guide-prose ol li { margin-bottom: var(--sp-2); line-height: 1.7; }
  .guide-prose blockquote { margin: var(--sp-6) 0; padding: var(--sp-4) var(--sp-6); border-left: 3px solid var(--accent); background: var(--surface-alt); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
  .guide-prose img { border-radius: var(--r-sm); }
  .guide-related { margin-top: var(--sp-12); padding: var(--sp-6); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
  .guide-related h2 { font-family: var(--font-display); font-size: var(--fs-20); margin: var(--sp-2) 0 var(--sp-4); }
  .guide-related__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
  .guide-side { display: flex; flex-direction: column; gap: var(--sp-6); position: sticky; top: calc(var(--header-h) + var(--sp-6)); }
  .guide-call { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-6); border-top: 3px solid var(--accent); }
  .guide-call__label { font-family: var(--font-ui); font-size: var(--fs-12); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
  .guide-call__phone { font-family: var(--font-display); font-size: var(--fs-24); font-weight: 700; color: var(--text); text-decoration: none; line-height: 1.1; }
  .guide-call__phone:hover { color: var(--accent); }
  .guide-call__hours { font-size: var(--fs-14); color: var(--text-muted); }
  .guide-call .btn { justify-content: center; }
  .guide-call p { font-size: var(--fs-14); color: var(--text-muted); margin: 0; line-height: 1.6; }
  .guide-more ul { list-style: none; margin: var(--sp-3) 0 var(--sp-4); padding: 0; display: grid; gap: var(--sp-3); }
  .guide-more li { display: flex; flex-direction: column; gap: 2px; padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
  .guide-more li a { color: var(--text); font-family: var(--font-ui); font-weight: 600; text-decoration: none; }
  .guide-more li a:hover { color: var(--accent); }
  .guide-more li span { font-size: var(--fs-12); color: var(--text-muted); }
  .guide-more__all { color: var(--accent); font-family: var(--font-ui); font-weight: 600; text-decoration: none; }
  .guide-more__all:hover { text-decoration: underline; }

  @media (max-width: 960px) {
    .guide-grid { grid-template-columns: 1fr; gap: var(--sp-8); }
    .guide-side { position: static; }
  }
  @media (prefers-reduced-motion: reduce) {
    .guide-side { position: static; }
  }
}
