
/*
 * zoom level dependend width
 * 
 * --<namespace>-<style>-<(set|min|max|scale)>-<name>
 * scale: [min] * [scale] = [meter]
 * 
 */

:root {
  --bahn-z-exist-scale-all: 3;
  --bahn-z-exist-set-stroke-1: 2;
  --bahn-z-exist-set-stroke-2: 3;
  --bahn-z-exist-set-dash-1: 10;
  --bahn-z-exist-set-dash-2: 7;
  --bahn-z-exist-min-stroke-1: 2;
  --bahn-z-exist-min-stroke-2: 3;
  --bahn-z-exist-min-dash-1: 10;
  --bahn-z-exist-min-dash-2: 7;
  --bahn-z-exist-max-stroke-1: 20;
  --bahn-z-exist-max-stroke-2: 30;
  --bahn-z-exist-max-dash-1: 100;
  --bahn-z-exist-max-dash-2: 70;
  --bahn-z-route-scale-all: 50;
  --bahn-z-route-set-opacity: 0.1;
  --bahn-z-route-min-opacity: 0.2;
  --bahn-z-route-max-opacity: 1;
  --bahn-z-route-max-zoom: 11;

  --bahn-z-pfa-scale-all: 3;
  --bahn-z-pfa-set-stroke: 60;
  --bahn-z-pfa-min-stroke: 50;
  --bahn-z-pfa-max-stroke: 320;

  
  --bahn-c-route-thread-a: #7d7d84;
  --bahn-c-route-thread-b: #7d7d84;
  --bahn-c-route-thread-c: #7d7d84;
  --bahn-c-route-thread-d: #7d7d84;
  --bahn-c-route-thread-e: #7d7d84;
  --bahn-c-route-thread-f: #7d7d84;
  --bahn-c-route-thread-g: #7d7d84;
  --bahn-c-route-thread-h: #7d7d84;
  --bahn-c-route-thread-i: #7d7d84;
  --bahn-c-route-thread-j: #7d7d84;
  
  --map-color-pfa-even-fill: #e7c405;
  --map-color-pfa-even-stroke: #a48b00;
  --map-color-pfa-odd-fill: #ff6000;
  --map-color-pfa-odd-stroke: #ff6000;
}

/*
.l-bahn-pfa {
  stroke: var(--map-color-pfa-even);;
  opacity: .3;
  stroke-linecap: butt;
}

.leaflet-pane .l-bahn-pfa {
  stroke-width: var(--bahn-z-pfa-set-stroke);
}
*/

.l-bahn-tid-20,
.l-bahn-tid-22,
.l-bahn-tid-24,
.l-bahn-tid-26,
.l-bahn-tid-28,
.l-bahn-tid-30,
.l-bahn-tid-32,
.l-bahn-tid-13,
.l-bahn-pfa .l-bahn-even
{
  fill-opacity: .3;
  stroke-opacity: .7;
  stroke-width: 1.33px;
  stroke: var(--map-color-pfa-even-stroke);
  fill: var(--map-color-pfa-even-fill);
}

.l-bahn-tid-21,
.l-bahn-tid-23,
.l-bahn-tid-25,
.l-bahn-tid-27,
.l-bahn-tid-29,
.l-bahn-tid-31,
.l-bahn-tid-33,
.l-bahn-pfa .l-bahn-odd
{
  fill-opacity: .3;
  stroke-opacity: .7;
  stroke-width: 1.33px;
  stroke: var(--map-color-pfa-odd-stroke);
  fill: var(--map-color-pfa-odd-fill);
}

.leaflet-pane .l-bahn-alt-tunnel {
  stroke: #38a4ce;
  stroke-dasharray: 10,7;
/*   filter: drop-shadow( 0px 0px 3px rgba(0, 0, 0, .3)); */
}

.leaflet-pane .l-bahn-alt-bridge {
  stroke: #ff7e2d;
/*   filter: drop-shadow( 0px 0px 3px rgba(0, 0, 0, .3)); */
}

/* Böschung */
.leaflet-pane .l-bahn-alt-emb {
  stroke: #65c148;
/*   filter: drop-shadow( 0px 0px 3px rgba(0, 0, 0, .3)); */
}

.leaflet-pane .l-bahn-alt-others {
  stroke: #65c148;
}

