/* FAIST Standortkarte - country bar, filters, map, markers, popup, fallback image. */

/* ===== TOP BAR ===== */
.faist-map-topbar{
  width:100%;
  background:#000;
  overflow:hidden;
}

.faist-map-topbar-inner{
  margin:0;
  padding:30px 0;
}

.faist-country-nav{
  display:flex;
  gap:18px;
  align-items:center;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  -ms-overflow-style:none;
  white-space:nowrap;
  cursor:grab;
  user-select:none;
}

.faist-country-nav::-webkit-scrollbar{
  display:none;
  height:0;
  width:0;
}

.faist-country-nav .country-pill{
  flex:0 0 auto;
  font-family:"D-DIN Pro", Sans-serif;
  font-size:20px;
  line-height:1;
  font-weight:400;
  color:#fff;
  opacity:.8;
  text-decoration:none;
  cursor:pointer;
  padding:4px 0;
  border:none;
  background:transparent;
  position:relative;
  white-space:nowrap;
}

.faist-country-nav .country-pill:first-child{
  margin-left:35px;
}

.faist-country-nav .country-pill:last-child{
  margin-right:35px;
}

.faist-country-nav .country-pill:hover{
  opacity:1;
}

.faist-country-nav .country-pill.is-active{
  opacity:1;
}

/* The buttons carry type="button": keep the theme's button colours away in every state. */
.faist-karte .faist-country-nav .country-pill:hover,
.faist-karte .faist-country-nav .country-pill:focus,
.faist-karte .faist-country-nav .country-pill:active{
  background:transparent;
  color:#fff;
  text-decoration:none;
}


/* ===== MAP WRAP ===== */
.faist-map-wrap{
  position:relative;
}

.faist-map-ui{
  position:absolute;
  top:12px;
  left:12px;
  right:12px;
  z-index:999;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.faist-map-controls{
  display:flex;
  flex-wrap:nowrap;
  gap:10px;
  background:transparent;
  overflow:visible;
}

.faist-map-controls input[type="text"],
.faist-map-controls select{
  width:240px;
  padding:10px 16px;
  padding-right:40px;
  font-size:15px;
  font-weight:400;
  font-family:"D-DIN Pro", Sans-serif;
  background-color:#111;
  color:rgba(255,255,255,.85);
  border:none;
  border-radius:10px;
  outline:none;
  appearance:none;
  transition:background-color .2s ease;
  background-repeat:no-repeat;
  background-position:right 10px center;
  background-size:16px;
}

.faist-map-controls input[type="text"]{
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="13" height="15" viewBox="0 0 13 15" fill="none"><path d="M5.49609 1.3833C8.12364 1.3833 10.2458 3.49894 10.2461 6.09912C10.2461 8.69952 8.1238 10.8159 5.49609 10.8159C2.86839 10.8159 0.746094 8.69952 0.746094 6.09912C0.746354 3.49894 2.86855 1.3833 5.49609 1.3833Z" stroke="white" stroke-opacity="0.8" stroke-width="1.5"/><line x1="10.0568" y1="11.7437" x2="11.9961" y2="13.683" stroke="white" stroke-opacity="0.8" stroke-width="1.5" stroke-linecap="round"/></svg>');
  background-size:13px 15px;
}

.faist-map-controls select{
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="13" height="9" viewBox="0 0 13 9" fill="none"><path d="M1.82422 1.67432L6.91016 6.76025L11.9961 1.67432" stroke="white" stroke-opacity="0.8" stroke-width="2" stroke-linecap="round"/></svg>');
  background-size:13px 9px;
}

.faist-map-controls input[type="text"]:hover,
.faist-map-controls select:hover{
  background-color:#222;
}

.faist-map-controls input[type="text"]::placeholder{
  color:rgba(255,255,255,.8);
  opacity:1;
}

/* Fallback: no search, no type filter and no country bar (they would do nothing over the still image). */
.faist-karte--ersatz .faist-map-ui,
.faist-karte--ersatz .faist-map-topbar{
  display:none;
}

/* Without JavaScript the still image comes from the noscript block: the same applies. */
@media (scripting: none){
  .faist-karte .faist-map-ui,
  .faist-karte .faist-map-topbar{
    display:none;
  }
}


/* ===== MAP CONTAINER ===== */
#map{
  width:100%;
  height:500px;
  display:block;
  position:relative;
}

