/* ==========================================================================
   Globe component — structure only.
   Every colour is a custom property, so each template restyles it by
   redefining the vars on (or above) the [data-globe] host. The site's two
   themes set theirs in assets/site.css (Classic) and skin-editorial.css;
   colours picked in the admin (settings "globe") beat both.
   ========================================================================== */

[data-globe] {
  /* fallback palette, under the legacy names so a template's own
     --g-dot / --g-hot / --g-flag keep working; the themes use
     --g-land / --g-hover / --g-desk / --g-hover-border */
  --g-sea:       #f4f3f1;
  --g-sea-edge:  #e7e5e1;       /* limb fallback when --g-limb is unset */
  --g-dot:       #8e8e8e;       /* land */
  --g-hot:       #8ecfe6;       /* hovered country (its boundary too, unless --g-hover-border) */
  --g-flag:      #e07db4;       /* desks, when highlighted */
  --g-border:    #ffffff;
  --g-ring:      #1a1a1a;
  --g-border-w:  0.7;
  --g-grid-w:    0.6;
  --g-limb-w:    0.8;
  /* Without site settings: --g-style (pixel|dots|solid|outline|wire),
     --g-cell (grid step, px), --g-cell-fill (0.4–1), --g-hover-border-w.
     A colour set to "none"/"transparent" is skipped. */

  --g-tip-bg:    transparent;
  --g-tip-fg:    #111;
  --g-tip-sub:   #6c6c6c;
  --g-chip-bd:   currentColor;

  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 720px;
  margin-inline: auto;
  touch-action: none;
  user-select: none;
}

.globe-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  outline: none;
}
[data-globe].is-drag .globe-canvas { cursor: grabbing; }
/* pixel style: keep the cells square-edged even if the canvas is resampled */
.globe-pixel .globe-canvas { image-rendering: pixelated; }
.globe-canvas:focus-visible {
  outline: 2px solid var(--g-ring);
  outline-offset: 4px;
}

/* floating country label ------------------------------------------------- */
.globe-tip {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .14s ease;
  background: var(--g-tip-bg);
  padding: 2px 0;
  white-space: nowrap;
  z-index: 3;
}
.globe-tip.on { opacity: 1; }
.globe-tip b {
  display: block;
  font-family: var(--g-tip-font, Georgia, "Times New Roman", serif);
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--g-tip-fg);
}
.globe-tip i {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--g-tip-sub);
}
.globe-tip i[hidden] { display: none; }
.globe-tip.muted i { opacity: .55; }

/* keyboard route to the same destinations -------------------------------- */
.globe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 14px;
}
.globe-chip {
  font: inherit;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 5px 10px;
  color: inherit;
  background: none;
  border: 1px solid var(--g-chip-bd);
  border-radius: 0;
  opacity: .5;
  cursor: pointer;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.globe-chip:hover,
.globe-chip:focus-visible { opacity: 1; }

@media (max-width: 620px) {
  [data-globe] { max-width: 100%; }
  .globe-tip b { font-size: 15px; }
}
