/**
 * HLI Global Presence - Scoped Stylesheet
 * Scoped to .hli-presence-wrapper to prevent conflicts with any WordPress theme.
 */

.hli-presence-wrapper {
  --hli-red: #bd2029;
  --hli-red-dark: #a91520;
  --hli-green: #16a34a;
  --hli-ink: #151515;
  --hli-muted: #666666;
  --hli-line: #c9c9c9;
  --hli-panel: #ffffff;
  
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
  padding: 50px clamp(22px, 5.8vw, 94px) 28px;
  font-family: Montserrat, sans-serif;
  color: var(--hli-ink);
  background: #ffffff;
  box-sizing: border-box;
  overflow: hidden;
}

.hli-presence-wrapper *,
.hli-presence-wrapper *::before,
.hli-presence-wrapper *::after {
  box-sizing: border-box;
}

/* Heading */
.hli-presence-wrapper .page-heading {
  position: relative;
  z-index: 3;
  margin-bottom: 24px;
}

.hli-presence-wrapper .hli-presence-title {
  margin: 0;
  font-size: clamp(34px, 3.3vw, 58px);
  line-height: 1.12;
  letter-spacing: -1.5px;
  font-weight: 700;
  color: var(--hli-ink);
  font-family: inherit;
}

.hli-presence-wrapper .hli-presence-title span {
  color: var(--hli-red);
}

/* Layout */
.hli-presence-wrapper .presence-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  min-height: calc(100vh - 180px);
  position: relative;
}

/* Left panel: Continents and Countries */
.hli-presence-wrapper .country-panel {
  position: relative;
  z-index: 4;
  max-width: 590px;
  padding: 28px 0 22px;
}

.hli-presence-wrapper .continent-list {
  width: 100%;
}

.hli-presence-wrapper .continent {
  border-bottom: 1px solid #b9b9b9;
}

.hli-presence-wrapper .continent-toggle {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 17px 0 16px;
  border: 0;
  background: transparent;
  color: #111111;
  text-align: left;
  font-family: Montserrat, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: color 0.15s ease;
}

.hli-presence-wrapper .continent-toggle:focus-visible,
.hli-presence-wrapper .country-pill:focus-visible {
  outline: 2px solid var(--hli-red);
  outline-offset: 3px;
}

.hli-presence-wrapper .chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #111111;
  transition: transform 0.2s ease;
  flex: none;
}

.hli-presence-wrapper .continent-toggle[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

.hli-presence-wrapper .country-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 13px;
  padding: 2px 0 25px 20px;
}

.hli-presence-wrapper .country-pill {
  position: relative;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  color: #333333;
  border-radius: 999px;
  padding: 8px 22px;
  min-height: 42px;
  box-shadow: 0 5px 13px rgba(0, 0, 0, 0.08);
  font-family: Montserrat, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
  white-space: nowrap;
}

.hli-presence-wrapper .country-pill:hover {
  transform: translateY(-1px);
  border-color: #d7a2a5;
}

.hli-presence-wrapper .country-pill[aria-pressed="true"] {
  background: var(--hli-red);
  border-color: var(--hli-red);
  color: #ffffff;
  box-shadow: 0 6px 15px rgba(189, 32, 41, 0.27);
}

/* Legend */
.hli-presence-wrapper .map-legend {
  margin-top: clamp(45px, 8vh, 90px);
  font-size: 14px;
  color: #000;
}

.hli-presence-wrapper .map-legend p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  line-height: 1.4;
}

.hli-presence-wrapper .legend-dot,
.hli-presence-wrapper .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.hli-presence-wrapper .red,
.country-tooltip .dot.red {
  background: #d71920;
}

.hli-presence-wrapper .green,
.country-tooltip .dot.green {
  background: #40ac19;
}

/* Right panel: Globe & Map */
.hli-presence-wrapper .globe-panel {
  position: relative;
  min-height: min(78vh, 760px);
  height: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  overflow: visible;
}

.hli-presence-wrapper .globe-orb {
  position: absolute;
  width: min(48vw, 760px);
  height: min(48vw, 760px);
  min-width: 500px;
  min-height: 500px;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 35% 28%, #999999 0%, #c1c1c1 45%, #cbc1c1 72%, #c1c1c1 100%);
  box-shadow: inset 20px 15px 45px rgb(255 255 255 / 11%), inset -30px -20px 55px rgba(119, 119, 119, 0.25), 0 0 30px rgba(0, 0, 0, 0.03);
}

.hli-presence-wrapper .globe-orb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 35% 25%, rgba(255, 255, 255, 0.54) 0%, transparent 48%),
              linear-gradient(110deg, transparent 55%, rgba(122, 122, 122, 0.09) 100%);
  z-index: 2;
  pointer-events: none;
}

.hli-presence-wrapper .globe-grid {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image: linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 100% 13%, 13% 100%;
  opacity: 0.8;
  z-index: 1;
  pointer-events: none;
}

