/*
 * Hamat International Contracting Company — Animated Global Footprint Map (#footprint)
 * Dark obsidian (#0B0B0A) + warm halftone orange (#F07D05) cartographic overlay.
 * Pure CSS @keyframes motion (no SMIL), 2.5s–4.0s loop cadence, WCAG 2.2.2 pause & reduced-motion support.
 */

.hm-gmap,
[data-animated-map="global"] {
  --m-cycle: 3.4s;
  --hm-gmap-bg: #0B0B0A;
  --hm-gmap-orange: var(--hm-orange, #F07D05);
  --hm-gmap-orange-bright: #FFA347;
  --hm-gmap-ink: #FAF7F2;
  --hm-gmap-sub: #E5DFD5;
  position: relative;
  display: block;
  width: 100%;
  background: var(--hm-gmap-bg);
}

/* Force LTR inside the coordinate stage so SVG positions & text-anchor never flip on RTL pages */
.hm-gmap__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 794 / 440;
  background: var(--hm-gmap-bg);
  overflow: hidden;
  direction: ltr;
  isolation: isolate;
}

/* Soft edge vignette blends dotted canvas cleanly into frame */
.hm-gmap__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    ellipse 88% 86% at 50% 48%,
    transparent 58%,
    rgba(11, 11, 10, 0.54) 100%
  );
}

@media (max-width: 639px) {
  .hm-gmap__stage {
    min-height: 220px;
  }
}

