/* global.css — minified and inlined at build time */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

/* River levels page */

.rh-page {
  margin-inline: auto;
  max-width: 960px;
  padding: 1.5rem 1rem;
}

.rh-subtitle {
  color: #6b7280;
  font-size: 0.9rem;
  margin-block: 0.25rem 1.5rem;
}

.rh-current {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-block: 0 1.5rem;
}

.rh-current div {
  min-width: 0;
}

.rh-current dt {
  color: #6b7280;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rh-current dd {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.rh-controls {
  margin-block-end: 1rem;
}

.rh-controls fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.rh-controls legend {
  font-size: 0.875rem;
  font-weight: 600;
  margin-block-end: 0.5rem;
}

.rh-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-end: 0.75rem;
}

.rh-quick button {
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.3rem 0.75rem;
}

.rh-quick button.is-active,
.rh-quick button:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.rh-custom {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rh-custom label {
  font-size: 0.875rem;
}

.rh-custom input[type="date"] {
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.3rem 0.5rem;
}

.rh-custom button {
  background: #1d4ed8;
  border: 1px solid #1d4ed8;
  border-radius: 0.25rem;
  color: #fff;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.3rem 0.75rem;
}

.rh-chart-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  min-height: 10rem;
  overflow: hidden;
}

/* SVG chart */

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

.rh-area {
  fill: #dbeafe;
}

.rh-axis {
  stroke: #9ca3af;
  stroke-width: 1;
}

.rh-axis-label {
  fill: #6b7280;
  font-family: system-ui, sans-serif;
  font-size: 10px;
}

.rh-grid {
  stroke: #f3f4f6;
  stroke-width: 1;
}

.rh-line {
  fill: none;
  stroke: #1d4ed8;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.rh-thresh {
  stroke-dasharray: 4 3;
  stroke-width: 1.5;
}

.rh-thresh--high {
  stroke: #d97706;
}

.rh-thresh--record {
  stroke: #dc2626;
}

.rh-thresh-label {
  font-family: system-ui, sans-serif;
  font-size: 10px;
}

.rh-thresh-label--high {
  fill: #d97706;
}

.rh-thresh-label--record {
  fill: #dc2626;
}

.rh-tick {
  fill: #9ca3af;
  font-family: system-ui, sans-serif;
  font-size: 10px;
}

/* Tooltip */

.rh-bg {
  fill: #1f2937;
  pointer-events: none;
}

.rh-dot {
  fill: #2563eb;
  pointer-events: none;
  stroke: #fff;
  stroke-width: 2;
}

.rh-ttxt {
  fill: #f3f4f6;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  pointer-events: none;
}

.rh-tval {
  fill: #93c5fd;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

.rh-vline {
  pointer-events: none;
  stroke: #6b7280;
  stroke-dasharray: 3 3;
  stroke-width: 1;
}

/* Legend */

.rh-legend {
  display: flex;
  flex-wrap: wrap;
  font-size: 0.875rem;
  gap: 1rem;
  list-style: none;
  margin-block: 1rem 0;
  padding: 0;
}

.rh-legend-item {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.rh-legend-swatch {
  border-radius: 1px;
  display: block;
  height: 3px;
  width: 24px;
}

.rh-legend-swatch--level {
  background: #1d4ed8;
}

.rh-legend-swatch--high {
  background: repeating-linear-gradient(
    to right,
    #d97706 0,
    #d97706 4px,
    transparent 4px,
    transparent 7px
  );
}

.rh-legend-swatch--record {
  background: repeating-linear-gradient(
    to right,
    #dc2626 0,
    #dc2626 4px,
    transparent 4px,
    transparent 7px
  );
}

/* Status messages */

.rh-empty,
.rh-error,
.rh-loading {
  color: #6b7280;
  padding: 3rem;
  text-align: center;
}

.rh-error {
  color: #dc2626;
}

/* Attribution */

.rh-attribution {
  color: #9ca3af;
  font-size: 0.8rem;
  margin-block: 1rem 0;
}

@media (max-width: 480px) {
  .rh-current dd {
    font-size: 1.25rem;
  }
}
