/* The public site's design system.

   Monochrome is a correctness property, not taste. With colour gone,
   nothing can accidentally imply good or bad -- a green trend badge once
   shipped on 107 pages reading "improving" on a canal whose closures had
   doubled. The single exception is a 1px today marker.

   Every block declares its own background and colour. Inheriting either
   has broken this project twice. */

:root {
  --ink: #1a1a1a;
  --mid: #5c5c5c;
  --soft: #696969;
  --line: #dcdcd8;
  --bg: #fbfbfa;
  --off: #e4e4e0;
  --hair: #eeeeea;
  --today: #b03030;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

a { color: var(--ink); }

header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  max-width: 940px; margin: 0 auto; padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.wordmark { font-weight: 600; text-decoration: none; }
header nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
header nav a { color: var(--mid); text-decoration: none; padding: 4px 0; }
header nav a:hover { color: var(--ink); }
header nav a[aria-current] { color: var(--ink); }

main { max-width: 940px; margin: 0 auto; padding: 26px 20px 40px; }

h1 { font-size: 24px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 6px; }
h2 { font-size: 17px; font-weight: 600; margin: 32px 0 8px; }
h3 { font-size: 15px; font-weight: 600; margin: 24px 0 6px; }
p { margin: 0 0 14px; max-width: 68ch; }
.sub { color: var(--mid); font-size: 14px; }
.lede { font-size: 17px; line-height: 1.55; }

/* Independence is stated at the top of every page, not only in the footer:
   the archive's whole claim rests on being read as separate from CRT. */
.independence { color: var(--mid); font-size: 13px; margin: 0 0 16px;
                padding-left: 9px; border-left: 2px solid var(--line);
                max-width: 68ch; }
.independence b { color: var(--ink); }

/* One focus style for every interactive thing. :focus-visible keeps it off
   a mouse click while guaranteeing it for a keyboard. */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* A text alternative that is read but not seen. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0;
           margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
           white-space: nowrap; border: 0; }

/* forms: label above field, standard input, simple focus */
label { display: block; font-size: 14px; margin-bottom: 6px; }
.search { display: flex; gap: 8px; margin-bottom: 10px; max-width: 520px; }
.search input {
  flex: 1; padding: 9px 11px; border: 1px solid #8a8a8a; border-radius: 4px;
  font: inherit; background: #ffffff; color: var(--ink);
}
.search input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.search button {
  padding: 9px 16px; border: 1px solid var(--ink); border-radius: 4px;
  background: var(--ink); color: var(--bg); font: inherit; font-size: 14px;
  cursor: pointer;
}
#results { list-style: none; margin: 0 0 16px; padding: 0; max-width: 520px; }
#results li { border-bottom: 1px solid var(--line); }
#results a { display: block; padding: 8px 0; text-decoration: none; font-size: 14px; }
#results:empty { display: none; }

table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 8px; }
caption { text-align: left; font-size: 14px; color: var(--mid); padding-bottom: 8px; }
th {
  text-align: left; font-weight: 600; font-size: 14px;
  padding: 8px 12px 8px 0; border-bottom: 1px solid var(--ink);
}
td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th.r, td.r { text-align: right; padding-right: 0; }
tbody tr:hover td { background: var(--hair); }
.m { color: var(--mid); font-size: 13px; }

dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px;
           font-size: 14px; margin: 0 0 20px; }
dl.facts dt { color: var(--mid); }
dl.facts dd { margin: 0; }

/* charts */
.strip { display: flex; gap: 2px; height: 28px; margin: 6px 0 4px; }
.strip i { flex: 1; background: var(--off); }
.strip i.on { background: var(--ink); }

.tl { display: grid; grid-template-columns: minmax(80px, 150px) 1fr;
      gap: 0 10px; border-top: 1px solid var(--line);
      border-bottom: 1px solid var(--line); padding: 6px 0; margin: 10px 0 4px; }
.tl-labels { display: flex; flex-direction: column; min-width: 0; }
.tl-name { display: block; height: 24px; line-height: 24px; font-size: 12px;
           color: var(--mid); text-decoration: none; overflow: hidden;
           text-overflow: ellipsis; white-space: nowrap; }
