@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/public/Quicksand-Light.ttf") format("truetype");
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/public/Quicksand-Regular.ttf") format("truetype");
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/public/Quicksand-Medium.ttf") format("truetype");
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/public/Quicksand-SemiBold.ttf") format("truetype");
}

@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/public/Quicksand-Bold.ttf") format("truetype");
}

:root {
  --body-bg: #fff;
  --text-default: #333;
  --text-muted: #666;
  --new-day-border-color: #bbb;
  --alternate-cell-bg-color: #f0f0f0;
  --border-color-muted: #0003;
  --header-content-height: 2rem;
  --highlight-color: var(--temp-low-color);
  --rain-1-color: #f3f3f3;
  --rain-2-color: #5ec5ed;
  --rain-3-color: #009ee0;
  --rain-4-color: #006ab3;
  --chart-color: var(--temp-low-color);
  --temp-low-color: #5d9eff;
  --temp-high-color: #ff7a87;
  --gust-color: #b22;
}

@media (prefers-color-scheme: dark) {
  :root {
    --body-bg: #333;
    --text-default: #eee;
    --text-muted: #bbb;
    --new-day-border-color: #666;
    --alternate-cell-bg-color: #444;
    --border-color-muted: #fff3;
    --rain-1-color: #444;
    --rain-2-color: #339dc8;
    --rain-3-color: #007eb3;
    --rain-4-color: #005b99;
  }
}

* {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  vertical-align: baseline;
  background: transparent;
}

html,
body {
  max-width: 100vw;
  background: var(--body-bg);
  color: var(--text-default);
  font-family: "Quicksand", sans-serif;
}

#favorites {
  list-style-type: none;
  padding-top: .25rem;
}

#favorites li {
  display: inline;
}

#favorites a {
  color: inherit;
  text-decoration: none;
  margin-left: 1rem;
}

header {
  padding: 1rem;
  display: flex;
  align-items: center;
  position: relative;
}

h1 {
  font-size: var(--header-content-height);
  line-height: var(--header-content-height);
}

#fav {
  vertical-align: bottom;
  cursor: pointer;
}

#search-btn {
  height: var(--header-content-height);
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
  margin-right: 0.5rem;
}

#search-btn svg {
  height: 100%;
}

#search {
  display: flex;
  flex-grow: 1;
  position: relative;
}

#search input {
  color: inherit;
  font-size: 1rem;
  height: var(--header-content-height);
  flex-grow: 1;
  padding: 0 .5rem;
}

.hidden {
  display: none !important;
}

.wrap {
  white-space: normal;
}

.nowrap {
  white-space: nowrap;
}

#search ul {
  position: absolute;
  top: 100%;
  width: 100%;
  list-style-type: none;
  background: var(--body-bg);
  z-index: 1;
}

#search input,
#search ul {
  border: 1px solid var(--border-color-muted);
  border-radius: .25rem;
  box-sizing: border-box;
}

#search li {
  height: var(--header-content-height);
  display: flex;
  align-items: center;
  padding: 0 .5rem;
}

#search ul a {
  display: flex;
  text-decoration: none;
  color: var(--text-default);
}

#search ul .selected {
  background: var(--highlight-color);
}

#search ul .selected a {
  color: #fff;
}

svg {
  height: 1em;
  display: inline-block;
  vertical-align: baseline;
}

