@charset "UTF-8";

/* ============================================================
   Map page – Cinematographers Schweiz Suisse Svizzera Svizra
   Full map view, adapted visually to map-embed.css
============================================================ */

/* ============================================================
   Page variables
============================================================ */

body.map-page {
  --map-gap: .7rem;
  --map-bottom-gap: .25rem;
  --map-right-rail: 2.5rem;
  --map-footer-h: 2rem;

  --map-label-size: .72rem;
  --map-label-size-mobile: .68rem;
  --map-distance-size: .62rem;
  --map-label-letter: .065rem;
  --map-distance-letter: .055rem;

  --map-label-red: var(--color-19, #a00101);
  --map-label-black: var(--color-15, #111111);
  --map-label-text: var(--color-11, #111111);
  --map-label-muted: rgba(17, 17, 17, .42);
  --map-panel-bg: rgba(245, 245, 245, .96);
}

/* ============================================================
   No-script warning / loading overlay
============================================================ */

.map-noscript-warning {
  padding: 1rem;
  background: #ffe9e9;
  color: #900;
  text-align: center;
}

body.map-page #loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #f4f4f4;
  pointer-events: none;
}

/* ============================================================
   Map layout
============================================================ */

body.map-page #map {
  width: auto;
  max-width: none;

  height: calc(100vh - var(--map-gap) - var(--map-bottom-gap) - var(--map-footer-h));
  height: calc(100dvh - var(--map-gap) - var(--map-bottom-gap) - var(--map-footer-h));

  margin-top: var(--map-gap);
  margin-left: var(--map-gap);
  margin-right: calc(var(--map-right-rail) + var(--map-gap));
  margin-bottom: var(--map-bottom-gap);

  box-sizing: border-box;
  z-index: 0;

  background: #fff;
  overflow: hidden;
}

/* ============================================================
   Leaflet panes / controls
============================================================ */

body.map-page #map .leaflet-control-container,
body.map-page #map .leaflet-top,
body.map-page #map .leaflet-bottom {
  z-index: 5000 !important;
  pointer-events: none;
}

body.map-page #map .leaflet-control {
  pointer-events: auto;
}

body.map-page #map .leaflet-top.leaflet-left {
  top: 0;
  left: 0;
}

/* ============================================================
   Profile labels – map-embed appearance
============================================================ */

/*
   Wichtig:
   Der grosse Leaflet-DivIcon-Container ist NICHT klickbar.
   Nur der sichtbare Link im Label ist klickbar.
   Dadurch blockieren breite unsichtbare Label-Flächen keine roten Ringe.
*/

.leaflet-marker-icon.map-label {
  overflow: visible !important;
  pointer-events: none !important;
  background: transparent !important;
  border: 0 !important;
  cursor: default !important;

  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  text-align: center !important;
}

/* Auch Leaflet-interactive darf auf dem Root nichts blockieren */
.leaflet-marker-icon.map-label.leaflet-interactive {
  pointer-events: none !important;
  cursor: default !important;
}

/* Normale Labels: mittlere Ebene */
.leaflet-marker-icon.map-label:not(.is-highlighted):not(.is-dimmed) {
  z-index: 500000 !important;
}

/* Highlighted / Treffer: oberste Ebene */
.leaflet-marker-icon.map-label.is-highlighted {
  z-index: 1000000 !important;
}

/* Ausgegraut: untere Ebene, nie klick-/hover-blockierend */
.leaflet-marker-icon.map-label.is-dimmed {
  z-index: 10 !important;
  opacity: .58;
  pointer-events: none !important;
}

/* Der sichtbare Link */
.leaflet-marker-icon.map-label a.label-link {
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: auto !important;
  min-width: 0 !important;
  max-width: max-content !important;
  min-height: 0 !important;

  padding: 2px 5px 3px;
  box-sizing: border-box;

  color: inherit;
  text-decoration: none;
  text-align: center !important;

  pointer-events: auto !important;
  cursor: pointer !important;

  transform: translateY(20px);
}

/* Dimmed Links sind sichtbar, aber funktional durchsichtig */
.leaflet-marker-icon.map-label.is-dimmed a.label-link,
.leaflet-marker-icon.map-label.is-dimmed .name,
.leaflet-marker-icon.map-label.is-dimmed .distance {
  pointer-events: none !important;
  cursor: default !important;
}

/* Namen */
.leaflet-marker-icon.map-label .name {
  display: inline-block;

  color: var(--map-label-text);
  font-size: var(--map-label-size);
  line-height: 1.05;
  letter-spacing: var(--map-label-letter);
  white-space: nowrap;

  pointer-events: auto !important;
}