.tl-name:hover { color: var(--ink); }
.tl-name.sched { color: var(--soft); font-style: italic; }
.tl-plot { min-width: 0; }
.tl-rows { position: relative; }
.tl-row { display: block; position: relative; height: 24px; }
.tl-bar { position: absolute; top: 8px; height: 8px; background: var(--ink); }
.tl-bar.sched { background: none; border: 1px dashed var(--mid);
                box-sizing: border-box; }
.tl-row:hover { background: var(--hair); }
.tl-row:hover .tl-bar { background: var(--mid); }
.tl-row:hover .tl-bar.sched { background: var(--off); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--today); }
.scale { display: flex; justify-content: space-between; font-size: 13px;
         color: var(--mid); max-width: none; margin: 6px 0 0; }

.multiples { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin: 8px 0; }
.sm { display: grid; grid-template-columns: 150px 1fr 36px; align-items: center;
      gap: 10px; padding: 3px 0; min-height: 28px; text-decoration: none;
      border-bottom: 1px solid var(--hair); }
.sm-name { font-size: 13px; color: var(--mid); overflow: hidden;
           white-space: nowrap; text-overflow: ellipsis; }
.sm:hover .sm-name { color: var(--ink); }
.sm-strip { display: flex; gap: 1px; height: 11px; }
.sm-strip i { flex: 1; background: var(--off); }
.sm-strip i.on { background: var(--ink); }
.sm-pct { font-size: 12px; color: var(--soft); text-align: right; }

.dur { display: inline-flex; align-items: center; gap: 8px; width: 100%;
       justify-content: flex-end; }
.dur .track { display: inline-block; width: 90px; height: 4px;
              background: var(--hair); }
.dur .track i { display: block; height: 100%; background: var(--ink);
                min-width: 1px; }
.dur b { font-weight: 400; }
.nowrap { white-space: nowrap; }

/* filters: plain links, no rail, no pills */
.filters { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; }
.fgroup { margin-bottom: 14px; }
.fgroup h3 { margin: 0 0 6px; }
.fgroup a { display: inline-block; font-size: 14px; color: var(--mid);
            text-decoration: none; margin: 0 14px 4px 0; }
.fgroup a:hover { color: var(--ink); }
.fgroup a[aria-pressed="true"] { color: var(--ink); font-weight: 600;
                                 text-decoration: underline; }
.fgroup a span { color: var(--soft); }

footer { max-width: 940px; margin: 0 auto; padding: 18px 20px 36px;
         border-top: 1px solid var(--line); font-size: 13px; color: var(--mid); }
footer a { color: var(--mid); }

@media (max-width: 700px) {
  .multiples { grid-template-columns: 1fr; }
  .sm { grid-template-columns: 120px 1fr 32px; }
  table.wide td:nth-child(2), table.wide th:nth-child(2) { display: none; }
}

/* the explorer: a facet rail and the rows it selects */
.ex { margin-top: 8px; }
.qform { margin: 0 0 14px; max-width: 520px; }
.qform label { display: block; font-size: 14px; margin-bottom: 6px; }
.qform input {
  width: 100%; padding: 9px 11px; border: 1px solid #8a8a8a;
  border-radius: 4px; font: inherit; background: #ffffff; color: var(--ink);
}
.qform input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.sentence { font-size: 15px; margin: 0 0 14px; }
.tok { border-bottom: 1px solid var(--ink); cursor: pointer; }
.tok::after { content: " ×"; color: var(--soft); }

.ex-grid { display: grid; grid-template-columns: 240px 1fr; gap: 0 32px;
           align-items: start; }
.rail { border-top: 1px solid var(--line); }
.rail .fgroup { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rail h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.f { display: block; position: relative; width: 100%; text-align: left;
     background: none; border: 0; padding: 4px 6px; font: inherit;
     font-size: 14px; color: var(--mid); cursor: pointer; }
.f i { position: absolute; left: 0; top: 2px; bottom: 2px;
       background: var(--hair); z-index: 0; }
.f .lbl { position: relative; z-index: 1; display: flex;
          justify-content: space-between; gap: 10px; }
.f .n { color: var(--soft); }
.f:hover { color: var(--ink); }
.f[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.f[disabled] { color: var(--soft); cursor: default; }

.results { min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr);
         border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
         margin-bottom: 14px; }
.stat { padding: 12px 12px 12px 0; background: none; color: var(--ink); }
.stat .v { font-size: 22px; font-weight: 600; }
.stat .k { color: var(--mid); font-size: 13px; }
.bar { display: flex; justify-content: space-between; align-items: baseline;
       gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--mid);
       position: sticky; top: 0; z-index: 3; background: var(--bg);
       padding: 8px 0; border-bottom: 1px solid var(--line);
       margin-bottom: 8px; }