/* Base dotted world image (keeps 4,600+ dots out of the DOM) */
.hm-gmap__stage > .hm-gmap__base {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  opacity: 0.90;
  transition: opacity 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Lean interactive SVG overlay locked 1:1 to base viewBox (0 330 794 440) */
.hm-gmap__stage > .hm-gmap__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* ---------- Flight Corridors & Animated Pulses ---------- */
.hm-gmap__route-base {
  fill: none;
  stroke: var(--hm-gmap-orange);
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-opacity: 0.36;
  pointer-events: none;
  transition:
    stroke-opacity 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    stroke-width 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    stroke 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hm-gmap__route-base--dashed {
  stroke-dasharray: 3.5 7;
  stroke-opacity: 0.32;
}

.hm-gmap__route-pulse {
  fill: none;
  stroke: var(--hm-gmap-orange-bright);
  stroke-width: 2.55;
  stroke-linecap: round;
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(240, 125, 5, 0.82));
  transition:
    stroke 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    stroke-width 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    stroke-opacity 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Normalized pathLength="100": dash enters cleanly at 0 and exits past 100 with zero wrap overlap */
@keyframes hm-gmap-flow {
  0% {
    stroke-dashoffset: 24;
    opacity: 0;
  }
  10% {
    opacity: 0.96;
  }
  84% {
    opacity: 0.96;
  }
  100% {
    stroke-dashoffset: -102;
    opacity: 0;
  }
}

@keyframes hm-gmap-flow-bi {
  0% {
    stroke-dashoffset: 20;
    opacity: 0;
  }
  12% {
    opacity: 0.82;
  }
  88% {
    opacity: 0.82;
  }
  100% {
    stroke-dashoffset: -102;
    opacity: 0;
  }
}

.hm-gmap__route-pulse--tj {
  stroke-dasharray: 22 128;
  animation: hm-gmap-flow 3.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.hm-gmap__route-pulse--aj {
  stroke-dasharray: 24 128;
  animation: hm-gmap-flow 3.0s cubic-bezier(0.4, 0, 0.2, 1) -1.1s infinite;
}

.hm-gmap__route-pulse--ta {
  stroke: var(--hm-gmap-orange);
  stroke-width: 2.05;
  stroke-dasharray: 18 128;
  animation: hm-gmap-flow-bi 3.6s ease-in-out -0.6s infinite alternate;
}

/* ---------- Hub Beacons & Concentric Radar Pulses ---------- */
.hm-gmap__hub {
  cursor: pointer;
  transition: opacity 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hm-gmap__hub:focus-visible {
  outline: 2px solid var(--hm-gmap-orange);
  outline-offset: 4px;
}

.hm-gmap__hit {
  fill: transparent;
  stroke: none;
}

.hm-gmap__radar,
.hm-gmap__beacon {
  fill: none;
  stroke: var(--hm-gmap-orange);
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
}

.hm-gmap__radar {
  stroke-width: 1.5;
}

.hm-gmap__beacon {
  stroke-width: 1.35;
}

@keyframes hm-gmap-radar {
  0% {
    transform: scale(0.58);
    opacity: 0.86;
  }
  65% {
    opacity: 0.34;
  }
  100% {
    transform: scale(2.42);
    opacity: 0;
  }
}

@keyframes hm-gmap-beacon {
  0% {
    transform: scale(0.72);
    opacity: 0.72;
  }
  68% {
    opacity: 0.24;
  }
  100% {
    transform: scale(2.05);
    opacity: 0;
  }
}

.hm-gmap__radar--1 {
  animation: hm-gmap-radar 3.2s cubic-bezier(0.18, 0.72, 0.32, 1) infinite;
}

.hm-gmap__radar--2 {
  animation: hm-gmap-radar 3.2s cubic-bezier(0.18, 0.72, 0.32, 1) -1.6s infinite;
}

.hm-gmap__beacon {
  animation: hm-gmap-beacon 3.4s cubic-bezier(0.2, 0.7, 0.3, 1) -0.4s infinite;
}

.hm-gmap__beacon--delay {
  animation-delay: -2.0s;
}

.hm-gmap__ring {
  fill: rgba(240, 125, 5, 0.06);
  stroke: var(--hm-gmap-orange);
  stroke-width: 1.5;
  stroke-opacity: 0.78;
  transition:
    fill 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    stroke-width 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    stroke-opacity 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hm-gmap__ring--primary {
  fill: rgba(240, 125, 5, 0.10);
  stroke-width: 1.8;
  stroke-opacity: 0.90;
}

.hm-gmap__core {
  fill: var(--hm-gmap-ink);
  stroke: var(--hm-gmap-orange);
  stroke-width: 1.6;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hm-gmap__core--primary {
  fill: var(--hm-gmap-orange);
  stroke: none;
  filter: drop-shadow(0 0 6px rgba(240, 125, 5, 0.72));
}

.hm-gmap__pip {
  fill: var(--hm-gmap-ink);
  pointer-events: none;
}

/* ---------- Localized Hub Labels with Obsidian Backdrop Plates ---------- */
.hm-gmap__label {
  cursor: pointer;
  transition: opacity 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hm-gmap__label-bg {
  fill: rgba(11, 11, 10, 0.90);
  stroke: rgba(240, 125, 5, 0.34);
  stroke-width: 1.1;
  transition:
    fill 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    stroke 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    stroke-width 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hm-gmap__label-leader {
  fill: none;
  stroke: rgba(240, 125, 5, 0.52);
  stroke-width: 1.25;
  stroke-dasharray: 2.5 3.5;
  pointer-events: none;
  transition: stroke 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hm-gmap__label-leader[hidden] {
  display: none;
}

.hm-gmap__city {
  fill: var(--hm-gmap-ink);
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.2px;
  paint-order: stroke fill;
  stroke: var(--hm-gmap-bg);
  stroke-width: 7px;
  stroke-linejoin: round;
  transition: fill 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hm-gmap__role {
  fill: var(--hm-gmap-sub);
  font-family: 'Lato', Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  paint-order: stroke fill;
  stroke: var(--hm-gmap-bg);
  stroke-width: 6px;
  stroke-linejoin: round;
  transition: fill 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Arabic typography inside the LTR coordinate stage */
.hm-gmap--ar .hm-gmap__city {
  font-family: 'Readex Pro', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0;
  unicode-bidi: plaintext;
}

.hm-gmap--ar .hm-gmap__role {
  font-family: 'IBM Plex Sans Arabic', 'Readex Pro', system-ui, sans-serif;
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: 0;
  unicode-bidi: plaintext;
}

/* Compact / mobile (<= 480px) larger legible typography & plate framing */
@media (max-width: 480px) {
  .hm-gmap__city {
    font-size: 20px;
    letter-spacing: 0.7px;
  }

  .hm-gmap__role {
    font-size: 16.5px;
  }

  .hm-gmap--ar .hm-gmap__city {
    font-size: 20.5px;
    letter-spacing: 0;
  }

  .hm-gmap--ar .hm-gmap__role {
    font-size: 17px;
    letter-spacing: 0;
  }

  .hm-gmap__label-bg {
    fill: rgba(11, 11, 10, 0.94);
    stroke: rgba(240, 125, 5, 0.44);
    stroke-width: 1.4;
  }
}

.hm-gmap.is-compact .hm-gmap__city {
  font-size: 20px;
  letter-spacing: 0.7px;
}

.hm-gmap.is-compact .hm-gmap__role {
  font-size: 16.5px;
}

.hm-gmap.is-compact.hm-gmap--ar .hm-gmap__city {
  font-size: 20.5px;
  letter-spacing: 0;
}

.hm-gmap.is-compact.hm-gmap--ar .hm-gmap__role {
  font-size: 17px;
  letter-spacing: 0;
}

.hm-gmap.is-compact .hm-gmap__label-bg {
  fill: rgba(11, 11, 10, 0.94);
  stroke: rgba(240, 125, 5, 0.44);
  stroke-width: 1.4;
}

/* ---------- Bi-Directional Active Hub & Corridor Highlight ---------- */
.hm-gmap[data-active-hub] .hm-gmap__stage > .hm-gmap__base {
  opacity: 0.70;
}

.hm-gmap[data-active-hub] .hm-gmap__route-base {
  stroke-opacity: 0.14;
}

.hm-gmap[data-active-hub] .hm-gmap__route-pulse {
  stroke-opacity: 0.22;
}

.hm-gmap[data-active-hub] .hm-gmap__hub,
.hm-gmap[data-active-hub] .hm-gmap__label {
  opacity: 0.44;
}

.hm-gmap[data-active-hub="jeddah"] .hm-gmap__route-base[data-hubs~="jeddah"],
.hm-gmap[data-active-hub="toledo"] .hm-gmap__route-base[data-hubs~="toledo"],
.hm-gmap[data-active-hub="accra"] .hm-gmap__route-base[data-hubs~="accra"] {
  stroke-opacity: 0.90;
  stroke-width: 2.35;
}

.hm-gmap[data-active-hub="jeddah"] .hm-gmap__route-pulse[data-hubs~="jeddah"],
.hm-gmap[data-active-hub="toledo"] .hm-gmap__route-pulse[data-hubs~="toledo"],
.hm-gmap[data-active-hub="accra"] .hm-gmap__route-pulse[data-hubs~="accra"] {
  stroke: #FFB866;
  stroke-opacity: 1;
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(240, 125, 5, 0.95));
}

.hm-gmap[data-active-hub="jeddah"] .hm-gmap__hub[data-hub="jeddah"],
.hm-gmap[data-active-hub="toledo"] .hm-gmap__hub[data-hub="toledo"],
.hm-gmap[data-active-hub="accra"] .hm-gmap__hub[data-hub="accra"],
.hm-gmap[data-active-hub="jeddah"] .hm-gmap__label[data-hub="jeddah"],
.hm-gmap[data-active-hub="toledo"] .hm-gmap__label[data-hub="toledo"],
.hm-gmap[data-active-hub="accra"] .hm-gmap__label[data-hub="accra"] {
  opacity: 1;
}

.hm-gmap[data-active-hub="jeddah"] .hm-gmap__hub[data-hub="jeddah"] .hm-gmap__ring,
.hm-gmap[data-active-hub="toledo"] .hm-gmap__hub[data-hub="toledo"] .hm-gmap__ring,
.hm-gmap[data-active-hub="accra"] .hm-gmap__hub[data-hub="accra"] .hm-gmap__ring {
  fill: rgba(240, 125, 5, 0.20);
  stroke-opacity: 1;
  stroke-width: 2.25;
}

.hm-gmap[data-active-hub="jeddah"] .hm-gmap__hub[data-hub="jeddah"] .hm-gmap__core,
.hm-gmap[data-active-hub="toledo"] .hm-gmap__hub[data-hub="toledo"] .hm-gmap__core,
.hm-gmap[data-active-hub="accra"] .hm-gmap__hub[data-hub="accra"] .hm-gmap__core {
  transform: scale(1.18);
}

.hm-gmap[data-active-hub="jeddah"] .hm-gmap__label[data-hub="jeddah"] .hm-gmap__label-bg,
.hm-gmap[data-active-hub="toledo"] .hm-gmap__label[data-hub="toledo"] .hm-gmap__label-bg,
.hm-gmap[data-active-hub="accra"] .hm-gmap__label[data-hub="accra"] .hm-gmap__label-bg {
  fill: rgba(11, 11, 10, 0.96);
  stroke: var(--hm-gmap-orange);
  stroke-width: 1.5;
}

.hm-gmap[data-active-hub="jeddah"] .hm-gmap__label[data-hub="jeddah"] .hm-gmap__label-leader {
  stroke: var(--hm-gmap-orange);
}

.hm-gmap[data-active-hub="jeddah"] .hm-gmap__label[data-hub="jeddah"] .hm-gmap__city,
.hm-gmap[data-active-hub="toledo"] .hm-gmap__label[data-hub="toledo"] .hm-gmap__city,
.hm-gmap[data-active-hub="accra"] .hm-gmap__label[data-hub="accra"] .hm-gmap__city {
  fill: #FFFFFF;
}

.hm-gmap[data-active-hub="jeddah"] .hm-gmap__label[data-hub="jeddah"] .hm-gmap__role,
.hm-gmap[data-active-hub="toledo"] .hm-gmap__label[data-hub="toledo"] .hm-gmap__role,
.hm-gmap[data-active-hub="accra"] .hm-gmap__label[data-hub="accra"] .hm-gmap__role {
  fill: var(--hm-gmap-orange);
}

/* ---------- Synced Hub List Rows (#footprint .rows > li[data-hub]) ---------- */
#footprint .rows > li[data-hub] {
  cursor: pointer;
  transition:
    border-color 160ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#footprint .rows > li[data-hub] .rows__value,
#footprint .rows > li[data-hub] .rows__name {
  transition: color 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#footprint .rows > li[data-hub]:hover,
#footprint .rows > li[data-hub]:focus-within,
#footprint .rows > li[data-hub].is-hub-active {
  border-bottom-color: var(--hm-orange, #F07D05);
}

#footprint .rows > li[data-hub]:hover .rows__name,
#footprint .rows > li[data-hub]:focus-within .rows__name,
#footprint .rows > li[data-hub].is-hub-active .rows__name {
  color: var(--ink, #F2EEE6);
}

#footprint .rows > li[data-hub]:hover .rows__value,
#footprint .rows > li[data-hub]:focus-within .rows__value,
#footprint .rows > li[data-hub].is-hub-active .rows__value {
  color: var(--hm-orange, #F07D05);
}

/* ---------- Pause / Play Control (WCAG 2.2.2 + loop-pause) ---------- */
.hm-gmap .hm-gmap__pause {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 1px solid rgba(242, 238, 230, 0.24);
  background: rgba(11, 11, 10, 0.90);
  color: var(--hm-gmap-ink);
  cursor: pointer;
  transition:
    border-color 150ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 150ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hm-gmap .hm-gmap__pause::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
}

/* Explicit specificity beats .hm-map-frame svg { width: 100% } in hamat.css */
.hm-gmap .hm-gmap__pause svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: currentColor;
}

.hm-gmap .hm-gmap__pause:hover {
  border-color: var(--hm-gmap-orange);
  color: var(--hm-gmap-orange);
  background: rgba(21, 21, 19, 0.96);
}

.hm-gmap .hm-gmap__pause:focus-visible {
  outline: 2px solid var(--hm-gmap-orange);
  outline-offset: 2px;
}

@media (max-width: 639px) {
  .hm-gmap .hm-gmap__pause {
    right: 8px;
    bottom: 8px;
  }
}

/* Paused or off-screen state stops every loop cleanly */
.hm-gmap.is-paused .hm-gmap__route-pulse,
.hm-gmap.is-paused .hm-gmap__radar,
.hm-gmap.is-paused .hm-gmap__beacon,
.hm-gmap.is-offscreen .hm-gmap__route-pulse,
.hm-gmap.is-offscreen .hm-gmap__radar,
.hm-gmap.is-offscreen .hm-gmap__beacon {
  animation-play-state: paused;
}

/* ---------- Reduced Motion (Strict 0-movement static cartographic still) ---------- */
@media (prefers-reduced-motion: reduce) {
  .hm-gmap,
  .hm-gmap__stage,
  .hm-gmap__base,
  .hm-gmap__overlay,
  .hm-gmap__route-base,
  .hm-gmap__route-pulse,
  .hm-gmap__route-pulse--tj,
  .hm-gmap__route-pulse--aj,
  .hm-gmap__route-pulse--ta,
  .hm-gmap__hub,
  .hm-gmap__radar,
  .hm-gmap__radar--1,
  .hm-gmap__radar--2,
  .hm-gmap__beacon,
  .hm-gmap__beacon--delay,
  .hm-gmap__ring,
  .hm-gmap__core,
  .hm-gmap__label,
  .hm-gmap__label-bg,
  .hm-gmap__label-leader,
  .hm-gmap__city,
  .hm-gmap__role,
  .hm-gmap__pause,
  #footprint .rows > li[data-hub],
  #footprint .rows > li[data-hub] .rows__name,
  #footprint .rows > li[data-hub] .rows__value {
    animation: none !important;
    transition: none !important;
  }

  /* Present balanced static target rings & crisp routes matching the brand graphic */
  .hm-gmap__route-base {
    stroke-opacity: 0.78;
  }

  .hm-gmap__route-pulse {
    opacity: 0;
  }

  .hm-gmap__radar--1 {
    transform: scale(1.95);
    opacity: 0.42;
  }

  .hm-gmap__radar--2 {
    transform: scale(1.22);
    opacity: 0.26;
  }

  .hm-gmap__beacon {
    transform: scale(1.68);
    opacity: 0.44;
  }

  .hm-gmap .hm-gmap__pause {
    display: none;
  }
}
