/* ========================================
   Map Asie — V2 — composant cinétique éditorial
   Silhouette calligraphique + pins multi-layer animés
   + connexions lumineuses + panneau glassmorphism
   + numéro d'étape massif en filigrane + particules ambient
   ======================================== */

.map-asie {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(93, 138, 168, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(210, 180, 140, 0.06) 0%, transparent 55%),
    var(--color-cream);
}

/* Particules ambient en fond — poussière lumineuse */
.map-asie__particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.map-asie__particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background-color: var(--color-tan);
  opacity: 0;
  animation: map-dust 14s ease-in-out infinite;
}

.map-asie__particles span:nth-child(odd) {
  width: 2px;
  height: 2px;
  background-color: var(--color-blue-deep-aa);
  animation-duration: 18s;
}

.map-asie__particles span:nth-child(3n) {
  animation-duration: 22s;
}

@keyframes map-dust {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  15% { opacity: 0.5; }
  50% { opacity: 0.4; transform: translateY(-40px) scale(1); }
  85% { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(-80px) scale(0.8); }
}

/* --- Intro éditoriale --- */

.map-asie__intro {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 0 auto var(--space-2xl);
}

.map-asie__kicker {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-blue-deep-aa);
  margin-bottom: var(--space-sm);
  position: relative;
}

.map-asie__kicker::before,
.map-asie__kicker::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background-color: currentColor;
  opacity: 0.5;
  vertical-align: middle;
  margin: 0 var(--space-sm);
}

.map-asie__subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: var(--weight-light);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-light);
  margin-top: var(--space-md);
}

/* --- Stage : zone SVG + pins --- */

.map-asie__stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  aspect-ratio: 10 / 7;
}

.map-asie__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* --- Silhouette Asie calligraphique --- */

.map-asie__land {
  fill: none;
  stroke: var(--color-blue-deep-aa);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  stroke-dasharray: 2200;
  stroke-dashoffset: 2200;
  animation: map-land-draw 3s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

.map-asie__land--fill {
  fill: rgba(58, 106, 140, 0.05);
  stroke: none;
  opacity: 0;
  animation: map-fill-fade 2.5s ease-out 1.5s forwards;
}

.map-asie__land--secondary {
  stroke-width: 0.7;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: map-land-draw-2 3s cubic-bezier(0.22, 1, 0.36, 1) 0.9s forwards;
  opacity: 0;
}

@keyframes map-land-draw {
  0% { opacity: 0; stroke-dashoffset: 2200; }
  10% { opacity: 0.8; }
  100% { opacity: 0.55; stroke-dashoffset: 0; }
}

@keyframes map-land-draw-2 {
  0% { opacity: 0; stroke-dashoffset: 1400; }
  10% { opacity: 0.6; }
  100% { opacity: 0.35; stroke-dashoffset: 0; }
}

@keyframes map-fill-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Rose des vents en filigrane (coin haut-gauche) */
.map-asie__compass {
  stroke: var(--color-blue-deep-aa);
  stroke-width: 0.5;
  fill: none;
  opacity: 0;
  animation: map-compass-fade 1.4s ease-out 3s forwards;
  transform-origin: center;
}

@keyframes map-compass-fade {
  from { opacity: 0; transform: rotate(-30deg); }
  to { opacity: 0.35; transform: rotate(0); }
}

/* --- Routes / connexions --- */

.map-asie__route {
  fill: none;
  stroke: var(--color-tan);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 3 7;
  stroke-dashoffset: 400;
  opacity: 0;
  animation: route-trace 3.5s ease-out forwards;
}

.map-asie__route--1 { animation-delay: 2.0s; }
.map-asie__route--2 { animation-delay: 2.4s; }
.map-asie__route--3 { animation-delay: 2.8s; }
.map-asie__route--4 { animation-delay: 3.2s; }

@keyframes route-trace {
  0% { opacity: 0; stroke-dashoffset: 400; }
  20% { opacity: 0.55; }
  100% { opacity: 0.45; stroke-dashoffset: 0; }
}

/* Connexion active (depuis pin actif) */
.map-asie__route.is-active {
  stroke: var(--color-blue-deep-aa);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(58, 106, 140, 0.6));
  animation: route-flow 2.5s linear infinite;
}

@keyframes route-flow {
  to { stroke-dashoffset: -100; }
}

/* Particule de flux qui se déplace sur le path actif */
.map-asie__flux {
  r: 3;
  fill: var(--color-tan);
  filter: drop-shadow(0 0 4px var(--color-tan));
  opacity: 0;
}

.map-asie__flux.is-visible {
  opacity: 1;
  animation: flux-move 3.5s linear infinite;
}

@keyframes flux-move {
  to { offset-distance: 100%; }
}

/* --- Pins V2 — multi-layer cinétique --- */

.map-asie__pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 64px;
  height: 64px;
  margin-left: -32px;
  margin-top: -32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.3);
  animation: pin-appear 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 3;
}