.leaflet-pane .l-bahn-exist-tunnel {
  stroke: #38a4ce;
  stroke-dasharray: 10,7;
}

.leaflet-pane .l-bahn-exist-bridge {
  stroke: #ff7e2d;
}

/* Böschung */
.leaflet-pane .l-bahn-exist-emb {
  stroke: #65c148;
}

.leaflet-pane .l-bahn-exist-others {
  stroke: #333;
  stroke-width: var(--bahn-z-exist-set-stroke-2);
}

.leaflet-pane .l-bahn-exist-others-w {
  stroke: #fff;
  stroke-width: var(--bahn-z-exist-set-stroke-1);
  stroke-dasharray: var(--bahn-z-exist-set-dash-1),var(--bahn-z-exist-set-dash-2);
  stroke-linecap: butt;
}

.leaflet-pane .l-bahn-exist-others.l-bahn-exit-marker {
/*   stroke-width: 10px; */
  stroke-width: calc(var(--bahn-z-exist-set-stroke-2) * 2.5px);
  stroke: #0b0;
  stroke-opacity: 0.6;
}

.leaflet-panel-layers-item .l-bahn-exit .l-bahn-exit-marker {
  stroke-width: 18px;
  stroke: #0b0;
  stroke-opacity: 0.6;
}


.leaflet-pane .l-bahn-route {
  /*   stroke: #7d7d84; */
  /*   stroke-width: var(--bahn-z-exist-set-stroke-2); */
  stroke-opacity: calc(1.0 - var(--bahn-z-route-set-opacity));
}
.leaflet-pane .l-bahn-route.l-thread-a {
  stroke: var(--bahn-c-route-thread-a)
}
.leaflet-pane .l-bahn-route.l-thread-b {
  stroke: var(--bahn-c-route-thread-b)
}
.leaflet-pane .l-bahn-route.l-thread-c {
  stroke: var(--bahn-c-route-thread-c)
}
.leaflet-pane .l-bahn-route.l-thread-d {
  stroke: var(--bahn-c-route-thread-d)
}
.leaflet-pane .l-bahn-route.l-thread-e {
  stroke: var(--bahn-c-route-thread-e)
}
.leaflet-pane .l-bahn-route.l-thread-f {
  stroke: var(--bahn-c-route-thread-f)
}
.leaflet-pane .l-bahn-route.l-thread-g {
  stroke: var(--bahn-c-route-thread-g)
}
.leaflet-pane .l-bahn-route.l-thread-h {
  stroke: var(--bahn-c-route-thread-h)
}
.leaflet-pane .l-bahn-route.l-thread-i {
  stroke: var(--bahn-c-route-thread-i)
}
.leaflet-pane .l-bahn-route.l-thread-j {
  stroke: var(--bahn-c-route-thread-j)
}

.leaflet-panel-layers-item .l-bahn-route {
  fill: #7d7d84;
}

.leaflet-pane .l-bahn-route.l-bahn-route-tunnel {
  stroke-width: calc(var(--bahn-z-exist-set-stroke-2) * 2.5px);
  stroke: #6cc1fe;
/*   stroke-opacity: 0.6; */
}
.leaflet-panel-layers-item .l-bahn-route .l-bahn-route-tunnel {
  stroke-width: 19px;
  stroke: #6cc1fe;
/*   stroke-opacity: 0.6; */
}

.leaflet-pane .l-bahn-route.l-bahn-route-bridge {
  stroke-width: calc(var(--bahn-z-exist-set-stroke-2) * 2.5px);
  stroke: #ff8787;
/*   stroke-opacity: 0.6; */
}
.leaflet-panel-layers-item .l-bahn-route .l-bahn-route-bridge {
  stroke-width: 19px;
  stroke: #ff8787;
/*   stroke-opacity: 0.6; */
}

.leaflet-pane .l-bahn-route.l-bahn-route-extend {
  stroke-width: calc(var(--bahn-z-exist-set-stroke-2) * 2.5px);
  stroke: #fffd95;
/*   stroke-opacity: 0.6; */
}
.leaflet-panel-layers-item .l-bahn-route .l-bahn-route-extend {
  stroke-width: 19px;
  stroke: #fffd95;
/*   stroke-opacity: 0.6; */
}

.l-bahn-route-corridor {
  stroke: none;
  fill: #b57f18;
  fill-opacity: 0.3;
}

