@font-face {
	font-family: 'legend';
	/*src: url('GermaniaOne-Regular.ttf') format('truetype');*/
  src: url('Metamorphous-Regular.ttf') format('truetype');
  /*font-family: Arial, Helvetica, sans-serif*/;
}
@font-face {
  font-family: 'label';
  font-weight: bold;
  /*src: url('GermaniaOne-Regular.ttf') format('truetype');*/
  src: url('Metamorphous-Regular.ttf') format('truetype');
	/* src: url('Roboto/Roboto-Regular.ttf') format('truetype'); */
}
body {
  padding: 0;
  margin: 0;
}
html, body, #map {
  height: 100%;
  width: 100%;
}
body {
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.leaflet-tooltip.my-labels {
  font-family:label;
	transform-origin: 0 0;
  transform: rotate(-30deg);
  background-color: transparent;
  border: transparent;
  box-shadow: none;
  font-size: 18px;
  font-weight: 800;
  text-shadow:1px 1px 1px #fff, -1px -1px 1px #fff;
}
.leaflet-tooltip.my-markers {
  font-family:label;
	transform-origin: 0 0;
  transform: rotate(-30deg);
  background-color: transparent;
  border: transparent;
  box-shadow: none;
  padding-top: 30px;
  font-size: 12px;
  font-style: italic;
  text-shadow:1px 1px 1px #fff, -1px -1px 1px #fff;
}
/*Legend specific*/
.legend {
  font-family:legend;
	padding: 6px 8px; 
  font-size: 14px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  line-height: 24px;
  color: #000;
}
.legend h4 {
  text-align: center;
  font-size: 16px;
  margin: 2px 8px 2px 8px;
  color: #000;
}

.legend span {
  position: relative;
  bottom: 3px;
}

.legend i {
  width: 18px;
  height: 18px;
  float: left;
  margin: 0 8px 0 0;
  opacity: 0.7;
}

.legend i.icon {
  background-size: 18px;
  background-color: rgba(255, 255, 255, 1);
}

hr {
  border:none;
  border-top:1px dashed #000;
  color:#fff;
  background-color:#fff;
  height:1px;
  width:50%;
}

/*Period description inside a legend*/
.legend details.description {
  max-width: 460px;
  margin-top: 4px;
}
.legend details.description summary {
  cursor: pointer;
  font-weight: bold;
}
.legend details.description p {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 18px;
  margin: 6px 0;
}
.legend details.description[open] {
  max-height: none;   /*the whole legend box scrolls instead (see HistoryFitLegends in index.html)*/
}

/*Legend box: fits the screen (height set by HistoryFitLegends), scrolls inside; its title folds it*/
.leaflet-control.legend {
  max-width: calc(100vw - 20px);
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: break-word;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition: max-height 0.25s ease;
}
.leaflet-control.legend h4 {
  position: relative;
  padding-right: 16px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.leaflet-control.legend h4::after {
  content: '\25BE';   /*down arrow: tap to fold*/
  position: absolute;
  right: -4px;
  top: 0;
  font-size: 13px;
  color: #666;
}
.leaflet-control.legend.collapsed {
  overflow: hidden;
  cursor: pointer;
}
.leaflet-control.legend.collapsed h4::after {
  content: '\25B8';   /*right arrow: tap to unfold*/
}

/*Cities and names are hidden at continent zoom (see updateLabelVisibility)*/
.zoomed-out .city-marker,
.zoomed-out .leaflet-tooltip.my-labels,
.zoomed-out .leaflet-tooltip.my-markers {
  display: none;
}

/*Story layers: person markers and always-visible place names*/
.person-marker {
  background: transparent;
  border: none;
}
.person-marker svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.leaflet-tooltip.story-label {
  font-family: legend;
  font-size: 14px;
  font-weight: bold;
  color: #8e1b1b;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(142, 27, 27, 0.4);
  border-radius: 4px;
  box-shadow: none;
  padding: 1px 6px;
}
.leaflet-tooltip.story-label:before {
  display: none;
}
.legend .story-legend-icon svg {
  vertical-align: middle;
  margin: 0 6px 0 0;
}
.legend .story-legend-line {
  display: inline-block;
  width: 18px;
  margin: 0 6px 4px 0;
  border-top: 3px dashed;
  vertical-align: middle;
}

/*Story animation: play button and highlighted stop*/
.story-play a {
  font-size: 14px;
  font-weight: normal;
}
.person-marker.story-active svg {
  transform: scale(1.35);
  transition: transform 0.3s;
}
.person-marker.story-traveler svg circle:first-child {
  fill: #fbe9e7;
}

/*Compact legend for layers with many entries*/
.legend.compact {
  font-size: 12px;
  line-height: 17px;
  max-width: 440px;
}
.legend.compact h4 {
  font-size: 14px;
}
.legend.compact i {
  width: 13px;
  height: 13px;
  margin: 2px 6px 0 0;
}
.legend.compact small {
  font-size: 10px;
  line-height: 13px;
  display: inline-block;
}

/*Readable font for 20th-century layers (legends, names and cities)*/
@font-face {
  font-family: 'modern';
  src: url('Roboto/Roboto-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'modern';
  src: url('Roboto/Roboto-Italic.ttf') format('truetype');
  font-weight: normal;
  font-style: italic;
}
@font-face {
  font-family: 'modern';
  src: url('Roboto/Roboto-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'modern';
  src: url('Roboto/Roboto-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}
.legend.modern,
.legend.modern h4,
.leaflet-tooltip.modern {
  font-family: modern, Arial, Helvetica, sans-serif;
}
.legend.modern h4 {
  font-weight: bold;
}
.leaflet-tooltip.my-labels.modern {
  font-weight: 500;
  letter-spacing: 0.2px;
}
.leaflet-tooltip.my-labels.modern span {
  font-size: 17px !important;
}
.leaflet-tooltip.my-markers.modern span {
  font-size: 12px !important;
}

/*Legend and name toggles (see CaptionControl in index.html)*/
.hide-legend .leaflet-control.legend,
.hide-names .leaflet-tooltip.city-label,
.hide-names .leaflet-tooltip.story-label,
.hide-areas .leaflet-tooltip.area-label,
.hide-title .leaflet-control.map-title {
  display: none;
}
.caption-toggles a {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: bold;
}
.caption-toggles a.active {
  background-color: #dfe7f1;
  color: #1f4e85;
}

/*Story popups with the dates of each stop*/
.story-popup .leaflet-popup-content {
  font-family: modern, Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 19px;
  margin: 8px 12px;
  color: #333;
}
.story-popup .leaflet-popup-content strong {
  color: #8e1b1b;
}

/*Story: sync history maps with the years of the journey*/
.story-play a.story-sync {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
}
.story-play a.active {
  background-color: #dfe7f1;
  color: #1f4e85;
}
.story-popup .story-map-note {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #eee;
  font-size: 12px;
  color: #1f4e85;
}

/*Story replay: hide all map controls (the tile attribution stays, as the tile licences require)*/
.leaflet-control {
  transition: opacity 0.4s;
}
.story-replaying .leaflet-control:not(.leaflet-control-attribution) {
  opacity: 0;
  pointer-events: none;
}

/*City captions sit to the right of their dot (see bindTooltip patch in index.html)*/
.leaflet-tooltip.my-markers.city-label {
  padding: 0 2px;
  margin-left: 0;
  line-height: 1.2;
}
.leaflet-tooltip.my-markers.city-label span {
  white-space: nowrap;
}
.leaflet-tooltip.city-label:before {
  display: none;
}

/*Story replay speed: button and short on-screen indicator*/
.story-play a.story-speed {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: bold;
  color: #333;
}
.story-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 6px 14px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-family: modern, Arial, Helvetica, sans-serif;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.story-toast.visible {
  opacity: 1;
}

/*Revealing caption in the lower centre of the view on each layer change*/
.layer-caption {
  position: absolute;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  z-index: 1100;   /*in front of everything, including the legend and buttons (Leaflet controls are at 1000)*/
  max-width: 60%;
  padding: 10px 22px 12px;
  border-radius: 6px;
  background: rgba(20, 20, 20, 0.72);
  color: #fff;
  text-align: center;
  font-family: modern, Arial, Helvetica, sans-serif;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s;
}
.layer-caption.visible {
  opacity: 1;
  transition: opacity 0.25s;
}
.layer-caption-title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  clip-path: inset(0 100% 0 0);
}
.layer-caption-sub {
  margin-top: 4px;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: #f3d9a4;
  opacity: 0;
}
.layer-caption.visible .layer-caption-title {
  animation: caption-reveal 0.9s ease-out forwards;
}
.layer-caption.visible .layer-caption-sub {
  animation: caption-fade 0.6s ease-out 0.6s forwards;
}
@keyframes caption-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes caption-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 700px) {
  .layer-caption { max-width: 86%; bottom: 36px; }
  .layer-caption-title { font-size: 17px; }
  .layer-caption-sub { font-size: 13px; }
}

/*Language switch BE / EN (its own button, see LanguageControl in index.html)*/
.lang-control a.lang-toggle {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.3px;
}
/*The decorative legend font has no Cyrillic letters: use the readable font for Belarusian*/
html[lang="be"] .legend,
html[lang="be"] .legend h4,
html[lang="be"] .leaflet-tooltip.my-labels,
html[lang="be"] .leaflet-tooltip.my-markers {
  font-family: modern, Arial, Helvetica, sans-serif;
}

/*Hint under the layer list*/
.leaflet-control-layers .layers-hint {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid #ddd;
  font-size: 11px;
  color: #777;
}

/*Map title: beside the zoom buttons (see L.control.custom in index.html)*/
.leaflet-control.map-title {
  position: absolute;
  left: 50px;
  top: 0;
  width: 400px;
  max-width: calc(100vw - 120px);
}

/*SMALL SCREENS: phones and small tablets, portrait or landscape*/
.leaflet-control-layers .layers-hint label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
@media (max-width: 700px), (max-height: 500px) {
  /*buttons in rows, so they do not run down into the legend*/
  .caption-toggles,
  .story-play {
    display: flex;
  }
  .caption-toggles a,
  .story-play a {
    border-bottom: none !important;
    border-right: 1px solid #ccc;
    border-radius: 0 !important;
  }
  .caption-toggles a:first-child,
  .story-play a:first-child {
    border-radius: 2px 0 0 2px !important;
  }
  .caption-toggles a:last-child,
  .story-play a:last-child {
    border-right: none;
    border-radius: 0 2px 2px 0 !important;
  }
  /*title stays beside the zoom buttons, narrowed to fit between them and the layer buttons*/
  .leaflet-control.map-title {
    left: 44px;
    width: max-content;   /*as wide as the text (it would otherwise shrink to the narrow button column)*/
    max-width: calc(100vw - 44px - 70px);
  }
  .leaflet-control.map-title .legend {
    padding: 4px 8px;
  }
  .leaflet-control.map-title .legend h4 {
    font-size: 14px;
    line-height: 20px;
    margin: 0 4px;
  }
  /*legend: narrower, smaller, scrolls instead of covering the map*/
  .legend,
  .legend.compact {
    max-width: calc(100vw - 30px);
    /*leave room for the buttons and title above (about 215px)*/
    max-height: min(42vh, calc(100vh - 215px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    font-size: 11px;
    line-height: 16px;
    padding: 4px 6px;
  }
  .legend h4,
  .legend.compact h4 {
    font-size: 13px;
    margin: 2px 4px;
  }
  .legend i,
  .legend.compact i {
    width: 11px;
    height: 11px;
    margin: 2px 5px 0 0;
  }
  .legend.compact small {
    font-size: 9px;
    line-height: 12px;
  }
  .legend details.description {
    max-width: none;
  }
  .legend details.description[open] {
    max-height: none;
  }
  .legend details.description summary {
    padding: 4px 0;
  }
  .legend details.description p {
    font-size: 12px;
    line-height: 16px;
  }
  /*layer list: bigger rows for fingers*/
  .leaflet-control-layers-expanded {
    padding: 6px 10px 6px 8px;
    max-width: calc(100vw - 30px);
    box-sizing: border-box;
  }
  .leaflet-control-layers label {
    padding: 4px 0;
    font-size: 14px;
  }
  .leaflet-control-layers-selector {
    width: 18px;
    height: 18px;
    vertical-align: middle;
  }
  .leaflet-control-layers .layers-hint {
    font-size: 13px;
  }
  /*names on the map a little smaller*/
  .leaflet-container .leaflet-tooltip.my-labels span,
  .leaflet-container .leaflet-tooltip.my-labels.modern span {
    font-size: 14px !important;
  }
  .leaflet-container .leaflet-tooltip.my-markers span,
  .leaflet-container .leaflet-tooltip.my-markers.modern span {
    font-size: 11px !important;
  }
  .leaflet-tooltip.story-label {
    font-size: 12px;
  }
  .story-popup .leaflet-popup-content {
    font-size: 12px;
    line-height: 17px;
    margin: 6px 10px;
  }
  .leaflet-control-attribution {
    font-size: 9px;
    max-width: 60vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .story-toast {
    top: 10px;
    font-size: 13px;
  }
}
/*phone held sideways: little height, keep the caption low and small*/
@media (max-height: 500px) {
  .layer-caption { bottom: 26px; padding: 6px 16px 8px; }
  .layer-caption-title { font-size: 16px; }
  .layer-caption-sub { font-size: 12px; margin-top: 2px; }
  .legend, .legend.compact { max-height: calc(100vh - 215px); max-width: 55vw; }
}
/*notched phones: keep the controls off the rounded corners*/
@supports (padding: env(safe-area-inset-left)) {
  .leaflet-top.leaflet-left { padding-left: env(safe-area-inset-left); padding-top: env(safe-area-inset-top); }
  .leaflet-top.leaflet-right { padding-right: env(safe-area-inset-right); padding-top: env(safe-area-inset-top); }
  .leaflet-bottom.leaflet-left { padding-left: env(safe-area-inset-left); padding-bottom: env(safe-area-inset-bottom); }
  .leaflet-bottom.leaflet-right { padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); }
}

/*Stories: own button and list below the layer list (see StoriesControl in js/Radchanka.js)*/
.leaflet-container .stories-control .leaflet-control-layers-toggle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M13 7.2C10.6 5.4 7.4 4.9 3.5 5.4v13.4c3.9-.5 7.1 0 9.5 1.8 2.4-1.8 5.6-2.3 9.5-1.8V5.4c-3.9-.5-7.1 0-9.5 1.8z' fill='%23fff' stroke='%23555' stroke-width='1.7' stroke-linejoin='round'/%3E%3Cpath d='M13 7.2v13.4' stroke='%23555' stroke-width='1.5'/%3E%3Cpath d='M5.9 9.2c2-.2 3.8.1 5 .9M5.9 12.2c2-.2 3.8.1 5 .9M5.9 15.2c2-.2 3.8.1 5 .9' fill='none' stroke='%23999' stroke-width='1.1' stroke-linecap='round'/%3E%3Cpath d='M16.2 5.6v6.6l1.6-1.3 1.6 1.3V5.3' fill='%238e1b1b'/%3E%3C/svg%3E");
  background-size: 26px 26px;
}
.stories-control .stories-heading {
  margin: 0 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ddd;
  font-weight: bold;
  color: #333;
}

/*Legend entry with an on/off switch for its map line (props.switchable, see addHistoryLayer)*/
.legend label.legend-switch {
  cursor: pointer;
}
.legend label.legend-switch input {
  margin: 0 4px 0 0;
  vertical-align: middle;
}
.legend label.legend-switch i {
  float: none;
  display: inline-block;
  vertical-align: middle;
  margin-top: -2px;
}
/*further entries under the same switch: indented to line up with the first*/
.legend .legend-switch-more {
  display: inline-block;
  padding-left: 17px;
}

/*Layer and story lists (top right) in front of everything: the legend, the buttons and the layer caption (1100)*/
.leaflet-top.leaflet-right {
  z-index: 1200;
}

/*Legend scroll indicators (see HistoryLegendScrollMarks in index.html): stuck to the edges of the scrolling box*/
.leaflet-control.legend::before,
.leaflet-control.legend::after {
  content: '';
  display: block;
  position: sticky;
  left: 0;
  right: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1;
}
.leaflet-control.legend::before {
  top: -6px;
  margin: -6px -8px 0;
  background: linear-gradient(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}
.leaflet-control.legend::after {
  bottom: -6px;
  margin: 0 -8px -6px;
  background: linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.97) 70%);
  color: #555;
  font-size: 14px;
  line-height: 30px;
  text-align: center;
}
.leaflet-control.legend.scroll-up::before {
  height: 22px;
  margin-bottom: -22px;
  opacity: 1;
}
.leaflet-control.legend.scroll-more::after {
  content: '\25BE';   /*down arrow: more below*/
  height: 30px;
  margin-top: -30px;
  opacity: 1;
}

/*Story popups with several dated lines (Survilla.js)*/
.story-popup-long .leaflet-popup-content .story-line {
  margin-top: 4px;
}
.story-popup-long .leaflet-popup-content .story-line b {
  color: #1d4f91;
  font-weight: 500;
}
/*Visits: trips off the route*/
.leaflet-tooltip.story-label.story-visit-label {
  font-size: 12px;
  font-weight: normal;
}
