/* The live threat globe in a public hero (the landing page): the shared globe with the
   arcs canvas and tooltip over it, placed like the landing globe and running off the right edge.
   The section takes public-hero--threat-globe, the visual is .public-hero__visual.tm-stage. */

/* The sphere fills about 0.9 of the stage height (50 degree field of view), so the height sets its size. */
.tm-stage { position: relative; }

/* A vertical swipe over the globe scrolls the page, a sideways one turns the globe. */
.public-hero--threat-globe .network-globe--network canvas { touch-action: pan-y; }

/* Desktop: a huge globe whose left edge sits just right of the copy column. */
@media (min-width: 1101px) {
  .public-hero--threat-globe .public-hero__container { position: static; }
  .public-hero--threat-globe .public-hero__layout { position: relative; display: grid; grid-template-columns: min(600px, calc(100vw - 660px)) 1fr; align-content: center; }
  .public-hero--threat-globe .public-hero__copy { position: relative; z-index: 2; grid-column: 1; grid-row: 1; }

  /* max-width: none undoes the shared 100% cap on the hero visual, which pulled the globe onto the copy. */
  .public-hero--threat-globe .public-hero__visual.tm-stage {
    --tm-globe: clamp(900px, 80vw, 1180px);
    position: absolute;
    top: 50%;
    left: calc(min(600px, 100vw - 660px) + 2.5rem - var(--tm-globe) * .147);
    z-index: 1;
    width: calc(var(--tm-globe) * 1.2);
    max-width: none;
    height: var(--tm-globe);
    transform: translateY(-50%);
  }
}

/* Tablets and phones: the copy above a globe as wide as the screen. */
@media (max-width: 1100px) {
  .public-hero--threat-globe .public-hero__visual.tm-stage {
    align-self: center;
    width: 100vw;
    max-width: none;
    height: min(110vw, 860px);
  }
  /* Arcs that rise past the top of the stage fade out there, under the buttons, as on the threat map, instead of
     stopping at a straight edge. */
  .public-hero--threat-globe .tm-arcs {
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 48px);
    mask-image: linear-gradient(to bottom, transparent, #000 48px);
  }
}

/* A phone held sideways: the whole globe fits the screen below the header. */
@media (max-height: 500px) and (max-width: 1100px) {
  .public-hero--threat-globe .public-hero__visual.tm-stage {
    width: min(620px, 100%);
    height: max(280px, calc(100svh - 76px));
  }
}

.tm-arcs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tm-tip {
  position: absolute;
  z-index: 3;
  max-width: 260px;
  padding: .6rem .75rem;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 8px;
  background: rgba(10, 16, 36, .96);
  color: #e2e8f0;
  font-size: .78rem;
  line-height: 1.5;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.tm-tip strong { display: block; color: #f8fafc; font-weight: 600; }
.tm-tip span { display: block; color: #a9b7ca; }
.tm-tip .tm-tip-hint { margin-top: 4px; color: #67e8f9; }
/* Touch screens: the tapped tooltip takes taps, and its link opens the IP (static/threat-map.js showTip). */
.tm-tip.is-tappable { pointer-events: auto; cursor: pointer; }
.tm-tip a.tm-tip-hint { display: block; padding: 6px 0 2px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
/* Over a held arc that opens its IP's product, the pointer is a hand (over the globe it is otherwise a grab hand). */
.is-pointing-arc, .is-pointing-arc .network-globe--network, .is-pointing-arc canvas { cursor: pointer; }
/* Over a country's name on the globe, which picks the country. */
.network-globe--network.is-over-label:not(.is-dragging) { cursor: pointer; }
.tm-tip[hidden], .tm-globe-note[hidden] { display: none; }

.tm-globe-note {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(320px, 80%);
  margin: 0;
  color: #a9b7ca;
  font-size: .85rem;
  text-align: center;
  transform: translate(-50%, -50%);
}