/* Own stacking context: markers stay below zoom buttons, attribution and fallback link. */
.faist-karte #map{
  isolation:isolate;
  overflow:hidden;
  background:#000;
}


/* ===== MAPLIBRE ===== */
/* Subset of maplibre-gl.css from MapLibre GL JS 6.19.0 (BSD-3-Clause): map surface, canvas, cursors,
   touch handling, markers and box zoom. Controls and popups of MapLibre are not used. */
.faist-karte .maplibregl-map{
  overflow:hidden;
  position:relative;
  -webkit-tap-highlight-color:rgb(0 0 0/0);
  -webkit-touch-callout:none;
}

.faist-karte .maplibregl-canvas{
  position:absolute;
  left:0;
  top:0;
}

.faist-karte .maplibregl-canvas-container.maplibregl-interactive{
  cursor:grab;
  -webkit-user-select:none;
  user-select:none;
}

.faist-karte .maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{
  cursor:pointer;
}

.faist-karte .maplibregl-canvas-container.maplibregl-interactive:active{
  cursor:grabbing;
}

.faist-karte .maplibregl-canvas-container.maplibregl-touch-zoom-rotate,
.faist-karte .maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{
  touch-action:pan-x pan-y;
}

.faist-karte .maplibregl-canvas-container.maplibregl-touch-drag-pan,
.faist-karte .maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{
  touch-action:pinch-zoom;
}

.faist-karte .maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,
.faist-karte .maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{
  touch-action:none;
}

/* Touch screens (cooperative gestures): the browser scrolls the page with one finger, two fingers move the map. */
.faist-karte .maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,
.faist-karte .maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{
  touch-action:pan-x pan-y;
}

.faist-karte .maplibregl-marker{
  position:absolute;
  top:0;
  left:0;
  will-change:transform;
}

.faist-karte .maplibregl-boxzoom{
  position:absolute;
  top:0;
  left:0;
  width:0;
  height:0;
  background:#fff;
  border:2px dotted #202020;
  opacity:.5;
}

/* Hint when one finger tries to move the map: veil over map and markers, below zoom buttons and attribution.
   The keyboard hint is never needed (the wheel does not zoom this map). */
.faist-karte #map .maplibregl-cooperative-gesture-screen{
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  left:0;
  z-index:2500;
  display:flex;
  justify-content:center;
  align-items:center;
  margin:0;
  padding:16px;
  background:rgba(0,0,0,.5);
  color:#fff;
  font-family:"D-DIN Pro", Sans-serif;
  font-size:20px;
  font-weight:400;
  line-height:1.2;
  text-align:center;
  opacity:0;
  pointer-events:none;
  transition:opacity .4s ease 1s;
}

.faist-karte #map .maplibregl-cooperative-gesture-screen.maplibregl-show{
  opacity:1;
  transition:opacity .15s ease;
}

.faist-karte #map .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{
  display:none;
}

.faist-karte #map .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{
  display:block;
}

/* Map surface is focusable (keyboard pan and zoom): outline inside, the container clips anything outside. */
.faist-karte #map .maplibregl-canvas:focus{
  outline:none;
  box-shadow:none;
}

.faist-karte #map .maplibregl-canvas:focus-visible{
  outline:2px solid #fff;
  outline-offset:-2px;
  box-shadow:none;
}


