/* NOAA Local Weather Graph. Plain, system fonts, in step with the homepage. */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1rem 1rem 3rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #222;
  background: #fff;
  line-height: 1.5;
}

a { color: #222; text-decoration-color: #aaa; text-underline-offset: 2px; }
a:hover { text-decoration-color: #222; }

.Weather__home { display: inline-block; font-size: 0.85rem; color: #666; text-decoration: none; }
.Weather__home:hover { color: #222; }

.Weather { max-width: 840px; margin: 1.5rem auto 0; }

.Weather h1 { font-size: 1.4rem; font-weight: 600; margin: 0 0 0.25rem; }
.Weather__intro { color: #666; margin: 0 0 1.25rem; }

.Weather__query {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.Weather__option { display: flex; align-items: center; gap: 0.75rem; }
.Weather__option > label, .Weather__option > span { flex: 0 0 6.5rem; font-weight: 500; }
.Weather__option input { flex: 1 1 auto; min-width: 0; }

.Weather__query input[type="text"],
.Weather__query input[type="date"] {
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming on focus */
  padding: 0.35rem 0.5rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  color: #222;
}

.Weather__query button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #f6f6f6;
  color: #222;
  cursor: pointer;
}
.Weather__query button:hover { background: #eee; }

.Weather__options-title { justify-content: space-between; }
.Weather__locate-row { margin-top: -0.35rem; }
.Weather__query .Weather__locate { align-self: flex-start; padding: 0; border: 0; background: none; color: #666; font-size: 0.85rem; text-decoration: underline; text-decoration-color: #bbb; text-underline-offset: 2px; }
.Weather__query .Weather__locate:hover { background: none; color: #222; }
.Weather__options-title > span { flex: 1 1 auto; }

.Weather__query-options { border-top: 1px solid #eee; padding-top: 0.5rem; }
.Weather__select { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; font-size: 0.9rem; }

.Weather__series {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0 0.75rem;
  max-height: 22rem;
  overflow-y: auto;
  font-size: 0.9rem;
}
.Weather__series-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0; cursor: pointer; }
.Weather__series-item input { width: 1.05rem; height: 1.05rem; margin: 0; }

.Weather__query .Weather__submit {
  margin-top: 0.25rem;
  padding: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  background: #222;
  border-color: #222;
  color: #fff;
}
.Weather__query .Weather__submit:hover { background: #444; }

.Weather__loading { color: #666; margin: 1rem 0; }

.Weather__result { margin-top: 1.5rem; }
.Weather__result-title { font-size: 1rem; font-weight: 600; margin: 0 0 0.5rem; }

/* The NWS graph is an 800x600 PNG with small type. Shrunk to a phone's width the
   labels get too small to read, so below ~640px it keeps a readable width and scrolls. */
.Weather__result-scroll { max-width: 802px; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #eee; }
.Weather__result-img { display: block; width: 100%; max-width: 800px; min-width: 640px; height: auto; }

.Weather__note { font-size: 0.8rem; color: #888; margin: 0.4rem 0 0; }
.Weather__note a { color: #888; }
.Weather__scroll-hint { display: none; }

@media (max-width: 660px) {
  .Weather__scroll-hint { display: inline; }
}

@media (max-width: 500px) {
  body { padding: 0.75rem 0.75rem 2rem; }
  .Weather { margin-top: 1rem; }
  .Weather__query { padding: 0.75rem; }
  .Weather__option:not(.Weather__options-title) { flex-direction: column; align-items: stretch; gap: 0.2rem; }
  .Weather__option > label { flex: none; }
  .Weather__locate-row > span { display: none; }
  .Weather__locate-row { margin-top: -0.2rem; }
}