.hli-presence-wrapper .world-map-svg {
  transform: scale(1.5);
  position: absolute;
  inset: 5% 0 0 -2%;
  width: 105%;
  height: 90%;
  overflow: visible;
  z-index: 1;
  filter: drop-shadow(0 1px 1px rgba(119, 119, 119, 0.13));
}

.hli-presence-wrapper .country {
  fill: #f8f8f8;
  stroke: #d1d1d1;
  stroke-width: 0.65;
  vector-effect: non-scaling-stroke;
  transition: fill 0.18s, stroke 0.18s;
  cursor: pointer;
}

.hli-presence-wrapper .country.has-data {
  fill: #f7f7f7;
}

.hli-presence-wrapper .country:hover {
  fill: #f3b8bb;
  stroke: #ffffff;
  stroke-width: 1.2;
}

.hli-presence-wrapper .country.is-selected {
  fill: #c81925 !important;
  stroke: #ffffff !important;
  stroke-width: 0.6 !important;
  filter: drop-shadow(0 0 5px rgba(200, 25, 37, 0.5));
}

.hli-presence-wrapper .globe-glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(ellipse at 28% 25%, rgba(255, 255, 255, 0.36) 0%, transparent 45%),
              linear-gradient(110deg, transparent 65%, rgba(102, 102, 102, 0.07) 100%);
}

.hli-presence-wrapper .map-status {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  color: #777777;
  font-size: 14px;
  white-space: nowrap;
}

.hli-presence-wrapper .map-status:empty {
  display: none;
}

/* Tooltip: ABSOLUTE Positioning (anchored inside .country-panel so it scrolls naturally with page) */
.hli-presence-wrapper .country-panel {
  position: relative !important;
  overflow: visible !important;
}

