/* ==========================================================================
   LP02 · UNIT 7 · LOCAL COMMUNICATION AND SUPPORT — pixel UAE map
   --------------------------------------------------------------------------
   Deep-teal → navy field (the regional brand assets live on navy).
   • Copy at inline-start, followed by three language "speech" cards —
     each a real person's portrait with a bubble showing the language name
     in its own script (العربية · English · اردو) and its English name.
   • At inline-end, the brand's pixel map of the UAE: data pixels with
     faded edges and loose pixels drifting west, plus three soft pins.
     Geography is never mirrored in RTL.
   Entrance (local.js, once): pixels sweep in west → east, pins drop and
   pulse once, bubbles pop in turn. Bubbles then float gently (CSS).
   ========================================================================== */

.local {
  background: linear-gradient(160deg, var(--c-deep-teal) 0%, #032356 45%, var(--c-navy) 100%);
}

.local__decor {
  background:
    radial-gradient(ellipse 45% 55% at 80% 45%, rgba(0, 169, 182, 0.22), transparent 70%),
    radial-gradient(ellipse 35% 40% at 0% 100%, rgba(0, 169, 182, 0.08), transparent 70%);
}

[dir="rtl"] .local__decor {
  scale: -1 1;
}

.local__grid {
  display: grid;
  gap: clamp(3rem, 6vw, 4.5rem);
  align-items: center;
}

@media (min-width: 48rem) {
  .local__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* ---------------------------------------------------------------------------
   Copy
   --------------------------------------------------------------------------- */
.local__copy {
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
  text-align: center;
}

@media (min-width: 48rem) {
  .local__copy {
    justify-items: start;
    text-align: start;
  }
}

.local__copy .t-lead {
  max-inline-size: 34rem;
}

/* ---------------------------------------------------------------------------
   Language speech cards
   --------------------------------------------------------------------------- */
.langs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  inline-size: 100%;
  max-inline-size: 30rem;
  margin-block-start: var(--space-sm);
}

.lang {
  display: grid;
  justify-items: center;
  gap: var(--space-sm);
  animation: lang-float 5s var(--ease-in-out) infinite;
}

.lang:nth-child(2) { animation-delay: -1.6s; }
.lang:nth-child(3) { animation-delay: -3.2s; }

@keyframes lang-float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -5px; }
}

.lang__avatar {
  order: 2;                       /* portrait sits under its bubble */
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--tone);
}

.lang__bubble {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  inline-size: 100%;
  padding-block: 0.875rem;
  padding-inline: 0.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background-color: rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  text-align: center;
}

/* Bubble tail pointing down at the portrait */
.lang__bubble::after {
  content: "";
  position: absolute;
  inset-block-end: -6px;
  inset-inline-start: 50%;
  inline-size: 12px;
  block-size: 12px;
  margin-inline-start: -6px;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.16);
  border-block-end: 1px solid rgba(255, 255, 255, 0.16);
  background-color: inherit;
  rotate: 45deg;
}

/* Native-script name: system fonts render Arabic/Urdu (no extra files) */
.lang__native {
  font-family: var(--ff-display);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--tone);
}

.lang__native:lang(ar),
.lang__native:lang(ur) {
  font-family: "Segoe UI", "Noto Naskh Arabic", "Geeza Pro", Tahoma, system-ui, sans-serif;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
}

.lang__en {
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--c-on-dark-meta);
}

/* ---------------------------------------------------------------------------
   Pixel UAE map
   --------------------------------------------------------------------------- */
.lmap {
  inline-size: min(100%, 34rem);
  margin-inline: auto;
  direction: ltr;                /* geography never mirrors */
}

.lmap svg {
  inline-size: 100%;
  block-size: auto;
  overflow: visible;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.35));
}

.lmap__dot {
  fill: var(--c-white);
}

.lmap__ring {
  fill: rgba(0, 169, 182, 0.25);
  stroke: rgba(127, 220, 227, 0.8);
  stroke-width: 1.2;
  transform-box: fill-box;
  transform-origin: center;
  animation: lmap-pulse 2.8s var(--ease-out) infinite;
  animation-delay: calc(var(--i, 0) * 0.5s);
}

@keyframes lmap-pulse {
  0%   { scale: 0.6; opacity: 1; }
  100% { scale: 1.8; opacity: 0; }
}

.lmap__pin {
  filter: drop-shadow(0 0 8px rgba(0, 169, 182, 0.8));
}
