:root {
  --primary-colour: #008800;
  --primary-contrast-colour: #fefefe;
  --secondary-colour: #D3D3D3;
  --secondary-contrast-colour: black;
  --adjacent-colour: #006666;
  --opacity: 100%;
  --hover-opacity: 70%;
}

@font-face {
  font-family: "DSEG7 Classic";
  src:  local("DSEG7 Classic"),  local("DSEG7-Classic"), url("../fonts/dseg/DSEG7-Classic-MINI/DSEG7ClassicMini-Regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src:  local(Roboto), url("../fonts/Roboto/Roboto-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  src: local(Roboto Mono), local(Roboto-Mono), url("../fonts/RobotoMono/static/RobotoMono-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

button { all: unset; }

h1, h2 { font-weight: normal; }

a:link, a:visited {
  text-decoration: none;
  color: var(--adjacent-colour);
}

/* Sliding ranges */
input[type=range] {
  -webkit-appearance: none;  /* Override default CSS styles */
  appearance: none;
  background: var(--secondary-colour);
  height: 0.25em;
  margin: 1em 0;
  opacity: var(--opacity); /* Set transparency (for mouse-over effects on hover) */
  outline: none;
  width: 100%;
}

input[type=range]:hover { opacity: var(--hover-opacity); }

/* The slider handle (use -webkit- (Chrome, Opera, Safari, Edge) and -moz- (Firefox) to override default look) */
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; /* Override default look */
  appearance: none;
  width: 2em;
  height: 2em;
  background:  var(--primary-colour);
  border-radius: 50%;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}

input[type=range]::-moz-range-thumb {
  width: 2em;
  height: 2em;
  background:  var(--primary-colour);
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
}

/* Floating buttons */
.btn-slider {
  background-color: var(--primary-colour);
  box-shadow: 0 2px 2px 0 rgb(0 0 0 / 14%), 0 3px 1px -2px rgb(0 0 0 / 12%), 0 1px 5px 0 rgb(0 0 0 / 20%);
  box-sizing: border-box;
  border-radius: 50%;
  color: var(--primary-contrast-colour);
  display: inline-block;
  font-size: 1.25em;
  font-weight: bold;
  height: 2em;
  line-height: 2em;
  opacity: var(--opacity); /* Set transparency (for mouse-over effects on hover) */
  position: relative;
  text-align: center;
  user-select: none;
  vertical-align: center;
  width: 2em;
  /* Allow the slider buttons to be hammered without mobile 300ms click delay kicking in */
  touch-action: manipulation;
}

.btn-slider:hover { opacity: var(--hover-opacity); }

.chevron {
  height: 75%;
  width: 75%;
  fill: var(--primary-contrast-colour);
}

/* Switches */
/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

/* The slider */
.slider {
  position: relative;
  display: inline-block;
  background-color: var(--secondary-colour);
  border-radius: 0.5em;
  height: 0.5em;
  transition: .2s;
  vertical-align: middle;
  -webkit-transition: .2s;
  width: 2.25em;
}

.slider:before {
  background-color: var(--primary-colour);
  border-radius: 50%;
  bottom: 0.375em;
  content: "";
  display: inline-block;
  height: 1.25em;
  position: relative;
  transition: .2s;
  width: 1.25em;
  -webkit-transition: .2s;
}

input:checked + .slider:before {
  -webkit-transform: translateX(1em);
  transform: translateX(1em);
}

.slider:hover { opacity: var(--hover-opacity); }


body {
  font-family: "Roboto", sans-serif;

  /* Make the body take up the length of the page so that the footer can sit at the bottom */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-color: var(--primary-colour);
  color: var(--primary-contrast-colour);
  box-shadow: 0 2px 2px 0 rgb(0 0 0 / 14%), 0 3px 1px -2px rgb(0 0 0 / 12%), 0 1px 5px 0 rgb(0 0 0 / 20%);
}

main {
  font-size: 1.25em;

  /* Make the main contents sit in the centre of the page */
  width: 90%;
  margin-left: auto;
  margin-right: auto;

  /* Allow the main section to take up the length of the page so that the footer can sit at the bottom */
  margin-bottom: auto;
}

@media (width > 43em) {
  main {
    width: 70%;
  }
}

.right {
  margin-left: auto;
}

.slider-controls {
  display: flex;
  align-items: center;
  width: available;
}

.max-width { width: 100%; }

.slider-space { margin-top: 3em; }

.mono { font-family: "Roboto Mono", monospace; }

@media (width > 62em) {
  .large-row {
    display: flex;
    flex-direction: row;
  }
  #prediction-text {
    padding-left: 2em;
    width: 30%;
  }
}

header h1 {
  margin: 0;
  padding: 0.375em 0.375em 0.375em 0.75em;
}

#tandaH1 {
  vertical-align: top;
  font-size: xx-large;
}

#tandaPrediction {
  font-family: "DSEG7 Classic", monospace;
  font-size: xxx-large;
}

#weeklyDistanceSpan { white-space: pre; }

#weeklyPaceRange { direction: rtl; }

footer {
  /* Get the footer to sit at the bottom of the page */
  position: relative;
  bottom: 0;

  background-color: var(--secondary-colour);
  margin-top: 0.75em;
}

.footer-content {
  /* Make the main contents sit in the centre of the page */
  width: 90%;
  margin-left: auto;
  margin-right: auto;

  /* Allow the main section to take up the length of the page so that the footer can sit at the bottom */
  margin-bottom: auto;
}

@media (width > 43em) {
  .footer-content {
    width: 70%;
  }
}

footer h2 { margin-bottom: 0; }
footer ul { margin-top: 0; }

@media not all and (display-mode: browser) {
  #install-prompt {
    display: none;
  }
}
