/*=====================================
 Archive map cards
========================================*/
.archive-map-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.archive-map-card {
  position: relative;
  width: 100%;
  min-height: 340px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--main-rgb), 0.22);
  background: var(--white);
  color: var(--black);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 15px 35px rgba(22, 22, 22, 0.07);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.archive-map-card:hover,
.archive-map-card:focus-visible {
  border-color: var(--primary-1);
  box-shadow: 0 20px 42px rgba(22, 22, 22, 0.12);
  transform: translateY(-3px);
}

.archive-map-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease;
}

.archive-map-card:hover .archive-map-card__image,
.archive-map-card:focus-visible .archive-map-card__image {
  transform: scale(1.025);
}

.archive-map-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.03) 22%, rgba(0, 0, 0, 0.84) 100%);
}

.archive-map-card__content {
  position: absolute;
  right: 26px;
  bottom: 24px;
  left: 26px;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  color: var(--white);
}

.archive-map-card__content strong,
.archive-map-card__content span {
  display: block;
}

.archive-map-card__content strong {
  font-family: var(--font-2);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
}

.archive-map-card__content span {
  margin-top: 7px;
  font-family: var(--font-1);
  font-size: 15px;
  line-height: 1.35;
  opacity: 0.82;
}

.archive-map-card__icon {
  width: 46px;
  height: 46px;
  display: grid !important;
  place-items: center;
  margin: 0 !important;
  border-radius: 50%;
  background-color: var(--main);
  font-size: 17px !important;
  opacity: 1 !important;
}

@media (max-width: 991px) {
  .archive-map-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .archive-map-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .archive-map-card {
    min-height: 280px;
  }
}

/*=====================================
 Deep Zoom map viewer
========================================*/
body.map-is-open {
  overflow: hidden;
}

.map-modal[hidden] {
  display: none;
}

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.map-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.map-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: #000;
}

.map-modal__dialog {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: #111;
}

.map-modal__header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 6;
  min-height: 76px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--white);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent);
  pointer-events: none;
}

.map-modal__heading h2,
.map-modal__heading p {
  margin: 0;
  color: inherit;
}

.map-modal__heading h2 {
  font-family: var(--font-2);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.map-modal__heading p {
  margin-top: 4px;
  font-family: var(--font-2);
  font-size: 14px;
  line-height: 1.3;
  opacity: 0.78;
}

.map-modal__close {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background-color: rgba(0, 0, 0, 0.54);
  cursor: pointer;
  pointer-events: auto;
  transition: background-color 200ms ease;
}

.map-modal__close:hover,
.map-modal__close:focus-visible {
  background-color: var(--main);
}

.map-modal__close .ui-icon {
  width: 28px;
  height: 28px;
}

.map-modal__viewer {
  width: 100%;
  height: 100%;
  background-color: #111;
}

.map-modal__viewer:focus-visible {
  outline: 2px solid var(--primary-1);
  outline-offset: -2px;
}

.map-modal__controls {
  position: absolute;
  top: 92px;
  left: 18px;
  z-index: 6;
  display: grid;
  gap: 5px;
}

.map-modal__controls button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 3px;
  color: #333;
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.map-modal__controls button:hover,
.map-modal__controls button:focus-visible {
  color: var(--white);
  background-color: var(--main);
}

.map-modal__controls button:disabled {
  cursor: default;
  opacity: 0.45;
}

.map-modal__message {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 7;
  width: min(90%, 480px);
  margin: 0;
  padding: 17px 22px;
  color: var(--white);
  background-color: rgba(0, 0, 0, 0.84);
  font-family: var(--font-2);
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  transform: translate(-50%, -50%);
}

.map-modal__message[hidden],
.map-modal__hint[hidden] {
  display: none;
}

.map-modal__hint {
  position: absolute;
  right: 20px;
  bottom: 18px;
  z-index: 6;
  max-width: min(520px, calc(100% - 40px));
  margin: 0;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.86);
  background-color: rgba(0, 0, 0, 0.6);
  font-family: var(--font-2);
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.map-modal.is-ready .map-modal__hint {
  animation: map-hint-hide 500ms ease 5s forwards;
}

@keyframes map-hint-hide {
  to { opacity: 0; }
}

@media (max-width: 576px) {
  .map-modal__header {
    min-height: 68px;
    padding: 12px 14px;
  }

  .map-modal__heading h2 {
    max-width: calc(100vw - 90px);
    font-size: 17px;
  }

  .map-modal__heading p {
    max-width: calc(100vw - 90px);
    font-size: 12px;
  }

  .map-modal__close {
    width: 44px;
    height: 44px;
  }

  .map-modal__controls {
    top: 82px;
    left: 10px;
  }

  .map-modal__controls button {
    width: 40px;
    height: 40px;
  }

  .map-modal__hint {
    right: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .archive-map-card,
  .archive-map-card__image,
  .map-modal {
    transition: none;
  }

  .map-modal.is-ready .map-modal__hint {
    animation: none;
  }
}
