/* Map of services block. Everything is scoped to .block-map. */

.block-map {
  position: relative;
  --map-window-max-width: 420px;
  --map-window-max-height: 600px;
}

/* ---------------------------------------------------------------- map area */

.section-width-fullrow .block-map { padding: 0; }

.block-map .map__element {
  position: relative;
  z-index: 0;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  background: #e5e3df;
}
@media (min-width: 480px) {
  .block-map .map__element { height: var(--map-height--lg, 640px); aspect-ratio: auto; }
}
.block-map .map__canvas { position: absolute; inset: 0; }

.block-map .map__placeholder { display: none; }
.block-map .map__consent { display: none; }
.block-map.is-unavailable .map__canvas,
.block-map.is-awaiting-consent .map__canvas { display: none; }
.block-map.is-unavailable .map__placeholder,
.block-map.is-awaiting-consent .map__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #efefef;
  color: #464646;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}
.block-map .map__placeholder p { max-width: 30em; margin: 0 0 .5em; }
.block-map.is-awaiting-consent .map__notice { display: none; }
.block-map.is-awaiting-consent .map__consent { display: block; }
.block-map .map__consent-button { margin: .5em 0; }
.block-map .map__count:empty { display: none; }
@media (min-width: 993px) {
  .block-map.map-with-filters.is-unavailable .map__placeholder,
  .block-map.map-with-filters.is-awaiting-consent .map__placeholder { padding-left: 350px; }
}

/* The drop of the classic markers' google.maps.Animation.DROP: a fall from above
   the map with a short bounce, once when a marker first appears. */
.block-map .map-marker.is-dropping { animation: map-marker-drop .6s ease-in; }
@keyframes map-marker-drop {
  0% { transform: translateY(-400px); opacity: 0; }
  10% { opacity: 1; }
  60% { transform: translateY(0); }
  75% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}
/* The site-wide img max-width would shrink the icons to nothing inside the marker
   element; their size is set inline. */
.block-map .map-marker,
.block-map .map-cluster { display: block; max-width: none; }
.block-map .map-cluster { transform: translateY(50%); }

/* ------------------------------------------------------------ filter panel */

.block-map .map-filters {
  padding: 0;
  background: #f5f5f5;
  text-align: center;
}
@media (min-width: 993px) {
  .block-map .map-filters {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 5;
    width: 300px;
    max-height: calc(100% - 60px);
    overflow: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, .18);
    text-align: left;
  }
}
.block-map .map-filters[hidden] { display: none; }
.block-map .map-filter { padding: 12px 24px 20px; border-top: 1px solid #dcdcdc; }
.block-map .map-filter:first-child { border-top: 0; }
.block-map .map-filter__heading {
  margin: 0 0 14px;
  color: #464646;
  font-family: var(--font, Rubik, Verdana, Geneva, Arial, sans-serif);
  font-size: 16px;
  font-weight: 400;
  line-height: 16px;
  text-transform: none;
  letter-spacing: normal;
}
.block-map .map-filter__options { padding-bottom: 9px; text-align: left; }
.block-map .map-filter__option { position: relative; margin: 0 0 14px; }
.block-map .map-filter__input {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  opacity: 0;
}
.block-map .map-filter__label {
  display: flex;
  align-items: flex-start;
  max-width: 100%;
  color: #000;
  font-size: 16px;
  font-weight: 400;
  line-height: 18px;
  cursor: pointer;
}
.block-map .map-filter__box {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  border: 1px solid #e7e7e7;
  border-radius: 3px;
  background: #fff;
  transition: border-color .2s ease-in-out;
}
.block-map .map-filter__input:checked + .map-filter__label .map-filter__box::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid #0b0b0b;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.block-map .map-filter__input:focus-visible + .map-filter__label .map-filter__box {
  outline: 2px solid #0b0b0b;
  outline-offset: 2px;
}

/* ------------------------------------------------------------- info window */

.block-map .map-window { position: absolute; z-index: 10; }
.block-map .map-window-content {
  position: absolute;
  right: -14px;
  bottom: 60px;
  min-width: min(420px, var(--map-window-max-width));
  max-width: var(--map-window-max-width);
  background: #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, .18);
  cursor: auto;
}
.block-map .map-window-body {
  max-height: var(--map-window-max-height);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.block-map .map-window-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: #fff;
  color: #000;
  cursor: pointer;
}
.block-map .map-window-close__icon { position: relative; display: block; width: 14px; height: 14px; }
.block-map .map-window-close__icon::before,
.block-map .map-window-close__icon::after {
  content: "";
  position: absolute;
  top: 6px;
  left: -1px;
  width: 16px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}
.block-map .map-window-close__icon::after { transform: rotate(-45deg); }
.block-map .map-window-close:hover, .block-map .map-window-close:focus-visible { color: var(--c-heading, #e73a1e); }

.block-map .popup-content {
  padding: 20px;
  color: #000;
  font-family: Roboto, Arial, sans-serif;
  text-align: left;
}
.block-map .popup-content .popup-title {
  margin: 0 0 10px;
  padding-right: 20px;
  color: var(--c-heading, #e73a1e);
  font-family: var(--font, Rubik, Verdana, Geneva, Arial, sans-serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}
.block-map .popup-content p {
  margin: 0;
  padding: 5px 0;
  font-size: 14px;
  line-height: 24px;
}
.block-map .popup-content .infobox__navigate { padding-bottom: 15px; }
.block-map .popup-content a { color: #303030; }
.block-map .popup-content a:hover, .block-map .popup-content a:focus { color: var(--c-heading, #e73a1e); }
.block-map .infobox__heading {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  opacity: .5;
}
.block-map .popup-content .u-nowrap { white-space: nowrap; }
.block-map .is-narrow .popup-content .u-nowrap { white-space: normal; overflow-wrap: anywhere; }
.block-map .popup-content.has-image { position: relative; padding-left: 232px; padding-right: 40px; }
.block-map .popup-content .image { position: absolute; top: 0; left: 0; width: 200px; height: 100%; max-height: 320px; overflow: hidden; }
.block-map .popup-content .image img { width: 100%; height: 100%; object-fit: cover; }
.block-map .is-narrow .popup-content.has-image { padding-left: 20px; padding-right: 20px; }
.block-map .is-narrow .popup-content .image { position: static; width: auto; height: auto; margin-bottom: 10px; }
