/* Guide panel — docs edition (Phase 2b-2 v1).
 *
 * The app styles this panel with its Tailwind pm-* palette. mkdocs-material has neither Tailwind
 * nor that palette, so the panel needs its own CSS here. It is written against MATERIAL'S OWN
 * custom properties (--md-*) rather than hard-coded colours, so the panel follows the site's
 * theme — including any palette switch — instead of fighting it.
 *
 * Everything is scoped under #guide-panel / .guide-fab. Nothing defines a bare generic class at
 * document level: a rule like `.block { display:block }` would leak into material's own markup.
 * The one exception is intentional and tightly scoped: `#guide-panel.hidden`, because guide.js
 * toggles the literal class name "hidden" via classList and that contract cannot be renamed here.
 */

/* ---- the opener -------------------------------------------------------------------------- */
.guide-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;                       /* below material's own overlays, above content */
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .8rem;
  min-height: 44px;                  /* touch target */
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 999px;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.guide-fab:hover {
  border-color: var(--md-accent-fg-color);
  color: var(--md-accent-fg-color);
}
.guide-fab-label { letter-spacing: .01em; }

/* ---- the panel --------------------------------------------------------------------------- */
#guide-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  background: var(--md-default-bg-color);
  border-left: 1px solid var(--md-default-fg-color--lightest);
  box-shadow: -8px 0 24px rgba(0, 0, 0, .22);
}
/* guide.js toggles this exact class name. Scoped to the panel so it cannot leak. */
#guide-panel.hidden { display: none; }

#guide-panel .guide-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}
#guide-panel .guide-head-titles { display: flex; align-items: baseline; gap: .5rem; }
#guide-panel .guide-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--md-accent-fg-color);
}
#guide-panel .guide-subtitle {
  font-size: .62rem;
  color: var(--md-default-fg-color--light);
}
#guide-panel .guide-close {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0 .25rem;
  color: var(--md-default-fg-color--light);
}
#guide-panel .guide-close:hover { color: var(--md-default-fg-color); }

#guide-panel .guide-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}
#guide-panel .guide-section + .guide-section { margin-top: 1.5rem; }
#guide-panel .guide-section-title {
  margin: 0 0 .5rem;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--md-default-fg-color--light);
}
#guide-panel .guide-generic {
  margin: 0;
  font-size: .78rem;
  line-height: 1.6;
  color: var(--md-default-fg-color--light);
}

#guide-panel .guide-input {
  width: 100%;
  box-sizing: border-box;
  padding: .5rem .75rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: .5rem;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font-size: .8rem;
}
#guide-panel .guide-input:focus {
  outline: none;
  border-color: var(--md-accent-fg-color);
}
#guide-panel .guide-status {
  margin: .5rem 0 0;
  font-size: .62rem;
  color: var(--md-default-fg-color--light);
}
#guide-panel .guide-results { margin-top: .5rem; display: flex; flex-direction: column; gap: .25rem; }

/* Search results are built by guide.js. It tags each one `guide-result` and ALSO carries the
 * app's Tailwind classnames — inert here, styling there — so one JS file serves both surfaces
 * without a per-surface branch. */
#guide-panel .guide-result {
  display: block;
  padding: .5rem .75rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: .5rem;
  font-size: .78rem;
  color: var(--md-accent-fg-color);
  text-decoration: none;
}
#guide-panel .guide-result:hover {
  border-color: var(--md-accent-fg-color);
  color: var(--md-default-fg-color);
}

#guide-panel .guide-foot {
  flex: none;
  padding: .75rem 1rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}
#guide-panel .guide-foot p {
  margin: 0;
  font-size: .62rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

@media (max-width: 480px) {
  #guide-panel { max-width: 100%; }
  .guide-fab-label { display: none; }
}
