/* Reusable styles for the interactive maps */

/* You can override these on any page via :root */
:root {
  --hotspot-fill: rgba(34, 139, 34, 0.25);
  --hotspot-border: #2e8b57;
  --tooltip-bg: #000;
  --tooltip-fg: #fff;
  --button-bg: #2e8b57;
  --button-fg: #fff;
}

/* Outer container for one map instance (holds stage + optional list) */
.imap-container {
  display: inline-block;
  max-width: 100%;
}

/* Stage holds ONLY the image + hotspots and is the positioning context */
.imap-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.imap-image {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Hotspots positioned relative to .imap-stage (percent of width/height) */
.imap-hotspot {
  position: absolute;
  left: calc(var(--x) * 1%);     /* % of stage width */
  top:  calc(var(--y) * 1%);     /* % of stage height */
  width:  calc(var(--rW) * 2%);  /* radius as % of stage width */
  height: calc(var(--rH) * 2%);  /* radius as % of stage height */
  transform: translate(-50%, -50%);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;

  /* Hidden by default; shown on hover / first tap */
  opacity: 0;
  background: transparent;
  border: 2px solid transparent;

  touch-action: none;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

/* Visible highlight */
.imap-hotspot.imap-visible,
.imap-hotspot:hover {
  opacity: 1;
  background: var(--hotspot-fill);
  border-color: var(--hotspot-border);
}

/* On touch devices, don’t apply :hover visuals */
@media (hover: none) {
  .imap-hotspot:hover {
    opacity: 0;
    background: transparent;
    border-color: transparent;
  }
}

/* Tooltip (mouse only) remains fixed to viewport */
.imap-tooltip {
  position: fixed;
  background: var(--tooltip-bg);
  color: var(--tooltip-fg);
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
  font-size: 14px;
}

/* Touch confirm button – now ABSOLUTE inside the stage */
.imap-touch-button {
  position: absolute; /* important: inside .imap-stage */
  background: var(--button-bg);
  color: var(--button-fg);
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  z-index: 20; /* above hotspots, but not covering site UI anymore */
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

/* Optional title list under the map */
.imap-title-list {
  margin-top: 14px;
  max-width: 900px;
}
.imap-title-list ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.imap-title-list li {
  margin: 6px 0;
  line-height: 1.35;
}
.imap-title-link {
  background: transparent;
  border: none;
  padding: 2px 0;
  font: inherit;
  color: var(--hotspot-border);
  text-align: left;
  cursor: pointer;
}
.imap-title-link:hover {
  text-decoration: underline;
}
