/* The Water Rights page (src/rights/wr-twin.js). Cards, tables, pills, tabs, pagers, the search and the pop-up are the shared .wqx-*
   classes in wq-twin.css, and the county map is the shared .inf-co / .inf-s* in infra-twin.css; only what this page adds is here.
   Colour comes from tokens only. No new keyframes. No thick coloured edges. */

/* The page is landing content: it is not shown while a sub-page of the hub is open, and the sub-page twin only on its own sub-page. */
#cat-rights:has(.hydro-sub:not([hidden])) #wr-twin { display: none; }
#cat-rights:has(.hydro-sub:not([hidden])) #wr-tools { display: none; }

/* The hub's launcher cards repeat the tab strip above the page and pushed the search below the first screen. The four sub-pages stay one click away in the tabs and in "Other pages in this section". tu-atlas.css forces card grids to display:grid !important, so hiding needs the same weight. */
#cat-rights .hub-hero-panel #rights-cards { display: none !important; }

.wr-tools { margin: 24px 0 0; }
.wr-tools > summary { cursor: pointer; padding: 12px 16px; border: 1px solid var(--guide-color-border-strong); border-radius: 12px; background: var(--guide-color-paper); font-size: var(--guide-fs-md); font-weight: 600; }
.wr-tools[open] > summary { margin-bottom: 14px; }

.wr-fullsearch { margin: 8px 0 0; font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); }
.wr-second { margin: 10px 0 0; max-width: 62em; font-size: var(--guide-fs-md); line-height: 1.5; }
.wr-asof { margin: 14px 0 0; max-width: 62em; padding: 10px 12px; border: 1px solid var(--guide-color-border-strong); border-radius: 10px; background: var(--guide-color-bg-1); font-size: var(--guide-fs-sm); line-height: 1.5; }
.wr-source { margin: 8px 0 0; max-width: 62em; font-size: var(--guide-fs-sm); color: var(--guide-color-ink-muted); }
.wr-lede { margin: 0 0 12px; max-width: 62em; font-size: var(--guide-fs-sm); line-height: 1.5; color: var(--guide-color-ink-soft); }
.wr-h4 { margin: 18px 0 8px; font-size: var(--guide-fs-sm); font-weight: 600; color: var(--guide-color-ink-soft); }
.wqx-card-head + .wr-h4 { margin-top: 0; }
.wr-n { white-space: nowrap; font-variant-numeric: tabular-nums; }
.wr-table small { display: block; margin-top: 2px; font-size: var(--guide-fs-sm); color: var(--guide-color-ink-muted); white-space: normal; }
.wr .wqx-table tr.is-on td { background: var(--guide-color-bg-2); }
.wr .wqx-table .wqx-link { text-align: left; }
.wr-differ { color: var(--guide-color-ink-soft); }
.wr-key { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border-radius: 3px; border: 1px solid var(--guide-color-border-strong); vertical-align: -2px; flex: none; }
.wr-kind { background: var(--guide-color-lake); }

/* who are you: four plain doors, and the one first step for the one chosen */
.wr-doors { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.wr-door { width: 100%; display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--guide-color-border-strong); background: var(--guide-color-paper); color: var(--guide-color-ink); cursor: pointer; font: inherit; }
.wr-door:hover, .wr-door:focus-visible { background: var(--guide-color-bg-2); }
.wr-door.is-on { border-color: var(--guide-color-ink); box-shadow: inset 0 0 0 1px var(--guide-color-ink); background: var(--guide-color-bg-1); }
.wr-door svg, .wr-door i { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--guide-color-lake); }
.wr-door b { display: block; font-size: var(--guide-fs-md); line-height: 1.3; }
.wr-door small { display: block; margin-top: 2px; font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); }
.wr-first { margin: 12px 0 0; max-width: 62em; font-size: var(--guide-fs-md); line-height: 1.5; }

/* what is changing */
.wr-changes { list-style: none; margin: 0; padding: 0; display: grid; }
.wr-changes li { padding: 11px 0; border-bottom: 1px solid var(--guide-color-border-subtle); font-size: var(--guide-fs-sm); line-height: 1.55; max-width: 62em; }
.wr-changes li:last-child { border-bottom: 0; }
.wr-refs { color: var(--guide-color-ink-muted); }

