/* =========================================================
   ReBorn by NOA – „Atstumai“ žemėlapio sekcija
   Overlay koordinatės išmatuotos 1:1 iš dizaino failų:
   - desktop maketas 1240x675 (1920 artboard eksportas 0.6458x)
   - mobile maketas 543x612
   ========================================================= */
.rb-map {
  --rb-brown: #713600;
  --rb-sand: #E5B57A;
  --rb-ease: cubic-bezier(.4, 0, .2, 1);
  --rb-pulse-dur: 2.8s;

  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.rb-map__sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.rb-map__canvas {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: 100% auto; /* fonas užpildo plotį, kerpamas vertikaliai kaip dizaine */
}

/* Desktop maketas (1240x675). Vertikalus fono poslinkis 54% */
.rb-map__canvas--desktop {
  aspect-ratio: 1240 / 675;
  background-image: url("img/fonas-desktop.jpg");
  background-position: center 54%;
}

/* Mobile maketas (543x612). Vertikalus fono poslinkis 42.5% */
.rb-map__canvas--mobile {
  display: none;
  aspect-ratio: 543 / 612;
  background-image: url("img/fonas-mobile.jpg");
  background-position: center 42.5%;
}

@media (max-width: 899px) {
  .rb-map__canvas--desktop { display: none; }
  .rb-map__canvas--mobile { display: block; }
}

/* Elementor apsauga: konteineris su „Wrap“ nustatymu mobile tampa
   flex column + wrap, o toks derinys su automatiniu aukščiu Chrome
   suspaudžia turinį iki 0 px. Ten, kur guli šis žemėlapis, wrap išjungiamas. */
.e-con:has(> .elementor-widget-shortcode .rb-map),
.e-con:has(> .e-con-inner > .elementor-widget-shortcode .rb-map) {
  flex-wrap: nowrap;
}

/* Atsarginis kelias seniems naršyklėms be aspect-ratio (pvz., iOS < 15):
   aukštis iš padding-top procentų, skaičiuojamų nuo pločio. */
@supports not (aspect-ratio: 1 / 1) {
  .rb-map__canvas--desktop { height: 0; padding-top: 54.4355%; }
  .rb-map__canvas--mobile { height: 0; padding-top: 112.7072%; }
}

/* ---- Overlay (ženklai + kortelės), pozicija 1:1 iš dizaino ---- */
.rb-map .rb-map__overlay {
  position: absolute;
  display: block;
  height: auto;
  max-width: none;
}
.rb-map__canvas--desktop .rb-map__overlay {
  left: 38.659%;
  top: 16.119%;
  width: 31.302%;
  aspect-ratio: 601 / 551;
}
.rb-map__canvas--mobile .rb-map__overlay {
  left: 5.584%;
  top: 7.863%;
  width: 88.84%;
  aspect-ratio: 393 / 412;
}

/* ---- Markerių pulsavimas ---- */
.rb-map .pl-dot,
.rb-map .pl-ring,
.rb-map .pl-ripple {
  transform-box: fill-box;
  transform-origin: center;
}
.rb-map .pl-ripple {
  fill: none;
  stroke: var(--rb-brown);
  stroke-width: 1;
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .rb-map .pl-dot {
    animation: rb-dot var(--rb-pulse-dur) var(--rb-ease) infinite;
    animation-delay: var(--d, 0s);
  }
  .rb-map .pl-ring {
    animation: rb-ring var(--rb-pulse-dur) var(--rb-ease) infinite;
    animation-delay: var(--d, 0s);
  }
  .rb-map .pl-ripple {
    animation: rb-ripple var(--rb-pulse-dur) ease-out infinite;
    animation-delay: var(--d, 0s);
  }
  .rb-map .pl-dot--main {
    animation: rb-dot-main var(--rb-pulse-dur) var(--rb-ease) infinite;
  }
  .rb-map .pl-ring--inner {
    animation: rb-ring-main var(--rb-pulse-dur) var(--rb-ease) infinite;
    animation-delay: .25s;
  }
  .rb-map .pl-ring--outer {
    animation: rb-ring-main var(--rb-pulse-dur) var(--rb-ease) infinite;
  }
  .rb-map .pl-ripple--main {
    animation: rb-ripple-main var(--rb-pulse-dur) ease-out infinite;
  }
}

@keyframes rb-dot {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.3); }
}
@keyframes rb-dot-main {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.25); }
}
@keyframes rb-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.08); opacity: .8; }
}
@keyframes rb-ring-main {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.05); opacity: .85; }
}
@keyframes rb-ripple {
  0%   { transform: scale(1); opacity: .45; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes rb-ripple-main {
  0%   { transform: scale(1); opacity: .35; }
  70%  { transform: scale(1.65); opacity: 0; }
  100% { transform: scale(1.65); opacity: 0; }
}