.map-asie__pin:nth-child(1) { animation-delay: 3.2s; }
.map-asie__pin:nth-child(2) { animation-delay: 3.35s; }
.map-asie__pin:nth-child(3) { animation-delay: 3.50s; }
.map-asie__pin:nth-child(4) { animation-delay: 3.65s; }
.map-asie__pin:nth-child(5) { animation-delay: 3.80s; }

@keyframes pin-appear {
  0% { opacity: 0; transform: scale(0.3) translateY(-16px); }
  55% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* Halo large qui respire */
.map-asie__pin-halo {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(210, 180, 140, 0.45) 0%,
    rgba(210, 180, 140, 0.1) 45%,
    transparent 70%
  );
  animation: halo-breathe 3.2s ease-in-out infinite;
  pointer-events: none;
}

.map-asie__pin:nth-child(2) .map-asie__pin-halo { animation-delay: -0.8s; }
.map-asie__pin:nth-child(3) .map-asie__pin-halo { animation-delay: -1.6s; }
.map-asie__pin:nth-child(4) .map-asie__pin-halo { animation-delay: -2.4s; }
.map-asie__pin:nth-child(5) .map-asie__pin-halo { animation-delay: -0.4s; }

@keyframes halo-breathe {
  0%, 100% { transform: scale(0.75); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 0.3; }
}

/* Ring extérieur en rotation — conic gradient */
.map-asie__pin-ring {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(58, 106, 140, 0.8) 0%,
    rgba(210, 180, 140, 0.9) 35%,
    rgba(58, 106, 140, 0.6) 65%,
    rgba(210, 180, 140, 0.4) 100%
  );
  animation: ring-rotate 16s linear infinite;
  padding: 1.5px;
  box-shadow: 0 2px 8px rgba(26, 42, 58, 0.15);
}

.map-asie__pin-ring::before {
  content: '';
  position: absolute;
  inset: 1.5px;
  border-radius: 50%;
  background: var(--color-cream);
}

@keyframes ring-rotate {
  to { transform: rotate(360deg); }
}

/* Dot central avec gradient radial doré */
.map-asie__pin-dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    var(--color-tan) 0%,
    #b08d5a 100%
  );
  box-shadow:
    0 0 0 2px var(--color-cream),
    0 2px 6px rgba(26, 42, 58, 0.3);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Numéro de l'étape sur le pin */
.map-asie__pin-index {
  position: absolute;
  top: calc(50% - 40px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  color: var(--color-blue-deep-aa);
  background-color: var(--color-cream);
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(26, 42, 58, 0.08);
}

/* Label (nom du lieu) sous le pin */
.map-asie__pin-label {
  position: absolute;
  top: calc(50% + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.1em;
  color: var(--color-text);
  background-color: rgba(247, 244, 239, 0.97);
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 2px 8px rgba(26, 42, 58, 0.12);
}

.map-asie__pin:hover,
.map-asie__pin:focus-visible {
  outline: none;
}

.map-asie__pin:hover .map-asie__pin-label,
.map-asie__pin:focus-visible .map-asie__pin-label,
.map-asie__pin.is-active .map-asie__pin-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.map-asie__pin:hover .map-asie__pin-index,
.map-asie__pin:focus-visible .map-asie__pin-index,
.map-asie__pin.is-active .map-asie__pin-index {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.map-asie__pin:hover .map-asie__pin-dot,
.map-asie__pin:focus-visible .map-asie__pin-dot {
  transform: scale(1.4);
  box-shadow:
    0 0 0 3px var(--color-cream),
    0 0 0 6px rgba(210, 180, 140, 0.4),
    0 4px 12px rgba(26, 42, 58, 0.3);
}

.map-asie__pin:hover .map-asie__pin-halo,
.map-asie__pin:focus-visible .map-asie__pin-halo {
  animation-duration: 1.5s;
}

/* Pin actif */
.map-asie__pin.is-active .map-asie__pin-dot {
  transform: scale(1.5);
  box-shadow:
    0 0 0 3px var(--color-cream),
    0 0 0 7px var(--color-tan),
    0 4px 16px rgba(210, 180, 140, 0.5);
}

.map-asie__pin.is-active .map-asie__pin-ring {
  animation-duration: 8s;
}

/* --- Panneau détail V2 — glassmorphism + typo éditoriale --- */

.map-asie__panel {
  position: relative;
  z-index: 2;
  margin-top: var(--space-2xl);
  background:
    linear-gradient(135deg, rgba(250, 250, 248, 0.92) 0%, rgba(247, 244, 239, 0.96) 100%);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(58, 106, 140, 0.12);
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-lg);
  box-shadow:
    0 20px 44px rgba(26, 42, 58, 0.1),
    0 2px 8px rgba(26, 42, 58, 0.04);
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  min-height: 320px;
}

.map-asie__panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Numéro massif en filigrane */
.map-asie__panel-index {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 0;
  font-family: var(--font-heading);
  font-weight: var(--weight-light);
  font-size: clamp(8rem, 22vw, 14rem);
  line-height: 0.9;
  color: var(--color-blue-deep-aa);
  opacity: 0.06;
  pointer-events: none;
  letter-spacing: -0.05em;
  user-select: none;
  transition: opacity 0.6s ease;
}

.map-asie__panel.is-visible .map-asie__panel-index {
  opacity: 0.08;
}

.map-asie__panel-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.map-asie__figure {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-sand-warm), var(--color-blue-soft));
  box-shadow: 0 12px 28px rgba(26, 42, 58, 0.15);
}