/* Distanzanzeige */
.leaflet-marker-icon.map-label .distance {
  display: inline-block;

  margin-top: .08rem;

  color: var(--map-label-text);
  font-size: var(--map-distance-size);
  line-height: 1;
  letter-spacing: var(--map-distance-letter);
  white-space: nowrap;

  pointer-events: auto !important;
}

/* Treffer / Filterauswahl */
.leaflet-marker-icon.map-label .name.highlighted,
.leaflet-marker-icon.map-label .name.is-fav.highlighted {
  display: inline-block;

  padding: 2px 5px 3px;

  background: var(--map-label-red);
  color: #fff !important;
  border-radius: 0;
}

/* Distanz bei Treffer */
.leaflet-marker-icon.map-label .distance.highlighted {
  color: var(--map-label-red);
  font-weight: 500;
}

/* Favoriten, wenn nicht highlighted */
.leaflet-marker-icon.map-label .name.is-fav:not(.highlighted) {
  display: inline-block;

  padding: 2px 5px 3px;

  background: var(--map-name-bg, #d2bb00);
  color: #111 !important;
  border-radius: 0;
}

/* Ausgegraute Labels */
.leaflet-marker-icon.map-label .name.dimmed,
.leaflet-marker-icon.map-label .distance.dimmed {
  color: var(--map-label-muted) !important;
}

/* Zusätzliche Absicherung für oberste Ebene */
.leaflet-marker-icon.map-label.is-highlighted .label-link,
.leaflet-marker-icon.map-label.is-highlighted .name,
.leaflet-marker-icon.map-label.is-highlighted .distance {
  position: relative;
  z-index: 1000000;
}

/* ============================================================
   Camera points / red rings
============================================================ */

.leaflet-interactive.kamerapunkt,
path.leaflet-interactive.kamerapunkt {
  cursor: default !important;
}

/* Hervorgehobene rote Ringe sollen visuell über grauen Punkten liegen */
.leaflet-interactive.kamerapunkt.is-highlighted,
path.leaflet-interactive.kamerapunkt.is-highlighted {
  filter: none;
}

/* Produktionsort */
.leaflet-interactive.produktionsort-marker,
path.leaflet-interactive.produktionsort-marker {
  cursor: default !important;
}

/* Radius-Kreis soll keine Klicks blockieren */
.leaflet-interactive.radius-circle,
path.leaflet-interactive.radius-circle {
  pointer-events: none !important;
}

/* ============================================================
   Custom zoom buttons
============================================================ */

body.map-page #map .custom-zoom {
  position: relative;
  z-index: 5001 !important;

  display: flex !important;
  flex-direction: column;
  gap: .35rem;

  margin-left: 14px !important;
  margin-top: 93px !important;

  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;

  pointer-events: auto;
}

body.map-page #map .custom-zoom .zoom-btn {
  all: unset;

  display: flex !important;
  align-items: center;
  justify-content: center;

  width: 42px !important;
  height: 42px !important;

  cursor: pointer;
  pointer-events: auto;

  opacity: 1 !important;
  visibility: visible !important;
}

body.map-page #map .custom-zoom .zoom-btn svg {
  display: block !important;
  width: 42px !important;
  height: 42px !important;
  overflow: visible;
}

body.map-page #map .custom-zoom .zoom-btn circle {
  fill: var(--map-label-black);
  transition: fill .18s ease;
}

body.map-page #map .custom-zoom .zoom-btn line {
  stroke: #fff;
}

body.map-page #map .custom-zoom .zoom-btn:hover circle,
body.map-page #map .custom-zoom .zoom-btn:focus-visible circle {
  fill: var(--map-label-red);
}

/* ============================================================
   Search overlay
============================================================ */

body.map-page .container-profil {
  position: fixed;
  top: calc(var(--map-gap) + 1.1rem);
  left: calc(var(--map-gap) + 1.1rem);
  z-index: 6500;

  width: min(560px, calc(100vw - var(--map-right-rail) - 4rem));
  max-width: none;

  margin: 0;
  padding: 0;

  pointer-events: none;
}

body.map-page #search-location,
body.map-page #ort-wrapper,
body.map-page #locationInput,
body.map-page #clearOrt {
  pointer-events: auto;
}

body.map-page #search-location {
  margin: 0;
  padding: 0;
}

body.map-page #locationInput {
  margin: 0;

  background: rgba(245, 245, 245, .92);

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ============================================================
   Radius button