.bar .acts .jump { color: var(--mid); text-decoration: none; }
.bar .acts .jump:hover { color: var(--ink); text-decoration: underline; }
.bar .acts button { background: none; border: 0; padding: 5px 0 5px 14px;
                    font: inherit; color: var(--mid); cursor: pointer;
                    text-decoration: underline; }
.bar .acts button:hover { color: var(--ink); }
.meta { color: var(--mid); font-size: 13px; }
.open { font-size: 12px; color: var(--soft); font-style: normal;
        margin-left: 8px; }
.empty { color: var(--mid); padding: 16px 0; }
#foot button { background: none; border: 0; padding: 0 0 0 12px; font: inherit;
               color: var(--mid); cursor: pointer; text-decoration: underline; }
#foot button:hover { color: var(--ink); }

.filters-toggle { display: none; }

@media (max-width: 700px) {
  .ex-grid { grid-template-columns: 1fr; }
  .rail { margin-bottom: 20px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .filters-toggle { display: block; width: 100%; text-align: left;
                    background: none; border: 0; border-top: 1px solid var(--line);
                    border-bottom: 1px solid var(--line); padding: 10px 0;
                    font: inherit; font-size: 14px; color: var(--ink);
                    cursor: pointer; margin-bottom: 8px; }
  .rail.collapsed { display: none; }
}

.glossary { margin: 10px 0 6px; }
.glossary dl.facts { margin-top: 8px; }

/* filters at the top, charts below */
.rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 0 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
        padding: 4px 0 10px; }
.rail .fgroup { padding: 10px 0 4px; border-bottom: 0; }
.rail .fgroup h3 { color: var(--mid); }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 34px;
          margin: 24px 0 8px; }
.chart { margin: 0; border-top: 1px solid var(--line); padding-top: 10px;
         min-width: 0; }
.chart.wide { grid-column: 1 / -1; }
.chart figcaption { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.chart figcaption .sub { display: block; font-weight: 400; }

.vbars { display: flex; align-items: flex-end; gap: 3px; height: 128px; }
.vb { flex: 1; min-width: 0; position: relative; height: 100%; }
.vb .b { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ink);
         min-height: 1px; }
.vb .y { position: absolute; left: 0; right: 0; text-align: center;
         font-size: 9px; color: var(--soft); line-height: 1; }
.vlabels { display: flex; gap: 3px; margin-top: 4px; }
.vlabels span { flex: 1; min-width: 0; text-align: center; font-size: 9px;
                color: var(--mid); }
#chart-monthly .vlabels span { writing-mode: vertical-rl; transform: rotate(180deg);
                               height: 34px; }

.hbars { display: flex; flex-direction: column; gap: 5px; }
.hb { display: grid; grid-template-columns: 150px 1fr 58px 44px;
      align-items: center; gap: 10px; font-size: 13px; }
.hb .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb .t { background: var(--off); height: 11px; }
.hb .t i { display: block; height: 100%; background: var(--ink); }
.hb .n { text-align: right; color: var(--mid); }
.hb .c { text-align: right; color: var(--soft); font-size: 12px; }
.hb .c::after { content: "×"; margin-left: 2px; color: var(--soft); }

@media (max-width: 700px) {
  .charts { grid-template-columns: 1fr; }
  .hb { grid-template-columns: 110px 1fr 48px 34px; }
}

#rail .f[hidden] { display: none; }
.rail .more { display: block; background: none; border: 0; padding: 4px 6px 0;
              font: inherit; font-size: 13px; color: var(--mid);
              cursor: pointer; text-decoration: underline; }
.rail .more:hover { color: var(--ink); }