.map-asie__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 0.8s ease, transform 2s cubic-bezier(0.22, 1, 0.36, 1);
}

.map-asie__figure.is-loaded .map-asie__image {
  opacity: 1;
  transform: scale(1);
}

.map-asie__figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(26, 42, 58, 0) 50%,
    rgba(26, 42, 58, 0.35) 100%
  );
  pointer-events: none;
}

.map-asie__figure-step {
  position: absolute;
  bottom: var(--space-sm);
  left: var(--space-sm);
  z-index: 1;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-light);
  letter-spacing: 0.15em;
  color: var(--color-cream);
  padding: 4px 10px;
  background-color: rgba(26, 42, 58, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 3px;
}

.map-asie__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.map-asie__region {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-blue-deep-aa);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.map-asie__region::before {
  content: '';
  width: 18px;
  height: 1px;
  background-color: currentColor;
  opacity: 0.5;
}

.map-asie__place {
  font-family: var(--font-heading);
  font-weight: var(--weight-regular);
  font-size: var(--text-3xl);
  color: var(--color-text);
  margin: var(--space-xs) 0 0;
  line-height: var(--leading-tight);
  letter-spacing: 0.01em;
}

.map-asie__echo {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: var(--weight-light);
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  color: var(--color-blue-deep-aa);
  margin: var(--space-sm) 0;
  position: relative;
  padding: var(--space-xs) 0 var(--space-xs) var(--space-md);
  border-left: 2px solid rgba(210, 180, 140, 0.6);
}

.map-asie__text {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-light);
  margin: 0;
}

/* Transition swap d'étape — fade subtil */
.map-asie__panel.is-transitioning .map-asie__content > *,
.map-asie__panel.is-transitioning .map-asie__figure {
  opacity: 0.3;
  transform: translateY(4px);
}

.map-asie__panel:not(.is-transitioning) .map-asie__content > * {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.map-asie__panel:not(.is-transitioning) .map-asie__content > *:nth-child(1) { transition-delay: 0.05s; }
.map-asie__panel:not(.is-transitioning) .map-asie__content > *:nth-child(2) { transition-delay: 0.15s; }
.map-asie__panel:not(.is-transitioning) .map-asie__content > *:nth-child(3) { transition-delay: 0.25s; }
.map-asie__panel:not(.is-transitioning) .map-asie__content > *:nth-child(4) { transition-delay: 0.35s; }

/* Dots pagination de 5 étapes sous le panneau */
.map-asie__steps-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-divider);
}

.map-asie__step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(58, 106, 140, 0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.map-asie__step-dot:hover {
  background-color: rgba(58, 106, 140, 0.5);
  transform: scale(1.2);
}

.map-asie__step-dot.is-active {
  background-color: var(--color-tan);
  width: 32px;
  border-radius: 4px;
}

.map-asie__step-dot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(58, 106, 140, 0.35);
}

/* --- Legend --- */

.map-asie__legend {
  position: relative;
  z-index: 1;
  margin-top: var(--space-xl);
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: var(--weight-light);
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

/* --- Responsive --- */

@media (min-width: 768px) {
  .map-asie__panel {
    padding: var(--space-2xl);
  }

  .map-asie__panel-inner {
    grid-template-columns: 1fr 1.3fr;
    gap: var(--space-2xl);
  }

  .map-asie__place {
    font-size: var(--text-4xl);
  }

  .map-asie__echo {
    font-size: var(--text-2xl);
  }

  .map-asie__pin {
    width: 72px;
    height: 72px;
    margin-left: -36px;
    margin-top: -36px;
  }

  .map-asie__pin-halo {
    width: 72px;
    height: 72px;
  }

  .map-asie__pin-ring {
    width: 40px;
    height: 40px;
  }

  .map-asie__pin-dot {
    width: 14px;
    height: 14px;
  }

  .map-asie__subtitle {
    font-size: var(--text-xl);
  }
}

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  .map-asie__particles,
  .map-asie__land,
  .map-asie__land--fill,
  .map-asie__land--secondary,
  .map-asie__compass,
  .map-asie__pin,
  .map-asie__pin-halo,
  .map-asie__pin-ring,
  .map-asie__route,
  .map-asie__image,
  .map-asie__flux {
    animation: none !important;
    transform: none !important;
  }

  .map-asie__land,
  .map-asie__land--secondary { stroke-dashoffset: 0 !important; opacity: 0.5 !important; }
  .map-asie__compass { opacity: 0.3 !important; }
  .map-asie__land--fill { opacity: 1 !important; }
  .map-asie__pin { opacity: 1 !important; }
  .map-asie__route { stroke-dashoffset: 0 !important; opacity: 0.45 !important; }
  .map-asie__image { opacity: 1 !important; transform: none !important; }

  .map-asie__panel {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
