/* BNE guide-robot behaviour patch — self-contained module.
 *
 * Problem: the ✕ on the robot's speech bubble is wired to "hide the guide",
 * so dismissing the explanation also removes the robot and there is no way
 * back. This module makes ✕ close only the bubble and keeps the robot, which
 * can then be clicked to bring the explanation back.
 *
 * The React app re-creates .robot-bubble on every section change, so the
 * dismissed state lives in a class on <html> rather than on any single node —
 * a re-render cannot resurrect the bubble. */

html.bne-guide-quiet .robot-bubble {
  display: none !important;
}

/* Affordance: while the explanation is dismissed the robot carries a small
 * badge so it is obvious it can be tapped to bring the guide back. */
html.bne-guide-quiet .robot-float::after {
  content: "؟";
  position: absolute;
  inset-inline-start: 4%;
  top: 2%;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--color-amber, #ff8a1f);
  color: #0b1220;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 14px rgba(255, 138, 31, 0.5);
  pointer-events: none;
  animation: bne-guide-pulse 2.4s ease-in-out infinite;
}

html[lang="en"].bne-guide-quiet .robot-float::after {
  content: "?";
}

@keyframes bne-guide-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

/* The robot sits under the site's custom cursor layer, so a pointer cursor is
 * not shown; the badge above is the affordance. Keyboard users get a focus
 * ring on the robot wrapper instead. */
html.bne-guide-quiet .robot-float:focus-visible,
.robot-float:focus-visible {
  outline: 2px solid var(--color-amber, #ff8a1f);
  outline-offset: 4px;
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
  html.bne-guide-quiet .robot-float::after {
    animation: none;
  }
}