.forecast {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.forecast img {
  width: 50px;
}

.now {
  width: 20rem;
  margin: 1rem auto;
}

.now .icon {
  width: 8rem;
}

.now .temp {
  font-size: 3rem;
}

.now .wind {
  font-size: 1rem;
}

sub {
  vertical-align: sub;
}

.air-quality {
  display: flex;
  list-style-type: none;
  justify-content: space-evenly;
  font-weight: 600;
  padding: .5rem 0;
  flex-wrap: wrap;
}

.air-quality li {
  border-radius: 1rem;
  padding: 0 .5rem;
  margin: .5rem;
}

.quality-0 {
  background-color: #dddddd;
  color: var(--body-bg);
}

.quality-1 {
  background-color: #50f0e6;
  color: var(--body-bg);
}

.quality-2 {
  background-color: #50ccaa;
  color: var(--body-bg);
}

.quality-3 {
  background-color: #f0e641;
  color: var(--body-bg);
}

.quality-4 {
  background-color: #ff5050;
}

.quality-5 {
  background-color: #960032;
}

.quality-6 {
  background-color: #872181;
}

.quality-7,
.quality-8 {
  background-color: #888888;
}

.wind {
  display: flex;
  align-items: center;
  font-size: .8rem;
  color: var(--text-muted);
}

.speed .base,
.speed .gust {
  padding: 0 .2em;
}

.now .speed div,
.day .speed div {
  display: inline;
}

.gust {
  background-color: var(--gust-color);
  color: #fff;
  border-radius: .2em;
  font-weight: bold;
  padding: 0 .2em;
}

.wind .direction {
  white-space: nowrap;
}

.wind svg {
  margin-bottom: -2px;
}

.confidence {
  position: absolute;
  color: var(--text-muted);
}

.confidence svg {
  height: 65px;
  margin-top: -7.5px;
}

.rain .time {
  display: flex;
  justify-content: space-between;
  background: var(--rain-1-color);
  font-weight: 500;
}

.rain .time span {
  margin: 0 .5rem;
  font-size: 1rem;
  color: var(--text-default);
}

.rain ul {
  display: flex;
  list-style-type: none;
}

.rain li {
  flex: 1;
  text-align: center;
  padding: 1rem 0;
}

.rain .icon {
  height: 3rem;
  width: 100%;
}

.rain-1 {
  background-color: var(--rain-1-color);
}

.rain-2 {
  background-color: var(--rain-2-color);
}

.rain-3 {
  background-color: var(--rain-3-color);
}

.rain-4 {
  background-color: var(--rain-4-color);
}

.hours-container {
  overflow-x: auto;
  max-width: 100%;
}

.hours {
  position: relative;
}

.hours table {
  border-collapse: collapse;
  border-top: 1px solid var(--border-color-muted);
}

.hours th {
  text-align: left;
  font-weight: normal;
  padding-left: .25em;
  background-color: var(--alternate-cell-bg-color);
}

.hours th:not(:first-child) {
  border-left: 2px solid var(--new-day-border-color);
}

.hours td {
  padding: .5rem;
}

.hours td:nth-child(2n+1),
.periods>div:nth-child(2n+1) {
  background-color: var(--alternate-cell-bg-color);
}

.hours .new-day {
  border-left: 2px solid var(--new-day-border-color);
}

.chart {
  width: 100%;
  height: 5rem;
  position: absolute;
  bottom: 0;
  left: 0;
  pointer-events: none;
  color: var(--chart-color);
  opacity: .5;
  transform: scaleY(-1);
}

.time {
  margin: -.5rem 0 0 -.5rem;
  font-size: .85em;
  color: var(--text-muted);
  padding-left: .25em;
}

.day {
  display: flex;
  align-items: stretch;
}

.day:first-child {
  border-top: 1px solid var(--border-color-muted);
}

.day:not(:last-child) {
  border-bottom: 1px solid var(--border-color-muted);
}

.day-label {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  min-width: 4rem;
  padding: 0 .5rem;
  text-transform: uppercase;
}

.day-label .date {
  font-weight: 500;
}

.low-high {
  font-size: 1.25rem;
}

.low {
  color: var(--temp-low-color);
  font-weight: bold;
}

.high {
  color: var(--temp-high-color);
  font-weight: bold;
}

.sun {
  font-size: .9rem;
}

.periods {
  display: flex;
  width: 100%;
  align-items: stretch;
  border-left: 1px solid var(--border-color-muted);
  overflow-x: auto;
}

.period {
  flex-grow: 1;
  flex-basis: 0;
  padding: .5rem;
}
