/* ============================================================
   IMAGE HOTSPOTS — pulsing markers with hover / tap tooltips
   Explains parts of a UI screenshot. JS (hotspots.js) handles
   tap/keyboard toggling and edge-aware tooltip placement.
   ============================================================ */

.hotspots {
  position: relative;
  margin: 0;
}
/* full-width so multiple figures stack inside the flex .image-text-block */
.image-text-block > .hotspots { flex: 1 1 100%; width: 100%; }
.hotspots + .hotspots { margin-top: clamp(1.5rem, 4vw, 3rem); }

.hotspots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
}

/* zero-size anchor placed at the point of interest (--x / --y are %) */
.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0;
  height: 0;
  z-index: 2;
}

.hotspot-dot {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  width: clamp(26px, 2.4vw, 34px);
  height: clamp(26px, 2.4vw, 34px);
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  color: #fff;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out);
}
.hotspot-dot::after {
  content: "+";
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
}
.hotspot-dot:hover,
.hotspot.is-open .hotspot-dot {
  transform: translate(-50%, -50%) scale(1.12);
}

/* expanding pulse ring behind the dot */
.hotspot-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.65;
  z-index: -1;
  animation: hotspot-pulse 2.2s var(--ease-out) infinite;
}
@keyframes hotspot-pulse {
  0%   { transform: scale(1);   opacity: 0.65; }
  70%  { transform: scale(2.8); opacity: 0; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* tooltip — defaults to the right of the dot; JS adds .tip-left near edges
   and sets --shift to keep it within the image vertically */
.hotspot-tip {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(var(--tip-gap, 26px), calc(-50% + var(--shift, 0px)));
  width: max-content;
  max-width: min(260px, 60vw);
  padding: 0.7rem 0.9rem;
  background: var(--surface, #16161a);
  color: var(--bone);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  line-height: 1.45;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out), visibility 0.25s;
  z-index: 5;
}
.hotspot.tip-left .hotspot-tip {
  left: auto;
  right: 0;
  transform: translate(calc(-1 * var(--tip-gap, 26px)), calc(-50% + var(--shift, 0px)));
}
.hotspot.is-active .hotspot-tip,
.hotspot.is-open .hotspot-tip {
  opacity: 1;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .hotspot-pulse { animation: none; opacity: 0.45; }
}
@media (max-width: 600px) {
  .hotspot-tip { max-width: 72vw; font-size: 0.8rem; }
}