.l-bahn-route-hinge {
  fill: #ff7800;
  stroke: #000;
  stroke-width: 2px;
}

.leaflet-pane .l-bahn-route-hinge {
  stroke-width: 1px;
  stroke-opacity: calc(1.0 - var(--bahn-z-route-set-opacity));
  fill-opacity: calc(1.0 - var(--bahn-z-route-set-opacity));
}



/*
.leaflet-panel-layers-item .l-bahn-exist {
  stroke-width: 4px;
  stroke: #333;
  fill: #fff;
  scale: .95;
}
*/

.leaflet-panel-layers-item .l-bahn-exist {
  stroke: none;
  fill: #fff;
}

.leaflet-panel-layers-item .l-bahn-exit {
  stroke: none;
  fill: #d0ffd0;
}

.leaflet-panel-layers.collapsible:not(.minimized) .leaflet-panel-layers-list {
  min-width: 225px;
}

/*
.leaflet-pane .l-bahn-exit.l-bahn-exist-others {
  filter: drop-shadow( 0px  2px  0.5px rgba(0, 192, 0, 1.0)) 
          drop-shadow( 0px -2px  0.5px rgba(0, 192, 0, 1.0))
          drop-shadow( 2px  0px  0.5px rgba(0, 192, 0, 1.0))
          drop-shadow(-2px  0px  0.5px rgba(0, 192, 0, 1.0));
  -webkit-filter: drop-shadow( 0px  2px  0.5px rgba(0, 192, 0, 1.0)) 
          drop-shadow( 0px -2px  0.5px rgba(0, 192, 0, 1.0))
          drop-shadow( 2px  0px  0.5px rgba(0, 192, 0, 1.0))
          drop-shadow(-2px  0px  0.5px rgba(0, 192, 0, 1.0));
}
*/

/*
.leaflet-pane .l-bahn-exit.l-bahn-exist-others-w {
  stroke: #bfb;
}
*/

.l-bahn-locality {
/*   stroke: #bbcae0; */
  stroke: #ff8855;
  stroke-width: 1;
  fill: #ff8855;
  fill-opacity: 0.4;
}

/*
.l-bahn-search {
  stroke: #666;
  stroke-dasharray: 10,7;
  stroke-width: 2;
  fill: #555;
  fill-opacity: 0.16;
  cursor: inherit;
}
*/

.l-bahn-search {
/*  stroke: #f65;*/
  stroke: #000;
  stroke-opacity: 0.75;
  stroke-dasharray: 10,7;
  stroke-width: 1;
  fill: #555;
  fill-opacity: 0.16;
  cursor: inherit;
}


.leaflet-pane .l-bahn-search-w {
  stroke: #fff;
  stroke-opacity: 0.5;
  stroke-width: 2;
  fill: #fff;
  fill-opacity: 0.5;
  display: none;
}

.leaflet-pane .l-bahn-search-inner {
  stroke: none;
  fill: #FFF;
  fill-opacity: 0.0;
}

.leaflet-pane .leaflet-tile-container {
/*   filter: blur(1px); */
}

.l-bahn-municip {
  stroke: #ff6200;
  stroke-width: 2;
  fill: none;
}

.l-bahn-corridor-nord {
  stroke: none;
/*   stroke-width: 0; */
  fill: #ff8855;
  fill-opacity: 0.35;
}

.l-bahn-corridor-ost {
  stroke: none;
/*   stroke-width: 0; */
  fill: #8855ff;
  fill-opacity: 0.35;
}

.l-bahn-corridor-sued {
  stroke: none;
/*   stroke-width: 0; */
  fill: #55ff88;
  fill-opacity: 0.35;
}

.l-bahn-rwk-2 {
  stroke: none;
/*   stroke-width: 0; */
  fill: #ffd325;
  fill-opacity: 0.45;
}

.l-bahn-rwk-3 {
  stroke: none;
/*   stroke-width: 0; */
  fill: #ff8800;
  fill-opacity: 0.45;
}

.l-bahn-rwk-4 {
  stroke: none;
/*   stroke-width: 0; */
  fill: #fe0000;
  fill-opacity: 0.45;
}

.l-bahn-rwk-5 {
  stroke: none;
/*   stroke-width: 0; */
  fill: #c700ff;
  fill-opacity: 0.45;
}