/* ===== MARKER BUTTONS ===== */
/* Theme and page builder style every button: these rules reset all states. */
.faist-karte #map .faist-marker,
.faist-karte #map .faist-marker:hover,
.faist-karte #map .faist-marker:focus,
.faist-karte #map .faist-marker:active{
  -webkit-appearance:none;
  appearance:none;
  display:block;
  box-sizing:border-box;
  width:auto;
  height:auto;
  min-width:0;
  min-height:0;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
  outline:none;
  color:inherit;
  font-size:0;
  line-height:0;
  letter-spacing:normal;
  text-decoration:none;
  text-transform:none;
  white-space:normal;
  cursor:pointer;
  transition:none;
  -webkit-user-select:none;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
}

.faist-karte #map .faist-marker:focus-visible{
  outline:2px solid #fff;
  outline-offset:3px;
  border-radius:50%;
  box-shadow:none;
}

.faist-karte #map .faist-marker svg{
  display:block;
}

/* Same coordinates: red above white, headquarters above all; a hovered marker rises by 300. */
.faist-karte #map .faist-marker[data-art="weiss"]{ z-index:1; }
.faist-karte #map .faist-marker[data-art="rot"]{ z-index:1000; }
.faist-karte #map .faist-marker[data-art="hauptsitz"]{ z-index:2000; }
.faist-karte #map .faist-marker[data-art="weiss"]:hover{ z-index:301; }
.faist-karte #map .faist-marker[data-art="rot"]:hover{ z-index:1300; }
.faist-karte #map .faist-marker[data-art="hauptsitz"]:hover{ z-index:2300; }


/* ===== SVG MARKER ===== */
.faist-divicon{
  color:#ffffff;
  display:block;
  line-height:0;
  position:relative;
  z-index:1;
  filter:drop-shadow(0 3px 6px rgba(0,0,0,.55));
  transition:transform .12s ease, filter .12s ease, z-index .12s ease, opacity .12s ease;
  will-change:transform;
  backface-visibility:hidden;
}

.faist-divicon:not(.is-hq){
  transform-origin:50% 50%;
}

.faist-divicon.is-hq{
  transform-origin:50% 100%;
  color:#FF0827;
  filter:
    drop-shadow(0 3px 6px rgba(0,0,0,.55))
    drop-shadow(0 0 8px rgba(255,8,39,.4));
}

/* Branch office and subsidiary: red like the headquarters. */
.faist-divicon.is-red-office{
  color:#FF0827 !important;
  filter:
    drop-shadow(0 3px 6px rgba(0,0,0,.55))
    drop-shadow(0 0 7px rgba(255,8,39,.30));
}

.faist-divicon.is-red-office svg{
  color:#FF0827 !important;
}

.faist-divicon.is-red-office svg circle{
  fill:#FF0827 !important;
}

.faist-divicon:hover{
  transform:scale(1.06);
  z-index:2;
  filter:drop-shadow(0 4px 10px rgba(0,0,0,.7));
}

.faist-divicon.is-hq:hover{
  filter:
    drop-shadow(0 4px 10px rgba(0,0,0,.7))
    drop-shadow(0 0 10px rgba(255,8,39,.45));
}

.faist-divicon.is-red-office:hover{
  filter:
    drop-shadow(0 4px 10px rgba(0,0,0,.7))
    drop-shadow(0 0 9px rgba(255,8,39,.40));
}

/* The popup distance of the pin depends on this scale (engine). */
.faist-divicon.is-active{
  color:#FF0827;
  transform:scale(1.08);
  position:relative;
  z-index:10;
  filter:
    drop-shadow(0 4px 10px rgba(0,0,0,.7))
    drop-shadow(0 0 12px rgba(255,8,39,.5));
}


/* ===== ZOOM BUTTONS ===== */
/* 30 px above the bottom edge keeps the buttons clear of the page's floating contact button on phones. */
.faist-karte #map .faist-map-zoom{
  position:absolute;
  right:10px;
  bottom:30px;
  z-index:3000;
  display:flex;
  flex-direction:column;
  margin:0;
  padding:0;
  border:2px solid rgba(0,0,0,.2);
  border-radius:4px;
  background-clip:padding-box;
  overflow:hidden;
}

