:root {
  --bg: black;
  --fg: #AAA;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #575757;
    --link-fg: #cadc71a8;
    --secondary: #575757;
    --breadcrumbs-fg: white;
    --breadcrumbs-link-fg: #ceceb3;
    --selected-row: #cadc7138;
  }
}

* {
  box-sizing: border-box;
  color: var(--fg);
}

html, body {
  height: 100%;
  background-color: var(--bg);
}

body {
  margin: 0;
  font-family: sans-serif;
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto 1.1em;
  height: 100%;
}

#mapid {
  height: 80%;
}

#timeline {
  width: 100%;
  height: 20%;
  background-color: var(--bg);
}

#images {
  height: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  grid-template-rows: repeat(8, 5vw);
  padding-left: 10px;
  padding-top: 5px;
  padding-bottom: 5px;
  grid-gap: 5px;
  grid-auto-flow: dense;
  align-items: start;
  background-color: var(--bg);
  overflow-y: scroll;
}

#images > .imwrap {
  width: 100%;
}

.imwrap img {
  max-width: 100%;
  max-height: 100%;
  /* https://developer.mozilla.org/en-US/docs/Web/CSS/Replaced_element */
  object-fit: cover;
  object-position: center center;
}

.imwrap > p {
  margin: 0;
  font-size: 10px;
}

.js-plotly-plot,
.plot-container {
  height: 100%;
}

img.leaflet-marker-icon {
  border-radius: 18%;
}

#footer {
  grid-column: span 3;
}

#footer > pre {
  margin: 0;
  font-size: 10px;
}

/*tweak leaflet popup*/
.leaflet-popup-content-wrapper {
  border-radius: 0;
  padding: 0;
  color: var(--fg);
  background-color: var(--bg);
}

.leaflet-popup-content {
  margin: 0;
}

/*
hide popup arrow
https://stackoverflow.com/a/35353598/241240
*/
.leaflet-popup-tip {
  width: 0;
  height: 0;
}
