/* River route — /river/, /river/<town>-missouri-river-level/, and the
   /weather/ up/down strip. Broadsheet: white ground, black ink, Times,
   hairline rules; weight carries emphasis, never a fill or a card. */

.rrg-page,
.rrg-strip {
  --rrg-ink: var(--wp--preset--color--contrast, #000);
  --rrg-grey: var(--wp--preset--color--muted, #555);
  --rrg-hair: var(--wp--preset--color--border, #bbb);
  color: var(--rrg-ink);
  font-family: var(--wp--preset--font-family--serif, "Times New Roman", Times, serif);
}
.rrg-page { max-width: 760px; margin-inline: auto; }
.rrg-page--wide { max-width: 1100px; }
.rrg-page a,
.rrg-strip a { color: var(--rrg-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rrg-hair); }
.rrg-page a:hover,
.rrg-strip a:hover { text-decoration-color: var(--rrg-ink); }

.rrg-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.rrg-crumbs {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rrg-grey);
  text-align: center;
}
.rrg-crumbs a { color: var(--rrg-grey) !important; text-decoration: none !important; }
.rrg-head { margin-bottom: 1.25rem; }
.rrg-head .rt-flag { margin-bottom: 0; }

.rrg-note {
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--rrg-grey);
}

.rrg-arrow { font-size: 0.7em; vertical-align: 0.1em; }
.rrg-alert { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9em; }

/* ---------- the list ------------------------------------------------------ */
.rrg-route__dir {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0.35rem 0;
  border-top: 1px solid var(--rrg-ink);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.rrg-route__dir--end { border-top: 0; border-bottom: 1px solid var(--rrg-ink); }
.rrg-route__dir a { text-decoration: none !important; }

.rrg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.35;
}
.rrg-table thead th {
  padding: 0.4rem 0.5rem;
  border-top: 1px solid var(--rrg-ink);
  border-bottom: 1px solid var(--rrg-ink);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
.rrg-table tbody th,
.rrg-table tbody td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--rrg-hair);
  text-align: left;
  vertical-align: baseline;
}
.rrg-table tbody th { font-weight: 400; }
.rrg-table .rrg-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rrg-table .rrg-stage { font-weight: 700; }
.rrg-table td[data-label="Observed"] { font-size: 0.85rem; color: var(--rrg-grey); white-space: nowrap; }
.rrg-table td[data-label="Trend"] { font-size: 0.9rem; }
.rrg-st { color: var(--rrg-grey); }
.rrg-near th a { font-weight: 700; }
.rrg-here td {
  padding: 0.6rem 0.5rem;
  border-top: 2px solid var(--rrg-ink);
  border-bottom: 2px solid var(--rrg-ink);
  font-style: italic;
  text-align: center;
}
.rrg-table tr:has(+ .rrg-here) > * { border-bottom: 0; }

@media (max-width: 700px) {
  .rrg-table thead { display: none; }
  .rrg-table, .rrg-table tbody { display: block; }
  .rrg-table tr.rrg-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.75rem;
    row-gap: 0.1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--rrg-hair);
  }
  .rrg-table tr.rrg-row > * { display: block; padding: 0; border: 0; min-width: 0; }
  .rrg-table tr.rrg-row > th { grid-column: 1; grid-row: 1; }
  .rrg-table tr.rrg-row > .rrg-stage { grid-column: 2; grid-row: 1; }
  .rrg-table tr.rrg-row > td[data-label="Category"] { grid-column: 1; grid-row: 2; font-size: 0.9rem; }
  .rrg-table tr.rrg-row > td[data-label="Flood stage"] { grid-column: 2; grid-row: 2; font-size: 0.85rem; color: var(--rrg-grey); }
  .rrg-table tr.rrg-row > td[data-label="Flood stage"]::before { content: "Flood "; }
  .rrg-table tr.rrg-row > td[data-label="Trend"] { grid-column: 1; grid-row: 3; font-size: 0.85rem; }
  .rrg-table tr.rrg-row > td[data-label="Observed"] { grid-column: 2; grid-row: 3; text-align: right; }
  .rrg-table tr.rrg-here { display: block; }
  .rrg-table tr.rrg-here td { display: block; }
  .rrg-table tr.rrg-row:has(+ .rrg-here) { border-bottom: 0; }
}

/* ---------- one gauge ----------------------------------------------------- */
.rrg-gp { text-align: center; }
.rrg-gp__big {
  margin: 0.25rem 0 0;
  font-size: clamp(2.6rem, 9vw, 3.6rem);
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.rrg-gp__sub { margin: 0.4rem 0 0; font-size: 1.05rem; }
.rrg-gp__obs { margin: 0.3rem 0 0; font-size: 0.85rem; color: var(--rrg-grey); }
.rrg-gp__dl {
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--rrg-ink);
  text-align: left;
}
.rrg-gp__dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rrg-hair);
}
.rrg-gp__dl dt {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  align-self: center;
}
.rrg-gp__dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.rrg-gp__about { margin: 1.25rem 0 0; font-size: 1.05rem; line-height: 1.55; }

.rrg-nb { margin-top: 1.25rem; border-top: 1px solid var(--rrg-ink); }
.rrg-nb__g {
  margin: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rrg-hair);
  line-height: 1.45;
}
.rrg-nb__lbl {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rrg-grey);
}
.rrg-nb__v { white-space: nowrap; color: var(--rrg-grey); }

/* ---------- the /weather/ strip ------------------------------------------ */
.rrg-strip { margin-top: 1rem; }
.rrg-strip__h {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.2rem 1rem;
  margin: 0;
  padding: 0.35rem 0;
  border-top: 1px solid var(--rrg-ink);
  border-bottom: 1px solid var(--rrg-hair);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.rrg-strip__h a { text-decoration: none !important; }
.rrg-strip__row {
  display: grid;
  grid-template-columns: auto repeat(5, minmax(0, 1fr)) auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rrg-strip__row > li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.55rem 0.6rem;
  border-left: 1px solid var(--rrg-hair);
  text-align: center;
}
.rrg-strip__row > li:first-child { border-left: 0; }
.rrg-strip__lbl {
  justify-content: center;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rrg-grey);
  white-space: nowrap;
}
.rrg-strip__town { font-weight: 700; }
.rrg-strip__stage { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rrg-strip__meta { font-size: 0.85rem; }
.rrg-strip__obs { font-size: 0.75rem; color: var(--rrg-grey); }
.rrg-strip__here {
  justify-content: center;
  border-left: 2px solid var(--rrg-ink) !important;
  border-right: 2px solid var(--rrg-ink);
  font-style: italic;
}
.rrg-strip__here + li { border-left: 0; }
.rrg-av { display: none; }

@media (max-width: 900px) {
  .rrg-strip__row { grid-template-columns: minmax(0, 1fr); }
  .rrg-strip__row > li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.75rem;
    padding: 0.5rem 0;
    border-left: 0;
    border-bottom: 1px solid var(--rrg-hair);
    text-align: left;
  }
  .rrg-strip__row > li > .rrg-strip__stage { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .rrg-strip__lbl { display: block !important; padding: 0.35rem 0 !important; }
  .rrg-ah { display: none; }
  .rrg-av { display: inline; }
  .rrg-strip__here {
    display: block !important;
    border-left: 0 !important;
    border-right: 0;
    border-top: 2px solid var(--rrg-ink);
    border-bottom: 2px solid var(--rrg-ink) !important;
    text-align: center !important;
  }
  .rrg-strip__here > span { display: inline; }
  .rrg-strip__here > span + span::before { content: " · "; }
}