.faist-karte #map .faist-map-zoom__knopf,
.faist-karte #map .faist-map-zoom__knopf:hover,
.faist-karte #map .faist-map-zoom__knopf:focus,
.faist-karte #map .faist-map-zoom__knopf:active{
  -webkit-appearance:none;
  appearance:none;
  display:block;
  box-sizing:border-box;
  width:30px;
  height:30px;
  min-width:0;
  min-height:0;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:#000;
  box-shadow:none;
  outline:none;
  color:rgba(255,255,255,.8);
  font:bold 22px/30px "Lucida Console", Monaco, monospace;
  letter-spacing:normal;
  text-align:center;
  text-indent:1px;
  text-decoration:none;
  text-transform:none;
  white-space:nowrap;
  cursor:pointer;
  transition:background-color .2s ease;
  -webkit-user-select:none;
  user-select:none;
}

.faist-karte #map .faist-map-zoom__knopf:hover{
  background:#222;
}

.faist-karte #map .faist-map-zoom__knopf:focus-visible{
  outline:2px solid #fff;
  outline-offset:-2px;
  box-shadow:none;
}


/* ===== ATTRIBUTION ===== */
/* Visible from the start; the dark glow keeps it readable above map labels. */
.faist-karte #map .faist-map-quelle,
.faist-karte #map .faist-map-quelle:visited,
.faist-karte #map .faist-map-quelle:hover,
.faist-karte #map .faist-map-quelle:focus,
.faist-karte #map .faist-map-quelle:active{
  position:absolute;
  left:12px;
  bottom:9px;
  z-index:3000;
  display:block;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
  outline:none;
  font-family:"D-DIN Pro", Sans-serif;
  font-size:11px;
  font-weight:400;
  line-height:1.2;
  letter-spacing:.02em;
  text-transform:none;
  color:rgba(255,255,255,.6);
  text-decoration:none;
  text-shadow:0 0 2px #000, 0 0 2px #000, 0 0 3px #000, 0 0 3px #000, 0 0 4px #000, 0 0 4px #000, 0 0 6px #000, 0 0 8px #000;
  white-space:nowrap;
}

.faist-karte #map .faist-map-quelle:hover{
  color:#fff;
  text-decoration:underline;
}

.faist-karte #map .faist-map-quelle:focus-visible{
  color:#fff;
  outline:2px solid #fff;
  outline-offset:2px;
  box-shadow:none;
}


/* ===== PORTAL POPUP ===== */
.faist-portal-popup{
  position:fixed;
  width:300px;
  background:rgba(255,255,255,0.90);
  backdrop-filter:blur(6px);
  color:#000;
  border-radius:8px;
  box-shadow:0 6px 28px rgba(0,0,0,.45);
  z-index:999999;
  padding:15px;
  transform:translate(-50%, -100%);
  will-change:left, top;
}

/* Very long entries: words break anywhere. Only when the engine has to limit the height does the content
   scroll; an ordinary popup is no scroll container, so a swipe on it scrolls the page. */
.faist-portal-popup{
  max-width:calc(100vw - 16px);
  overflow-wrap:anywhere;
}

.faist-portal-popup.faist-portal-popup--rollt{
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
}

.faist-portal-popup .popup-header{
  font-size:16px;
  font-weight:500;
  line-height:16px;
  color:#FF0827;
  margin:0 0 16px;
}

.faist-portal-popup .popup-title{
  font-size:25px;
  line-height:25px;
  font-weight:500;
  margin:0 0 10px;
}

.faist-portal-popup .popup-section{
  margin:0 0 10px;
  font-size:16px;
  line-height:22px;
}

.faist-portal-popup .popup-label{
  display:block;
  font-weight:500;
  margin-bottom:0;
}

.faist-portal-popup a{
  color:#000;
  text-decoration:none;
}

.faist-portal-popup a:hover{
  text-decoration:underline;
}


/* ===== FALLBACK IMAGE ===== */
.faist-karte #map .faist-map-ersatz{
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  left:0;
  margin:0;
  padding:0;
  overflow:hidden;
  background:#000;
}

