/* 
  Mentor Victory Map
  Изолированные стили для интерактивной карты.
  Все классы имеют префикс mv-map-, чтобы не конфликтовать с WordPress-темой.
*/

#mentor-victory-map {
  width: 100%;
  max-width: 1100px;
  margin: 24px auto;
}

#mentor-victory-map .mv-map-root,
#mentor-victory-map .mv-map-root * {
  box-sizing: border-box;
}

#mentor-victory-map .mv-map-root {
  width: 100%;
  font-family: inherit;
  color: #1f2937;
}

#mentor-victory-map .mv-map-shell {
  width: 100%;
}

#mentor-victory-map .mv-map-caption {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.5;
  color: #4b5563;
}

#mentor-victory-map .mv-map-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: #eef2f7;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.14);
}

#mentor-victory-map .mv-map-image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 280px;
  object-fit: cover;
  background: #eef2f7;
}

#mentor-victory-map .mv-map-map-error {
  display: none;
  padding: 28px;
  min-height: 260px;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #7f1d1d;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

#mentor-victory-map .mv-map-root--map-error .mv-map-map-error {
  display: flex;
}

#mentor-victory-map .mv-map-root--map-error .mv-map-markers {
  display: none;
}

#mentor-victory-map .mv-map-markers {
  position: absolute;
  inset: 0;
  z-index: 2;
}

#mentor-victory-map .mv-map-marker {
  position: absolute;
  left: var(--mv-marker-x);
  top: var(--mv-marker-y);
  transform: translate(-50%, -50%);
  width: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
  z-index: 3;
  touch-action: manipulation;
}

#mentor-victory-map .mv-map-marker-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #dc2626;
  border: 3px solid #ffffff;
  box-shadow:
          0 0 0 4px rgba(220, 38, 38, 0.22),
          0 8px 18px rgba(15, 23, 42, 0.28);
  transition:
          transform 160ms ease,
          background-color 160ms ease,
          box-shadow 160ms ease;
}

#mentor-victory-map .mv-map-marker-label {
  position: absolute;
  left: 50%;
  bottom: calc(50% + 15px);
  transform: translateX(-50%);
  max-width: 180px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.9);
  color: #ffffff;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
  pointer-events: none;
}

#mentor-victory-map .mv-map-marker:hover .mv-map-marker-dot,
#mentor-victory-map .mv-map-marker:focus-visible .mv-map-marker-dot {
  transform: translate(-50%, -50%) scale(1.22);
  background: #b91c1c;
  box-shadow:
          0 0 0 6px rgba(220, 38, 38, 0.26),
          0 10px 22px rgba(15, 23, 42, 0.32);
}

#mentor-victory-map .mv-map-marker:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 5px;
  border-radius: 999px;
}

/* Modal / lightbox */

#mentor-victory-map .mv-map-modal[hidden] {
  display: none !important;
}

#mentor-victory-map .mv-map-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

#mentor-victory-map .mv-map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  cursor: pointer;
}

#mentor-victory-map .mv-map-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

#mentor-victory-map .mv-map-modal-content {
  padding: 22px;
}

#mentor-victory-map .mv-map-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

#mentor-victory-map .mv-map-modal-title {
  margin: 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
}

#mentor-victory-map .mv-map-modal-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition:
          background-color 160ms ease,
          transform 160ms ease;
}

#mentor-victory-map .mv-map-modal-close:hover,
#mentor-victory-map .mv-map-modal-close:focus-visible {
  background: #e5e7eb;
  transform: scale(1.04);
}

#mentor-victory-map .mv-map-modal-close:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

#mentor-victory-map .mv-map-modal-description {
  margin: 0 0 16px;
  color: #4b5563;
  font-size: 16px;
  line-height: 1.55;
}

#mentor-victory-map .mv-map-modal-gallery-message {
  padding: 28px;
  color: #7f1d1d;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.5;
}

#mentor-victory-map .mv-map-modal-gallery-message[hidden] {
  display: none !important;
}

/*
  Галерея изображений внутри модального окна.
  На десктопе изображения выводятся по 3 в ряд.
*/
#mentor-victory-map .mv-map-modal-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

#mentor-victory-map .mv-map-modal-figure {
  margin: 0;
  min-width: 0;
}

#mentor-victory-map .mv-map-modal-figure-image-wrap {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f4f6;
}

#mentor-victory-map .mv-map-modal-figure-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f3f4f6;
}

#mentor-victory-map .mv-map-modal-figure-image[hidden] {
  display: none !important;
}

#mentor-victory-map .mv-map-modal-figure-message {
  padding: 18px;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #7f1d1d;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}

#mentor-victory-map .mv-map-modal-figure-message[hidden] {
  display: none !important;
}

#mentor-victory-map .mv-map-modal-figure-caption {
  margin-top: 8px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.45;
}

/* Блокировка прокрутки страницы при открытом модальном окне */

html.mv-map-scroll-locked,
body.mv-map-scroll-locked {
  overflow: hidden !important;
}

/* Адаптивность */

@media (max-width: 900px) {
  #mentor-victory-map .mv-map-modal-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #mentor-victory-map {
    margin: 18px auto;
  }

  #mentor-victory-map .mv-map-image {
    min-height: 230px;
  }

  #mentor-victory-map .mv-map-marker-label {
    max-width: 130px;
    padding: 4px 7px;
    font-size: 11px;
  }

  #mentor-victory-map .mv-map-marker-dot {
    width: 17px;
    height: 17px;
  }

  #mentor-victory-map .mv-map-modal {
    padding: 12px;
  }

  #mentor-victory-map .mv-map-modal-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 16px;
  }

  #mentor-victory-map .mv-map-modal-content {
    padding: 16px;
  }

  #mentor-victory-map .mv-map-modal-title {
    font-size: 20px;
  }
}

@media (max-width: 560px) {
  #mentor-victory-map .mv-map-modal-gallery {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  #mentor-victory-map .mv-map-modal-figure-image {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 520px) {
  #mentor-victory-map .mv-map-marker-label {
    display: none;
  }

  #mentor-victory-map .mv-map-caption {
    font-size: 14px;
  }
}