/* ============================================================
   Location Map
   Old site's contact-page map section (title/description beside
   a map image with pulsing location dots), rebuilt as a block.
   GSAP drives the entrance stagger + hover interaction; CSS
   handles the continuous ambient pulse and static layout.
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
.dma-map-block {
  --dma-map-accent:   #e4002b;
  --dma-map-teal:     #007d8a;
  --dma-map-charcoal: #646569;
  --dma-map-frame-ar: 1000 / 557; /* matches the old USA outline's proportions */
}

/* ── Block shell ─────────────────────────────────────────────── */
.dma-map-block {
  background: #fff;
  padding: 64px 24px;
}
.dma-map-block.alignfull .dma-map-inner {
  max-width: 1200px;
}

.dma-map-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 56px;
  align-items: center;
}

/* ── Text column ──────────────────────────────────────────────── */
.dma-map-title {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--dma-map-teal);
  margin: 0;
}
.dma-map-desc {
  font-size: 20px;
  line-height: 1.4;
  color: var(--dma-map-charcoal);
  font-weight: 400;
  margin: 8px 0 0;
}
.dma-map-hint {
  font-size: 14px;
  font-style: italic;
  color: var(--dma-map-charcoal);
  margin: 16px 0 0;
}

/* ── Map frame ────────────────────────────────────────────────── */
.dma-map-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--dma-map-frame-ar);
}
.dma-map-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* ── Location dot ─────────────────────────────────────────────── */
/*
 * Positioned by inline top/left percent (from ACF's offset_top/offset_left).
 * translate(-50%,-50%) centers the whole dot group on that coordinate
 * rather than anchoring by its top-left corner.
 */
.dma-map-dot {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  outline: none;
  /* Entrance state — GSAP animates to scale:1/opacity:1 on scroll-into-view.
     Falls back to fully visible if JS never runs (no-JS / GSAP failed to load). */
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
}
.dma-map-dot.is-ready {
  opacity: 1;
}
.dma-map-dot:hover,
.dma-map-dot:focus-visible {
  z-index: 10;
}

.dma-map-dot__core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--dma-map-accent);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease;
}
.dma-map-dot:hover .dma-map-dot__core,
.dma-map-dot:focus-visible .dma-map-dot__core {
  transform: scale(1.35);
}

/* Ambient pulse rings — only animate once GSAP marks the dot ready, so the
   entrance pop and the ambient loop never fight over the same transform. */
.dma-map-dot__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  margin: -50px 0 0 -50px;
  border-radius: 50%;
  background: rgba(228, 0, 43, 0.12);
  opacity: 0;
  pointer-events: none;
}
.dma-map-dot.is-ready .dma-map-dot__ring {
  animation: dma-map-pulse 3.6s ease-out infinite;
}
.dma-map-dot__ring--2 {
  animation-delay: 1.2s !important;
}

@keyframes dma-map-pulse {
  0%   { opacity: 0;    transform: scale(0.15); }
  25%  { opacity: 0.55; }
  100% { opacity: 0;    transform: scale(1); }
}

/* Tooltip label — fades/slides in above the dot on hover or keyboard focus */
.dma-map-dot__tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  white-space: nowrap;
  background: #1f1f1f;
  color: #fff;
  font-family: 'space-mono', 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.dma-map-dot__tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f1f1f;
}
.dma-map-dot:hover .dma-map-dot__tooltip,
.dma-map-dot:focus-visible .dma-map-dot__tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dma-map-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
}
@media (max-width: 480px) {
  .dma-map-block {
    padding: 48px 16px;
  }
  .dma-map-title {
    font-size: 26px;
  }
  .dma-map-desc {
    font-size: 17px;
  }
}

/* Respect reduced-motion preference: no pulse loop, no hover pop, instantly
   visible dots (JS also short-circuits its scale-in entrance for the same
   preference — see script.js). */
@media (prefers-reduced-motion: reduce) {
  .dma-map-dot,
  .dma-map-dot.is-ready {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  .dma-map-dot.is-ready .dma-map-dot__ring {
    animation: none;
  }
  .dma-map-dot__core {
    transition: none;
  }
  .dma-map-dot__tooltip {
    transition: none;
  }
}