.leaflet-overlay-sg-pane path {
  stroke: none;
  fill-opacity: 0.2;
  fill: #3388ff;
}


.l-bahn-search-prins {
  stroke: none;
  fill-opacity: 0.2;
  fill: #fd2d02;  
}

.leaflet-container {
  font: inherit;
  background-color: white;
}

.leaflet-control-layers, .leaflet-popup {
  font-size: 0.75rem;
  max-width: 95vw; /* fix popup width on mobile devices */
}

.leaflet-control a {
  color: #222;
}

.leaflet-container a.leaflet-popup-close-button {
  top: 4px;
  right: 4px;
  font-size: 1.5rem;
  line-height: 1;
}

/*
.leaflet-popup-content-wrapper {
  border-radius: 4px;
}
*/

/* don't show outlines on focus when tabbing or programmatically set */
.leaflet-popup-content {
  outline: none;
  font-size: 0.875rem !important;
  line-height: var(--bs-body-line-height);
}

.leaflet-popup-content ul {
  padding-left: 1rem;
}


.leaflet-popup-content h3 {
	margin-top: 0px;
	margin-bottom: .5rem;
    font-size: 1.125rem;
}


.leaflet-popup-content p {
    margin-top: 0.75rem;
}

.leaflet-overlay-pane .popupmarker {
  stroke: #444;
  stroke-width: 2;
  stroke-dasharray: 3,2.8;
  fill: #444;
  fill-opacity: 0.25;
}



/* get rid of a lot of icon inconsistencies */
/* .leaflet-bar a, */
/*
.leaflet-bar a .fa,
.leaflet-bar a .far,
.leaflet-bar a .fas {
  font-size: 1.125rem;
  width: 1.875rem !important;
  height: 1.875rem !important;
  line-height: 1.875rem !important;
}
*/

/* don't highlight on hover */
.leaflet-bar a:hover {
  color: inherit;
}

/*
.leaflet-modal .modal-icon {
  font-size: 1.5rem;
  padding-right: 1.2rem;
}
*/
.modal-header .modal-icon {
  font-size: 1.6rem;
  padding-right: 1.2rem;
  padding-top: .2rem;
}
.modal-header .modal-icon > * {
  vertical-align: top;
}

.leaflet-modal .map-legend.fa-ul > li {
  padding-bottom: 5px;
}

/* font awesome icon with border */
.leaflet-fa-border {
  width: 1.8em;
  height: 1.8em;
  line-height: 1.65em;
  border: 2px solid rgba(0,0,0,0.2);
  border-radius: 2px;
  display: inline-block;
  background: #fff;
  text-align: center;
  vertical-align: text-bottom;
}

/* FIXME: consolidate with leaflet-fa-border */
.leaflet-modal .map-legend .fa-li {
  left: -2.4em;
  position: absolute;
  text-align: center;
  width: 1.8em;
  height: 1.8em;
  line-height: 1.65em;
  border: 2px solid rgba(0,0,0,0.2);
  border-radius: 2px;
  background: #fff;
}

.leaflet-modal .close {
  color: #c3c3c3; /* leaflet close button */
  opacity: 1;
}

.leaflet-modal .close:hover {
  color: #999; /* leaflet close button */
  opacity: 1 !important;
}

/* theme layer-control icon */
.leaflet-container .fad.fa-layer-group {
  --fa-secondary-opacity: .5;
  --fa-secondary-color: #282D37;
  --fa-primary-opacity: 1;
  --fa-primary-color: #282D37;
}

/* avoid overflow scrollbar appearing and causing jitter */
.leaflet-modal .modal {
  overflow: hidden;
}



/*
 * 
 * sidebar related
 * 
 */
.leaflet-sidebar-header {
  margin-bottom: 10px;
}

.leaflet-sidebar-tabs > li > a, .leaflet-sidebar-tabs > ul > li > a {
  position: inherit;
}

.leaflet-sidebar-tabs li {
  position: relative;
/*  margin: 0;
  padding-bottom: 1em;
  padding-left: 20px; */
}

.leaflet-sidebar-tabs li.tl:before {
  content: '';
  background-color: #c50014;
/*   background-color: #b8bbc2; */
  position: absolute;
  bottom: 0px;
  top: 0px;
  left: 19.25px;
  width: 1.5px;
}

.leaflet-sidebar-tabs li.tl-mid:before {
  top: 0px;
}