/* one basin, one right */
.wr-basincard { scroll-margin-top: 80px; margin: 16px 0; padding: 14px 16px; border: 1px solid var(--guide-color-border-strong); border-radius: 12px; background: var(--guide-color-bg-1); }
.wr-verdict { margin: 10px 0 14px; max-width: 62em; font-size: var(--guide-fs-md); line-height: 1.5; }
.wr-dl { display: grid; gap: 0; margin: 0 0 14px; border-top: 1px solid var(--guide-color-border-subtle); }
.wr-dl > div { display: grid; grid-template-columns: minmax(150px, 30%) 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--guide-color-border-subtle); }
.wr-dl dt { font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); }
.wr-dl dd { margin: 0; font-size: var(--guide-fs-sm); line-height: 1.5; }
.wr-notes { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: var(--guide-fs-sm); line-height: 1.55; max-width: 62em; }
.wr-rule { margin: 10px 0 0; max-width: 62em; font-size: var(--guide-fs-sm); line-height: 1.5; color: var(--guide-color-ink-soft); }
#wrt-record { scroll-margin-top: 80px; }
.wr-matches { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: var(--guide-fs-sm); }

/* list controls */
.wr-ctl { display: flex; flex-wrap: wrap; gap: 12px 16px; margin: 0 0 12px; align-items: flex-end; }
.wr-sort { display: grid; gap: 4px; font-size: var(--guide-fs-sm); color: var(--guide-color-ink-soft); }
.wr-sort select, .wr-sort input { min-height: 40px; max-width: 100%; padding: 0 10px; border-radius: 8px; border: 1px solid var(--guide-color-border-strong); background: var(--guide-color-paper); color: var(--guide-color-ink); font: inherit; font-size: var(--guide-fs-sm); }
.wr-sort input { min-width: 240px; }
.wr-sort--inline { grid-auto-flow: column; align-items: center; gap: 8px; }

/* decade chart: ordered kinds, one hue in two steps */
.wr-seg--claim { fill: var(--guide-color-lake); background: var(--guide-color-lake); }
.wr-seg--permit { fill: color-mix(in srgb, var(--guide-color-lake) 34%, var(--guide-color-paper)); background: color-mix(in srgb, var(--guide-color-lake) 34%, var(--guide-color-paper)); }
.wr-seg { stroke: var(--guide-color-paper); stroke-width: 1; }
i.wr-seg--claim, i.wr-seg--permit { display: inline-block; width: 14px; height: 14px; margin-right: 6px; border-radius: 3px; border: 1px solid var(--guide-color-border-strong); vertical-align: -2px; }

/* what you can do */
.wr-steps, .wr-list, .wr-offices, .wr-panels { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: var(--guide-fs-sm); line-height: 1.55; max-width: 62em; }
.wr-offices { list-style: none; padding-left: 0; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.wr-offices li { padding: 10px 12px; border: 1px solid var(--guide-color-border-strong); border-radius: 10px; }
.wr-offices li.is-on { background: var(--guide-color-bg-2); border-color: var(--guide-color-ink); }
.wr-offices small, .wr-panels small { display: block; margin-top: 2px; color: var(--guide-color-ink-muted); }
.wr-panels { list-style: none; padding-left: 0; }
.wr .wqx-details { margin-top: 12px; font-size: var(--guide-fs-sm); }
.wr .wqx-details ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }

@media (max-width: 640px) {
  /* a table row becomes a stacked block: the name first, then each figure under its column's name */
  .wr-table, .wr-table tbody, .wr-table tr, .wr-table td { display: block; width: 100%; }
  .wr-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .wr-table tr { padding: 12px 0; border-bottom: 1px solid var(--guide-color-border-subtle); }
  .wr-table td { padding: 3px 0; border: 0; white-space: normal; }
  .wr-table td[data-label]::before { content: attr(data-label) ': '; color: var(--guide-color-ink-muted); font-size: var(--guide-fs-sm); }
  .wr-table td.wr-n { white-space: normal; }
  .wr-table td small { display: inline; margin-left: 6px; }
  .wr-dl > div { grid-template-columns: 1fr; gap: 2px; }
  .wr-ctl { display: grid; grid-template-columns: 1fr; }
  .wr-sort select, .wr-sort input { width: 100%; min-width: 0; }
  .wr-sort--inline { grid-auto-flow: row; }
}

@media print {
  .wr-doors, .wr .wqx-pager, .wr .wqx-tabs, .wr .wr-ctl, .wr-sort--inline, #wrt-finder { display: none !important; }
  .wr-steps li, .wr-offices li, .wr-changes li { break-inside: avoid; }
  .wr-tools { display: none; }
}
