/* TODO: base font size of 1rem for all input elements instead of user agent stylesheet for input and button etc. */

.home article.search>header {
  max-width: calc(100 * var(--unit));
  width: 100%;
  padding: calc(2 * var(--unit)) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: white;
  margin: unset auto;
  text-align: center;
}

.home h1 {
  font-size: 1rem;
  font-weight: 400;
  text-align: center;
  color: var(--light-blue);
}

.home h1 em {
  font-style: normal;
  color: var(--gold-yellow);
}

.home {
  justify-content: center;
}

.home main {
  flex: 1;
}

@media screen and (min-width: 1000px) {

  .home>header {
    position: static;
    margin-top: calc(3 * var(--unit));
    background-color: transparent;
  }

  .home h1 {
    font-size: 1rem;
  }

  .home main {
    flex: 0;
    margin-bottom: calc(100px + (6 * var(--unit)));
    margin-top: 100px;
  }
}

article.search {
  position: relative;
  background-color: white;
  width: 100%;
  min-height: 100vh;
  padding: var(--unit) 0 calc(var(--unit) + 100px) 0;
  display: flex;
  flex-direction: column;
  gap: var(--unit);
  align-items: flex-start;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.5s;
  top: 0;
}

article.search h2 {
  text-align: center;
  width: 100%;
  font-size: 2rem;
  font-weight: 300;
  color: var(--blue);
}

article.search.active {
  opacity: 1;
}

article.search .level-units {
  display: grid;
  grid-template-columns: repeat(2, 5rem);
  border: solid 0.1px var(--light-blue);
  border-radius: calc(0.5 * var(--unit));
  overflow: hidden;
  margin: 0 var(--unit);
}

article.search .level-units label:first-child {
  border-radius: 2px 0 0 2px;
  overflow: hidden;
}

article.search .level-units input+span {
  display: block;
  text-align: center;
  padding: 0 var(--unit);
  transition: font-weight 0.5s;
  line-height: calc(4 * var(--unit));
  color: var(--light-blue);
}

article.search .level-units :checked+span {
  background-color: var(--light-blue);
  color: var(--white);
  font-weight: bold;
}

article.search .level-units input {
  display: none;
}

article.search ol {
  padding: 0;
  list-style: none;
  margin-bottom: 0;
}

article.search>h2 {
  margin-top: 0;
}

article.search form.search {
  position: relative;
  display: flex;
  width: 100%;
  padding: 0 var(--unit);
  box-sizing: border-box;
}

article.search form.search.API-loading-delay aside.loading {
  display: flex;
}

article.search form.search aside.loading {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.5);
  align-items: center;
  justify-content: center;
}

article.search input[type="search"] {
  min-height: calc(4 * var(--unit));
  padding: 1px var(--unit);
  box-sizing: border-box;
  line-height: calc(4 * var(--unit));
  margin-right: -5px;
  flex: 1;
  border: solid 0.1px var(--light-blue);
  border-radius: 2px;
}

article.search .results {
  max-width: 100%;
  width: 100%;
}

article.search .no-results {
  display: none;
  padding: var(--unit);
}

article.search.no-results .no-results {
  display: initial;
}

article.search.no-results .no-results p {
  color: var(--grey);
}


article.search .results figure {
  margin: 0;
}

article.search .results form button {
  background-color: var(--white);
  border: solid 1px var(--light-blue);
  color: var(--light-blue);
  min-width: auto;
  display: none;
}

article.search .results form button::after {
  content: " ";
  border-top: solid 1px var(--light-blue);
  border-right: solid 1px var(--light-blue);
  width: var(--unit);
  display: inline-block;
  height: var(--unit);
  transform: rotate(45deg);
}

article.search details.country {
  padding: var(--unit);
  margin-top: var(--unit);
  overflow: hidden;
}

article.search details.country>summary {
  padding: var(--unit);
  margin: calc(-1 * var(--unit));
  background-color: var(--light-grey);
}

article.search details.country>summary span::before {
  content: " ";
  display: inline-block;
  width: 33px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  margin-right: 1rem;
  margin-left: 1rem;
  vertical-align: middle;
}

article.search details.country[data-country="england"]>summary span::before {
  background-image: url(https://flagcdn.com/h20/gb-eng.png);
  border: solid 1px var(--light-grey);
}

article.search details.country[data-country="wales"]>summary span::before {
  background-image: url(https://flagcdn.com/h20/gb-wls.png);
}

article.search details.country[data-country="scotland"]>summary span::before {
  background-image: url(https://flagcdn.com/h20/gb-sct.png);
}

article.search details.country[data-country="northern ireland"]>summary span::before {
  background-image: url(https://flagcdn.com/h20/gb-nir.png);
  border: solid 1px var(--light-grey);
}

article.search details.country[data-country="northernireland"]>summary span::before {
  background-image: url(https://flagcdn.com/h20/gb-nir.png);
}

article.search details.country[data-country="ireland"]>summary span::before {
  background-image: url(https://flagcdn.com/h20/ie.png);
}

article.search .river>figure>figcaption {
  font-size: 2rem;
}

article.search .river form {
  display: flex;
  align-items: center;
  gap: var(--unit);
  align-content: flex-end;
  min-height: 2rem;
  margin: var(--unit);
  margin-bottom: 0;
  margin-left: 0;
}

article.search .river form .name {
  flex: 1;
}

article.search .river form::before {
  content: "\F0003";
  display: inline-block;
  font: normal normal normal 24px/1 "Material Design Icons";
}

footer {
  font-size: 0.7rem;
  text-align: center;
  padding: var(--unit);
  background-color: var(--darkblue);
  color: white;
  width: 100%;
  box-sizing: border-box;
}

@media screen and (min-width: 1000px) {
  article.search {
    height: auto;
    width: auto;
    min-height: auto;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    padding: calc(6 * var(--unit));
    min-width: 900px;
  }

  article.search input[type="search"] {
    min-width: calc(30 * var(--unit));
    margin-right: var(--unit);
  }

  article.search details.country {
    margin: var(--unit);
  }

  article.search details.country>summary {
    padding: var(--unit);
  }

  article.search .results form:hover {
    background-color: var(--light-grey);
    box-shadow: calc(-1 * var(--unit)) 0 0 calc(0.5 * var(--unit)) var(--light-grey),
      var(--unit) 0 0 calc(0.5 * var(--unit)) var(--light-grey);
  }

  article.search .results form button {
    display: initial;
  }

  article.search pkt-station {
    margin: calc(2 * var(--unit)) auto;
  }

  footer {
    position: fixed;
    bottom: 0;
    font-size: 1rem;
    z-index: 9999;
  }
}