============================================================ */

body.map-page #radiusToggle {
  position: fixed;
  top: calc(var(--map-gap) + 13rem);
  left: calc(var(--map-gap) + 1rem);
  z-index: 6500;
}

/* ============================================================
   Route status message
============================================================ */

/* ============================================================
   Centered warning / info message
============================================================ */

.map-route-message {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 9000;

  width: min(520px, calc(100vw - 2.5rem));
  min-height: 130px;

  padding: 2.2rem 1.6rem 1.55rem;
  box-sizing: border-box;

  transform: translate(-50%, -50%);

  align-items: center;
  justify-content: center;

  background: rgba(160, 1, 1, .96);
  color: #fff;
  border: 1px solid rgba(160, 1, 1, 1);

  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: .035rem;
  text-align: center;

  box-shadow: none;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  animation: map-message-in .2s ease-out both;
}

.map-route-message-text {
  max-width: 36rem;
}

.map-route-message-close {
  all: unset;

  position: absolute;
  top: .65rem;
  right: .75rem;

  cursor: pointer;

  color: #fff;
  font-size: .62rem;
  line-height: 1;
  letter-spacing: .12rem;
  text-transform: uppercase;

  opacity: .9;

  transition:
    opacity .18s ease,
    transform .18s ease;
}

.map-route-message-close:hover,
.map-route-message-close:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
}

@keyframes map-message-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.985);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ============================================================
   Route links box: Google Maps / SBB
============================================================ */

#routen-links.map-route-links {
  display: none;
  position: fixed;

  left: calc((100vw - var(--map-right-rail)) / 2);
  bottom: calc(var(--map-footer-h) + .85rem);
  transform: translateX(-50%);
  z-index: 6600;

  width: min(
    calc(100vw - var(--map-right-rail) - (var(--map-gap) * 2)),
    560px
  );
  max-width: none;

  margin: 0;
  padding: 1.85rem 1.15rem 1.1rem;
  box-sizing: border-box;

  background: var(--map-panel-bg);
  color: var(--color-11, #111);
  border: 1px solid var(--color-15, #111);

  font-size: .95rem;
  line-height: 1.35;
  letter-spacing: .025rem;
  text-align: center;

  box-shadow: none;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  animation: map-route-box-in .22s ease-out both;
}

#routen-links.map-route-links::before {
  content: "Route options";

  display: block;
  margin-bottom: .35rem;

  color: var(--color-15, #111);
  font-size: .72rem;
  line-height: 1;
  letter-spacing: .12rem;
  text-transform: uppercase;
}

#routen-links.map-route-links #from-text,
#routen-links.map-route-links #to-text {
  font-weight: 500;
}

#routen-links.map-route-links a,
#routen-links.map-route-links a:link,
#routen-links.map-route-links a:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 8.5rem;
  margin: .8rem .25rem 0;
  padding: .55rem .8rem;
  box-sizing: border-box;

  background: var(--color-11, #111) !important;
  color: #f4f4f4 !important;
  border: 1px solid var(--color-11, #111) !important;

  font-size: .82rem;
  line-height: 1;
  letter-spacing: .08rem;
  text-transform: uppercase;
  text-decoration: none !important;

  transition:
    background-color .18s ease,
    border-color .18s ease,
    color .18s ease,
    transform .18s ease;
}

#routen-links.map-route-links a:hover,
#routen-links.map-route-links a:focus-visible {
  background: var(--map-label-red) !important;
  color: #f4f4f4 !important;
  border-color: var(--map-label-red) !important;
  transform: translateY(-1px);
}

#routen-links.map-route-links .route-box-close {
  all: unset;

  position: absolute;
  top: .45rem;
  right: .6rem;

  cursor: pointer;
  color: var(--color-11, #111);

  font-size: .62rem;
  line-height: 1;
  letter-spacing: .11rem;
  text-transform: uppercase;

  transition:
    color .18s ease,
    transform .18s ease;
}

#routen-links.map-route-links .route-box-close:hover,
#routen-links.map-route-links .route-box-close:focus-visible {
  color: var(--map-label-red);
  transform: translateY(-1px);
}

@keyframes map-route-box-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(.75rem);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ============================================================
   Hover tooltip for red rings
============================================================ */

