/* database.name.
 *
 * One idea carries the whole site: a record's ACCESS BAND is the thing people
 * came for, so it is the only element allowed to use colour as information.
 * Bands differ by hue at a shared lightness and chroma, so none shouts louder
 * than another -- "open" must not read as good news and "closed" as bad, they
 * are simply different facts.
 *
 * A band whose route is unverified additionally gets a DASHED outline rather
 * than a different colour, because the distinction being drawn is "we know the
 * procedure" vs "we do not" -- a different axis from which procedure it is, and
 * a different shape is the honest way to show a different axis.
 */

:root {
  color-scheme: light dark;
  --page:      #fbfaf8;
  --surface:   #ffffff;
  --border:    #e2ded7;
  --fg:        #1e1c1a;
  --muted:     #6b6560;
  --accent:    #3a5a8c;
  --accent-bg: #eef2f8;

  --band-open:        152;
  --band-registration:212;
  --band-agreement:    38;
  --band-application:  272;
  --band-closed:      356;
  --band-unknown:     250;

  --serif: "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 7px;
  --maxw: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page:    #14161a;
    --surface: #1b1e24;
    --border:  #2c313a;
    --fg:      #e7e5e2;
    --muted:   #9aa1ab;
    --accent:  #8fb4e8;
    --accent-bg:#1e2733;
  }
}
:root[data-theme="dark"] {
  --page:#14161a; --surface:#1b1e24; --border:#2c313a;
  --fg:#e7e5e2; --muted:#9aa1ab; --accent:#8fb4e8; --accent-bg:#1e2733;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--page); color: var(--fg);
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
main { max-width: var(--maxw); margin: 0 auto; padding: 0 1.1rem 4rem; }

header.site { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.1rem 1rem; }
.brand { font-family: var(--serif); font-size: 1.9rem; text-decoration: none; color: var(--fg); }
.brand span { color: var(--muted); }
.tagline { margin: .2rem 0 0; color: var(--muted); font-size: .96rem; }

footer.site {
  max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.1rem 3rem;
  border-top: 1px solid var(--border); color: var(--muted); font-size: .87rem;
}
footer.site p { margin: .3rem 0; }
.muted { color: var(--muted); }

/* --- search ------------------------------------------------------------- */
form.search { display: flex; gap: .5rem; margin: 1.4rem 0 .4rem; }
form.search input[type=search] {
  flex: 1; min-width: 0; padding: .68rem .8rem; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--fg);
}
form.search button {
  padding: .68rem 1.15rem; font-size: 1rem; cursor: pointer;
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--page);
}
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0 1.4rem; }
.chip {
  font-size: .84rem; padding: .22rem .6rem; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--fg); text-decoration: none;
}
.chip[aria-current="true"] { border-color: var(--accent); background: var(--accent-bg); }
.chip .n { color: var(--muted); }

/* --- result list --------------------------------------------------------- */
ol.results { list-style: none; padding: 0; margin: 0; }
ol.results > li {
  padding: 1rem 0; border-top: 1px solid var(--border);
}
ol.results h2 { margin: 0 0 .2rem; font-size: 1.12rem; font-weight: 600; }
ol.results h2 a { text-decoration: none; }
ol.results h2 a:hover { text-decoration: underline; }
ol.results p { margin: .3rem 0 .5rem; color: var(--muted); font-size: .93rem; }

/* --- the band badge: the payload ---------------------------------------- */
.band {
  display: inline-block; font-size: .78rem; letter-spacing: .01em;
  padding: .16rem .55rem; border-radius: 4px; white-space: nowrap;
  background: oklch(0.94 0.045 var(--hue));
  color:      oklch(0.34 0.10  var(--hue));
  border: 1px solid oklch(0.86 0.06 var(--hue));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .band {
    background: oklch(0.26 0.045 var(--hue));
    color:      oklch(0.86 0.075 var(--hue));
    border-color: oklch(0.38 0.05 var(--hue));
  }
}
.band-open        { --hue: var(--band-open); }
.band-registration{ --hue: var(--band-registration); }
.band-agreement   { --hue: var(--band-agreement); }
.band-application { --hue: var(--band-application); }
.band-closed      { --hue: var(--band-closed); }
.band-unknown     { --hue: var(--band-unknown); }
/* Different SHAPE, not a different colour: this marks a different axis --
   whether the route is verified, not which route it is. */
.band.unverified  { border-style: dashed; }

/* --- entity page --------------------------------------------------------- */
h1.entity { font-family: var(--serif); font-size: 2rem; margin: 1.4rem 0 .3rem; line-height: 1.2; }
.lede { color: var(--muted); margin: 0 0 1.4rem; }
.path {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 1rem 1.1rem; margin: 0 0 .9rem;
}
.path h3 { margin: 0 0 .5rem; font-size: 1rem; display: flex; gap: .55rem; align-items: baseline; flex-wrap: wrap; }
.path dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .9rem; margin: .6rem 0 0; font-size: .93rem; }
.path dt { color: var(--muted); }
.path dd { margin: 0; }
.provenance { margin: .7rem 0 0; font-size: .85rem; color: var(--muted); border-top: 1px dotted var(--border); padding-top: .5rem; }
.withheld { font-style: italic; }

table.meta { border-collapse: collapse; width: 100%; font-size: .93rem; margin: 1.2rem 0; }
table.meta th { text-align: left; color: var(--muted); font-weight: 400; padding: .35rem .9rem .35rem 0; vertical-align: top; white-space: nowrap; }
table.meta td { padding: .35rem 0; }

.empty { padding: 2rem 0; color: var(--muted); }
.count { color: var(--muted); font-size: .9rem; margin: 0 0 .6rem; }