.leaflet-sidebar-tabs li.tl-first:before {
  top: 20px;
}

.leaflet-sidebar-tabs li.tl-last:before {
  bottom: 20px;
}

.leaflet-sidebar-tabs li.tl-dashed:before {
  background: repeating-linear-gradient( 180deg, rgba(0,0,0,0), rgba(0,0,0,0) 5px, #c50014 5px, #c50014 10px);
}


/*
.leaflet-sidebar-tabs li:after {
  content: '';
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='station' aria-hidden='true' viewBox='0 0 32 32' focusable='false'%3E%3Ccircle stroke='%23c00' stroke-width='3px' fill='%23fff' cx='16' cy='16' r='13'%3E%3C/circle%3E%3C/svg%3E");
  position: absolute;
  left: 0;
  top: 2px;
  height: 12px;
  width: 12px;
}
*/

.leaflet-sidebar-tabs .station {
  stroke: #c50014;
  stroke-width: 3.5px;
  stroke-linejoin: round;
  fill: #fff;
}

.leaflet-sidebar-tabs li.tl-dashed .station {
  stroke-dasharray: 10px 3.8px;
/*   stroke-width: 2.5px; */
  stroke-dashoffset: 2px;
}

/* Firefox */
.leaflet-sidebar-tabs {
  scrollbar-width: thin;
}
/* Works on Chrome/Edge/Safari */
.leaflet-sidebar-tabs::-webkit-scrollbar {
  width: 12px;
}


/*
.leaflet-sidebar-tabs .station-triangle {
  stroke-linejoin: round;
}
*/

.leaflet-sidebar-tabs li.active .station {
/*   fill: #c50014; */
}

.leaflet-sidebar-tabs li.map-active .station {
/*   stroke: #ec0016; */
  fill: #c50014;
}

.leaflet-sidebar-tabs > li.tl.active, .leaflet-sidebar-tabs > ul > li.tl.active {
/*   background-color: unset; */
}

/* sidebar vertical title / year */
.leaflet-sidebar-tabs li.sb-title {
  margin-top: .8rem;
  margin-bottom: .8rem;
  background: #fff;
  color: #646973 !important;
  font-weight: bold;
}
.leaflet-sidebar-tabs li.sb-title a {
  -webkit-transform: rotate(-90deg);
  -moz-transform: rotate(-90deg);
  -ms-transform: rotate(-90deg);
  -o-transform: rotate(-90deg);
}


/* make theme more consistent */
.leaflet-panel-layers, .leaflet-popup-content-wrapper, .leaflet-bar {
  border-radius: .2rem !important;
  overflow: hidden !important;
}

.leaflet-touch .leaflet-bar a:last-child {
  border-bottom-left-radius: .1rem;
  border-bottom-right-radius: .1rem;
}

.leaflet-touch .leaflet-bar a:first-child {
  border-top-left-radius: .1rem;
  border-top-right-radius: .1rem;
}


.extra-marker .map-icon {
  position: absolute;
  left: 0;
  top: 6px;
  width: 35px;
  filter: drop-shadow( 1px 1px 2px rgba(0, 0, 0, .6));
  -webkit-filter: drop-shadow( 1px 1px 2px rgba(0, 0, 0, .6));
}

.leaflet-pm-toolbar.disabled::after {
    position: absolute;
    background-color: white;
    opacity: .5;
    width: 100%;
    height: 100%;
    content: '';
    top: 0;
    z-index: 1000;
    pointer-events: all;
}

/* put leaflet controls into a flex container to manipulate order */
.leaflet-top.leaflet-right {
  display: flex;
  flex-direction: column;
}
.leaflet-top.leaflet-right  > div {
  align-self: flex-end;
}

.leaflet-watermark {
  pointer-events: none;
  filter: drop-shadow( 2px 2px 4px rgba(200, 200, 200,.8))
          drop-shadow( -1px -1px 3px rgba(200, 200, 200,.8));
}


.color-filter-b2w {
  filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(7495%) hue-rotate(204deg) brightness(101%) contrast(101%);
}

.leaflet-control-container {
  font-size: .875rem;
}

/* always leave space for the sidebar */
.leaflet-control-container .leaflet-right {
  margin-left: 40px;
}

.leaflet-sidebar-tabs .text-vert {
  transform: rotate(-90deg) translateY(-3px);
}