#hover-tooltip {
  position: fixed;
  z-index: 7000;

  width: auto;
  min-width: 0;
  max-width: 360px;
  height: auto;
  min-height: 0;

  padding: .35rem .5rem .38rem;
  box-sizing: border-box;

  background: rgba(245, 245, 245, .96);
  color: var(--color-11, #111);
  border: 1px solid var(--color-15, #111);

  font-size: .66rem;
  line-height: 1.25;
  letter-spacing: .045rem;
  text-align: left;

  white-space: normal;
  overflow: visible;

  opacity: 0;
  pointer-events: none;

  transition: opacity .12s ease;
}

/* ============================================================
   Scale line
============================================================ */

body.map-page #map .scale-line-container {
  margin-left: 10px !important;
  margin-bottom: 10px !important;

  color: #111;
  font-size: .68rem;
  line-height: 1;
  letter-spacing: .04rem;

  pointer-events: none;
}

/* ============================================================
   Footer
============================================================ */

body.map-page .footer-wrapper {
  flex: 0 0 var(--map-footer-h);

  width: auto;
  max-width: none;
  min-height: var(--map-footer-h);

  margin: 0 calc(var(--map-right-rail) + var(--map-gap)) 0 var(--map-gap);
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  box-sizing: border-box;
  overflow: hidden;
}

body.map-page .footertext {
  max-width: none;
  margin: 0;
  padding: 0;

  font-size: .825rem;
  line-height: 1rem;
  text-align: center;
}

/* ============================================================
   Responsive
============================================================ */

@media (max-width: 800px) {
  #routen-links.map-route-links {
    left: 50%;
    width: calc(100vw - 2.5rem);
  }
}

@media (max-width: 640px) {
  body.map-page {
    --map-gap: .625rem;
    --map-bottom-gap: .25rem;
    --map-footer-h: 2.65rem;

    /* Abstand links zum Browserrand = Abstand rechts zum Menubalken */
    --map-mobile-field-gap: calc(var(--map-gap) + .75rem);
  }

  body.map-page .container-profil {
    top: calc(var(--map-gap) + .75rem);
    left: var(--map-mobile-field-gap);
    right: calc(var(--map-right-rail) + var(--map-mobile-field-gap));

    width: auto;
    max-width: none;
  }

  body.map-page #map .custom-zoom {
    margin-left: 10px !important;
    margin-top: 86px !important;
  }

  body.map-page #radiusToggle {
    top: calc(var(--map-gap) + 11.5rem);
    left: calc(var(--map-gap) + .8rem);
  }

 .leaflet-marker-icon.map-label a.label-link {
  padding: 2px 4px 3px;
  transform: translateY(9px);
}

  .leaflet-marker-icon.map-label .name {
    font-size: var(--map-label-size-mobile);
    letter-spacing: .055rem;
  }

  .leaflet-marker-icon.map-label .distance {
    font-size: .58rem;
    letter-spacing: .045rem;
  }

  #routen-links.map-route-links {
    bottom: calc(var(--map-footer-h) + .65rem);
    padding: 1.75rem .9rem .9rem;
    font-size: .85rem;
  }

  #routen-links.map-route-links a {
    width: 100%;
    margin: .55rem 0 0;
  }

  body.map-page .footertext {
    font-size: .78rem;
  }

 .map-route-message {
    width: calc(100vw - 2rem);
    min-height: 120px;
    padding: 2.1rem 1.1rem 1.35rem;

    font-size: .92rem;
    line-height: 1.32;
  }
}

/* Landscape phones */
@media (max-width: 900px) and (orientation: landscape) {
  .leaflet-marker-icon.map-label .name {
    font-size: .66rem;
  }

  .leaflet-marker-icon.map-label .distance {
    font-size: .56rem;
  }

  body.map-page #radiusToggle {
    top: calc(var(--map-gap) + 11.9rem);
  }
}

/* Very narrow screens */
@media (max-width: 380px) {
  body.map-page {
    --map-right-rail: 2.15rem;
  }

body.map-page .container-profil {
  left: var(--map-mobile-field-gap);
  right: calc(var(--map-right-rail) + var(--map-mobile-field-gap));
  width: auto;
}

  .leaflet-marker-icon.map-label .name {
    font-size: .64rem;
    letter-spacing: .045rem;
  }

  .leaflet-marker-icon.map-label .distance {
    font-size: .54rem;
  }
}

/* ============================================================
   Reduced motion
============================================================ */

@media (prefers-reduced-motion: reduce) {
  #routen-links.map-route-links {
    animation: none;
  }

  body.map-page #loading-overlay,
  #hover-tooltip,
  #routen-links.map-route-links a,
  #routen-links.map-route-links .route-box-close,
  body.map-page #map .custom-zoom .zoom-btn circle {
    transition: none;
  }
}