/* type-ahead on the explorer search */
.qform { position: relative; }
.suggest { position: absolute; z-index: 5; left: 0; right: 0; top: 100%;
           margin: 2px 0 0; padding: 0; list-style: none; background: #ffffff;
           border: 1px solid var(--line); max-height: 300px; overflow: auto;
           color: var(--ink); }
.suggest li { margin: 0; }
.suggest button { display: flex; align-items: baseline; gap: 10px; width: 100%;
                  text-align: left; background: none; border: 0;
                  border-bottom: 1px solid var(--hair); padding: 9px 11px;
                  font: inherit; font-size: 14px; color: var(--ink);
                  cursor: pointer; }
.suggest button:hover, .suggest button.active { background: var(--hair); }
.suggest .st { color: var(--soft); font-size: 12px; min-width: 60px;
               flex: none; }
.suggest .sv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .sn { margin-left: auto; color: var(--soft); font-size: 12px;
               flex: none; }
.suggest .empty { padding: 9px 11px; color: var(--mid); font-size: 14px; }

details { margin: 0 0 14px; }
summary { cursor: pointer; color: var(--mid); font-size: 14px; }
summary:hover { color: var(--ink); }

/* Shut now: one card per closure, grouped by canal. Cards rather than a
   four-column table, whose columns do not fit a phone. The same card
   layout carries "coming up", so the reader learns one shape. */
.canal-group { border-top: 1px solid var(--line); padding: 2px 0; }
.canal-group summary { display: flex; justify-content: space-between;
                       align-items: baseline; gap: 12px; padding: 9px 0; }
.canal-group summary .cname { color: var(--ink); font-weight: 600;
                              font-size: 15px; }
.canal-group summary .meta { text-align: right; }
.shutlist { list-style: none; margin: 0 0 12px; padding: 0;
            display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.shut { border: 1px solid var(--line); border-radius: 4px;
        padding: 10px 12px; background: #ffffff; min-width: 0; }
.shut .st { display: block; font-weight: 600; text-decoration: none;
            margin-bottom: 7px; }
.shut .st:hover { text-decoration: underline; }
.shut dl { display: grid; grid-template-columns: max-content 1fr;
           gap: 2px 12px; margin: 0; font-size: 13px; }
.shut dt { color: var(--mid); }
.shut dd { margin: 0; min-width: 0; }
@media (max-width: 700px) {
  .shutlist { grid-template-columns: 1fr; }
  .canal-group summary { flex-wrap: wrap; }
}

.pagefoot { margin: 30px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }

/* the Period facet: two dates and some shortcuts */
.rail .dates { display: grid; gap: 6px; margin-bottom: 8px; }
.rail .dates label { display: flex; flex-direction: column; gap: 2px;
                     font-size: 12px; color: var(--mid); }
.rail .dates input { width: 100%; min-width: 0; font: inherit; font-size: 13px;
                     padding: 4px 6px; border: 1px solid #8a8a8a;
                     border-radius: 4px; background: #ffffff; color: var(--ink); }
.rail .preset { display: inline-block; font-size: 13px; color: var(--mid);
                text-decoration: none; margin: 2px 10px 2px 0;
                padding: 4px 1px; }
.rail .preset:hover { color: var(--ink); text-decoration: underline; }
.rail .preset-sched { background: none; border: 0; padding: 0; font: inherit;
                      font-size: 13px; cursor: pointer; }
.rail .preset-sched[aria-pressed="true"] { color: var(--ink);
                                           font-weight: 600; }

/* Print: a page should print as the facts, not the furniture. Charts are CSS
   backgrounds, which most browsers drop, so they are hidden and the tables
   and figures carry the evidence. */
@media print {
  body { background: #ffffff; color: #1a1a1a; }
  header nav, .pagefoot, footer, .qform, #rail, #suggest, .ex .bar,
  .chart { display: none; }
  main { max-width: none; margin: 0; padding: 0; }
  a { color: #1a1a1a; text-decoration: none; }
  tr, .tl-row, .facts { break-inside: avoid; }
}

/* the small multiples' own season selector */
.season-pick { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
               margin: 0 0 10px; }
.season-pick label { font-size: 14px; color: var(--mid); margin: 0; }
.season-pick select { font: inherit; font-size: 14px; padding: 4px 6px;
                      border: 1px solid #8a8a8a; border-radius: 4px;
                      background: #ffffff; color: var(--ink); }
