/**
 * ASDF "Where We Work" — dotted map.
 *
 * Ships with this plugin (never resolved from the theme) so the map is styled
 * even when the active theme's about.css is an older build. Custom properties
 * all carry literal fallbacks for the same reason.
 */

.about-map {
  position: relative;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  aspect-ratio: 1440 / 536;
}

/* Fallback for browsers without aspect-ratio. */
@supports not (aspect-ratio: 1 / 1) {
  .about-map { height: 0; padding-bottom: 37.22%; }
}

.about-map-dots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.about-map-dots circle {
  fill: var(--border-lavender, #dfd2e3);
  transition: fill 0.3s ease;
}

.about-map-pins {
  position: absolute;
  inset: 0;
}

.about-map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
  /* Stagger the entrance so pins drop in rather than all appearing at once. */
  animation: asdf-map-in 0.5s both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.about-map-pin:hover,
.about-map-pin.is-active { z-index: 5; }
.about-map-pin:focus-visible { outline: none; }

@keyframes asdf-map-in {
  from { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---- The flag chip is the marker (always visible) ---- */
/* 20px, not larger: at world scale the East African countries sit close
   together, and measured centre-to-centre gaps there are only 17–22px. A
   bigger chip turns the region into one indistinct blob. */
.about-map-flag {
  position: relative;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--white, #fff);
  border: 2px solid var(--primary-purple, #5e1062);
  box-shadow: 0 2px 8px rgba(94, 16, 98, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.about-map-flag .flag {
  font-size: 11px;
  line-height: 1;
  /* Keeps the emoji circular inside the chip. */
  transform: translateZ(0);
}
.about-map-pin:hover .about-map-flag,
.about-map-pin:focus-visible .about-map-flag,
.about-map-pin.is-active .about-map-flag {
  transform: scale(1.18);
  border-color: var(--accent-purple, #7d1c82);
}

.about-map-ping {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--primary-purple, #5e1062);
  opacity: 0.5;
  animation: asdf-map-ping 2.8s cubic-bezier(0, 0, 0.2, 1) infinite;
  animation-delay: calc(var(--i, 0) * 220ms);
  pointer-events: none;
}
@keyframes asdf-map-ping {
  0%   { transform: scale(1);   opacity: 0.5; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ---- Name chip, revealed on hover/tap ---- */
.about-map-name {
  padding: 5px 12px;
  border-radius: 30px;
  background: var(--primary-purple, #5e1062);
  color: var(--white, #fff);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(94, 16, 98, 0.24);
  opacity: 0;
  transform: translateX(-6px) scale(0.94);
  transform-origin: left center;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.about-map-pin:hover .about-map-name,
.about-map-pin:focus-visible .about-map-name,
.about-map-pin.is-active .about-map-name {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Pins near the right edge open their name to the left instead. */
.about-map-pin.is-left { flex-direction: row-reverse; }
.about-map-pin.is-left .about-map-name {
  transform-origin: right center;
  transform: translateX(6px) scale(0.94);
}
.about-map-pin.is-left:hover .about-map-name,
.about-map-pin.is-left:focus-visible .about-map-name,
.about-map-pin.is-left.is-active .about-map-name { transform: translateX(0) scale(1); }

/* ---- Small screens: labels always on, map a touch taller ---- */
@media (max-width: 720px) {
  .about-map-dots circle { fill: #e7dcea; }
  .about-map-flag { width: 16px; height: 16px; border-width: 1.5px; }
  .about-map-flag .flag { font-size: 9px; }
  .about-map-name { padding: 4px 9px; font-size: 11px; }
  /* Only the tapped pin shows its name, so the map does not turn into soup. */
  .about-map-pin .about-map-name { opacity: 0; }
  .about-map-pin.is-active .about-map-name { opacity: 1; }
}

/* Screen-reader / no-JS fallback list. */
.about-map-list {
  list-style: none;
  margin: 26px auto 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  max-width: 820px;
}
.about-map-list li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 30px;
  background: var(--bg-lavender, #f4ecf5);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark, #2a252c);
}
.about-map-list .flag { font-size: 15px; line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  .about-map-pin { animation: none; }
  .about-map-ping { animation: none; opacity: 0; }
}
