/*
 * Water Levels page.
 *
 * Loaded only by /water-levels/. Everything here is scoped under .wl so it
 * cannot reach the other 35 pages. Colours are the theme's own palette, taken
 * from theme.min.css rather than reinvented:
 *   #0078b1 primary   #004465 dark   #00bec3 teal   #ffdd96 cream   #f6f6f6 gray
 */

.wl {
  --wl-primary: #0078b1;
  --wl-dark: #004465;
  --wl-teal: #00bec3;
  --wl-cream: #ffdd96;
  --wl-gray: #f6f6f6;
  --wl-line: #eee;
  --wl-muted: #666;

  display: block;
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 20px 64px;
}

.wl-intro {
  margin: 0 auto;
  max-width: 1180px;
  padding: 48px 20px 8px;
}

.wl-intro h1 {
  color: var(--wl-dark);
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.06;
  margin: 0 0 18px;
}

.wl-intro p {
  color: #444;
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
  max-width: 760px;
}

/* ------------------------------------------------------------------- cards */

.wl-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 8px 8px 24px rgba(0, 85, 126, 0.07);
  margin-top: 28px;
  padding: 34px;
}

.wl-card--dark {
  background: var(--wl-dark);
  box-shadow: 8px 8px 24px rgba(0, 68, 101, 0.22);
  color: #fff;
}

.wl-card__title {
  color: var(--wl-dark);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.wl-card--dark .wl-card__title {
  color: #fff;
}

.wl-card__eyebrow {
  color: var(--wl-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.wl-card--dark .wl-card__eyebrow {
  color: var(--wl-cream);
}

.wl-card__head {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

/* ------------------------------------------------------------------ tables */

/* Wide tables scroll inside their own box so the page body never does. */
.wl-scroll {
  overflow-x: auto;
}

.wl-table {
  border-collapse: collapse;
  min-width: 520px;
  width: 100%;
}

.wl-table th,
.wl-table td {
  padding: 13px 8px;
  text-align: left;
}

.wl-table thead th {
  border-bottom: 2px solid var(--wl-line);
  color: var(--wl-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.wl-table tbody th,
.wl-table tbody td {
  border-bottom: 1px solid #f0f0f0;
}

.wl-table .wl-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.wl-table .wl-name {
  color: #333;
  font-weight: 600;
}

.wl-table .wl-strong {
  color: var(--wl-dark);
  font-weight: 700;
}

.wl-table .wl-dim {
  color: #999;
}

.wl-table .wl-flow {
  font-size: 17px;
}

.wl-pill {
  background: var(--wl-cream);
  border-radius: 50px;
  color: var(--wl-dark);
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  white-space: nowrap;
}

.wl-pill.is-within {
  background: rgba(0, 190, 195, 0.16);
}

/* ---------------------------------------------------------------- controls */

.wl-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.wl-tabs {
  background: var(--wl-gray);
  border-radius: 50px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
}

.wl-tabs--range {
  margin-top: 26px;
}

.wl-tab {
  background: transparent;
  border: none;
  border-radius: 50px;
  color: #5d6f70;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 20px;
  transition: background 0.2s, color 0.2s;
}

.wl-tab:hover {
  color: var(--wl-primary);
}

.wl-tab.is-active {
  background: var(--wl-dark);
  color: #fff;
}

.wl-select select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--wl-gray);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23004465' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: right 16px center;
  background-repeat: no-repeat;
  border: none;
  border-radius: 50px;
  color: var(--wl-dark);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 38px 9px 20px;
}

.wl-sync {
  color: #9aa3a7;
  font-size: 12.5px;
  margin-left: auto;
}

.wl-refresh {
  background: none;
  border: 1px solid #cfd8dc;
  border-radius: 50px;
  color: var(--wl-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  transition: border-color 0.2s, color 0.2s;
}

.wl-refresh:hover {
  border-color: var(--wl-primary);
  color: var(--wl-primary);
}

/* ------------------------------------------------------------------- chart */

.wl-chart svg {
  display: block;
  height: auto;
  width: 100%;
}

.wl-legend {
  color: var(--wl-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  margin: 0;
}

.wl-legend__item {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.wl-swatch {
  background: var(--wl-primary);
  border-radius: 2px;
  height: 3px;
  width: 22px;
}

.wl-swatch--target {
  background: none;
  border-top: 3px dashed var(--wl-cream);
  height: 0;
}

.wl-status {
  background: #fafcfc;
  border: 1px dashed #d3dde0;
  border-radius: 12px;
  color: #6a767b;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  padding: 34px 28px;
  text-align: center;
}

.wl-note {
  color: #999;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 16px 0 0;
}

.wl-note--light {
  color: #bfe3ec;
  font-size: 14px;
  margin-top: 18px;
}

/* --------------------------------------------------------- releases + docs */

.wl-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr 1fr;
}

.wl-releases {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wl-releases li {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  font-size: 17px;
  font-weight: 600;
  gap: 12px;
  padding: 11px 0;
}

.wl-releases li::before {
  background: var(--wl-cream);
  border-radius: 50%;
  content: "";
  flex: none;
  height: 8px;
  width: 8px;
}

.wl-docs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wl-docs a {
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  display: flex;
  font-size: 15px;
  font-weight: 600;
  gap: 12px;
  padding: 12px 4px;
  text-decoration: none;
}

.wl-docs a:hover {
  color: var(--wl-primary);
}

.wl-docs__tag {
  align-items: center;
  background: rgba(0, 190, 195, 0.14);
  border-radius: 7px;
  color: var(--wl-dark);
  display: flex;
  flex: none;
  font-size: 10px;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.wl-disclaimer {
  color: #888;
  font-size: 13px;
  line-height: 1.6;
  margin: 30px auto 0;
  max-width: 900px;
  text-align: center;
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 860px) {
  .wl-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .wl-card {
    padding: 24px 18px;
  }

  .wl-sync {
    margin-left: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wl-tab,
  .wl-refresh {
    transition: none;
  }
}