.faist-karte #map .faist-map-ersatz__bild{
  display:block;
  width:100%;
  height:100%;
  max-width:none;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  box-shadow:none;
  object-fit:cover;
  object-position:50% 50%;
}

/* Same shape and place as the search field; arrow like the type filter's. */
.faist-karte #map .faist-map-ersatz__link,
.faist-karte #map .faist-map-ersatz__link:visited,
.faist-karte #map .faist-map-ersatz__link:hover,
.faist-karte #map .faist-map-ersatz__link:focus,
.faist-karte #map .faist-map-ersatz__link:active{
  position:absolute;
  top:12px;
  left:12px;
  z-index:3000;
  display:block;
  box-sizing:border-box;
  width:240px;
  max-width:calc(100% - 24px);
  margin:0;
  padding:10px 40px 10px 16px;
  border:0;
  border-radius:10px;
  background-color:#111;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="9" height="13" viewBox="0 0 9 13" fill="none"><path d="M1.67432 1.82422L6.76025 6.91016L1.67432 11.9961" stroke="white" stroke-opacity="0.8" stroke-width="2" stroke-linecap="round"/></svg>');
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:9px 13px;
  box-shadow:none;
  outline:none;
  font-family:"D-DIN Pro", Sans-serif;
  font-size:15px;
  font-weight:400;
  line-height:1.5;
  letter-spacing:normal;
  text-align:left;
  text-transform:none;
  text-decoration:none;
  color:rgba(255,255,255,.85);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  transition:background-color .2s ease;
}

.faist-karte #map .faist-map-ersatz__link:hover{
  background-color:#222;
}

.faist-karte #map .faist-map-ersatz__link:focus-visible{
  outline:2px solid #fff;
  outline-offset:2px;
  box-shadow:none;
}


/* ===== MOBILE ===== */
@media (max-width:768px){

  .faist-country-nav .country-pill{
    font-size:16px;
  }

  .faist-country-nav .country-pill:first-child{
    margin-left:20px;
  }

  .faist-country-nav .country-pill:last-child{
    margin-right:20px;
  }

  .faist-map-ui{
    left:12px;
    right:12px;
  }

  .faist-map-controls{
    flex-direction:column;
    gap:8px;
  }

  .faist-map-controls input[type="text"],
  .faist-map-controls select{
    width:100%!important;
    font-size:14px;
    padding:10px 14px;
    background-position:right 10px center;
  }

  #map{
    height:500px;
  }

  .faist-karte #map .maplibregl-cooperative-gesture-screen{
    font-size:16px;
  }

  .faist-karte #map .faist-map-ersatz__link,
  .faist-karte #map .faist-map-ersatz__link:visited,
  .faist-karte #map .faist-map-ersatz__link:hover,
  .faist-karte #map .faist-map-ersatz__link:focus,
  .faist-karte #map .faist-map-ersatz__link:active{
    right:12px;
    width:auto;
    max-width:none;
    padding:10px 40px 10px 14px;
    font-size:14px;
  }
}


/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce){

  .faist-divicon,
  .faist-divicon:hover{
    transition:none;
  }

  /* The hint appears and goes without fading; it still stays long enough to be read. */
  .faist-karte #map .maplibregl-cooperative-gesture-screen{
    transition:opacity 0s linear 1.2s;
  }

  .faist-karte #map .maplibregl-cooperative-gesture-screen.maplibregl-show{
    transition:none;
  }

  .faist-karte #map .faist-map-zoom__knopf,
  .faist-karte #map .faist-map-zoom__knopf:hover,
  .faist-karte #map .faist-map-zoom__knopf:focus,
  .faist-karte #map .faist-map-zoom__knopf:active,
  .faist-karte #map .faist-map-ersatz__link,
  .faist-karte #map .faist-map-ersatz__link:visited,
  .faist-karte #map .faist-map-ersatz__link:hover,
  .faist-karte #map .faist-map-ersatz__link:focus,
  .faist-karte #map .faist-map-ersatz__link:active{
    transition:none;
  }
}