.hli-presence-wrapper .country-tooltip,
.country-tooltip {
  position: absolute !important;
  z-index: 9999 !important;
  min-width: 120px !important;
  max-width: 190px !important;
  padding: 10px 14px !important;
  background: #ffffff !important;
  border: 1px solid #b9b9b9 !important;
  border-radius: 7px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  font-family: Montserrat, sans-serif;
  font-size: 13px !important;
  line-height: 1.35 !important;
  color: #151515 !important;
  pointer-events: auto !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Tooltip Arrow Base */
.hli-presence-wrapper .country-tooltip::before,
.country-tooltip::before {
  content: "" !important;
  position: absolute !important;
  width: 10px !important;
  height: 10px !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  z-index: 1 !important;
}

/* Arrow: Placed to Right of Button */
.hli-presence-wrapper .country-tooltip.is-right::before,
.country-tooltip.is-right::before {
  left: -5px !important;
  right: auto !important;
  top: 50% !important;
  bottom: auto !important;
  border-left: 1px solid #b9b9b9 !important;
  border-bottom: 1px solid #b9b9b9 !important;
  border-top: none !important;
  border-right: none !important;
  transform: translateY(-50%) rotate(45deg) !important;
}

/* Arrow: Placed to Left of Button */
.hli-presence-wrapper .country-tooltip.is-left::before,
.country-tooltip.is-left::before {
  right: -5px !important;
  left: auto !important;
  top: 50% !important;
  bottom: auto !important;
  border-top: 1px solid #b9b9b9 !important;
  border-right: 1px solid #b9b9b9 !important;
  border-left: none !important;
  border-bottom: none !important;
  transform: translateY(-50%) rotate(45deg) !important;
}

/* Arrow: Placed Below Button */
.hli-presence-wrapper .country-tooltip.is-below::before,
.country-tooltip.is-below::before {
  top: -5px !important;
  bottom: auto !important;
  left: var(--arrow-x, 24px) !important;
  right: auto !important;
  border-top: 1px solid #b9b9b9 !important;
  border-left: 1px solid #b9b9b9 !important;
  border-right: none !important;
  border-bottom: none !important;
  transform: rotate(45deg) !important;
}

/* Arrow: Placed Above Button */
.hli-presence-wrapper .country-tooltip.is-above::before,
.country-tooltip.is-above::before {
  bottom: -5px !important;
  top: auto !important;
  left: var(--arrow-x, 24px) !important;
  right: auto !important;
  border-bottom: 1px solid #b9b9b9 !important;
  border-right: 1px solid #b9b9b9 !important;
  border-top: none !important;
  border-left: none !important;
  transform: rotate(45deg) !important;
}

/* Tooltip Title */
.hli-presence-wrapper .country-tooltip strong,
.hli-presence-wrapper .country-tooltip .tooltip-country,
.country-tooltip strong {
  display: none !important;
  font-family: Montserrat, sans-serif;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  color: #111111 !important;
  margin: 0 0 8px 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  text-align: left !important;
}

/* Tooltip Metric Rows */
.hli-presence-wrapper .country-tooltip .tooltip-row,
.hli-presence-wrapper .country-tooltip span,
.country-tooltip .tooltip-row,
.country-tooltip span {
  display: block !important;
  width: 50%;
  float: left;
  /* align-items: center !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  gap: 10px !important; */
  margin: 0px 0 0 0 !important;
  padding: 0 !important;
  color: #000 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  text-align: left !important;
  white-space: nowrap !important;
}

/* Tooltip Dots */
.hli-presence-wrapper .country-tooltip .tooltip-dot,
.hli-presence-wrapper .country-tooltip .dot,
.country-tooltip .tooltip-dot,
.country-tooltip .dot {
  display: inline-block !important;
  width: 9px !important;
  height: 9px !important;
  min-width: 9px !important;
  max-width: 9px !important;
  min-height: 9px !important;
  max-height: 9px !important;
  border-radius: 50% !important;
  flex: 0 0 9px !important;
  margin: 0 10px 0 0 !important; /* CRITICAL: Explicit right margin guarantees spacing */
  padding: 0 !important;
  position: static !important;
  float: none !important;
  box-shadow: none !important;
  vertical-align: middle !important;
}

.hli-presence-wrapper .country-tooltip .tooltip-dot.red,
.hli-presence-wrapper .country-tooltip .dot.red,
.country-tooltip .tooltip-dot.red,
.country-tooltip .dot.red {
  background-color: #d71920 !important;
}

.hli-presence-wrapper .country-tooltip .tooltip-dot.green,
.hli-presence-wrapper .country-tooltip .dot.green,
.country-tooltip .tooltip-dot.green,
.country-tooltip .dot.green {
  background-color: #40ac19 !important;
}

/* Tooltip Numeric Values */
.hli-presence-wrapper .country-tooltip .tooltip-value,
.hli-presence-wrapper .country-tooltip b,
.country-tooltip .tooltip-value,
.country-tooltip b {
  display: inline-block !important;
  font-family: Montserrat, sans-serif;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  color: #111111 !important;
  position: static !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  letter-spacing: normal !important;
  vertical-align: middle !important;
}

/* Footer */
.hli-presence-wrapper .hli-presence-footer {
  font-size: 11px;
  color: #777777;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  z-index: 4;
  margin-top: 28px;
}

/* Responsive: 900px */
@media (max-width: 900px) {
  .hli-presence-wrapper {
    padding: 30px 24px 24px;
  }
  
  .hli-presence-wrapper .presence-layout {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: auto;
  }
  
  .hli-presence-wrapper .country-panel {
    max-width: none;
    padding: 24px 0 12px;
    position: relative;
    overflow: visible;
  }
  
  .hli-presence-wrapper .continent-toggle {
    font-size: 18px;
    padding: 15px 0;
  }
  
  .hli-presence-wrapper .country-grid {
    padding-left: 18px;
    gap: 10px;
  }
  
  .hli-presence-wrapper .country-pill {
    font-size: 14px;
    padding: 8px 16px;
    min-height: 30px;
  }
  
  .hli-presence-wrapper .map-legend {
    margin-top: -10px;
    margin-bottom: 12px;
  }
  
  .hli-presence-wrapper .globe-panel {
    min-height: 420px;
    overflow: hidden;
    margin: 0 -24px;
  }
  
  .hli-presence-wrapper .globe-orb {
    width: min(86vw, 590px);
    height: min(86vw, 590px);
    min-width: 0;
    min-height: 0;
    right: 50%;
    top: 50%;
    transform: translate(50%, -50%);
  }
  
  .hli-presence-wrapper .world-map-svg {
    inset: 7% 0 0 -2%;
    width: 105%;
    height: 88%;
  }

  .country-tooltip {
    max-width: calc(100vw - 48px) !important;
  }
}

/* Responsive: 520px */
@media (max-width: 520px) {

  .hli-fade-effect {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    height: 130px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 60%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
}
  .hli-presence-wrapper {
    padding: 24px 18px 20px;
  }
  
  .hli-presence-wrapper .hli-presence-title {
    font-size: 28px;
    letter-spacing: 0px;
  }
  
  .hli-presence-wrapper .country-grid {
    padding-left: 0px;
    gap: 8px;
  }
  
  .hli-presence-wrapper .country-pill {
    font-size: 12px;
    padding: 7px 14px;
    font-weight: 600;
  }
  
  .hli-presence-wrapper .globe-panel {
    min-height: 360px;
    overflow: hidden;
    margin: 0 -18px;
  }
  
  .hli-presence-wrapper .globe-orb {
    width: min(90vw, 420px);
    height: min(90vw, 420px);
    right: 50%;
    transform: translate(50%, -50%);
  }
  
  .country-tooltip {
    font-size: 12px;
    min-width: 102px;
    padding: 7px 10px;
  }
  
  .hli-presence-wrapper .map-legend {
    font-size: 12px;
  }
  .hli-presence-wrapper .continent-list{
        order: 1;
  }
  
  .hli-presence-wrapper .country-panel {
    order: 1;
    display: grid;
  }
}
