/* The server-rendered pages: Species, Rules, Census, About and the pages under them.
   Loaded after app.css, which holds the fonts, the colours, the masthead, the tab row and the page frame. Nothing here
   names a species: a portrait's colour and position come from the sprite sheet, as inline styles. */

body > footer {
  margin-top: 16px;
  padding-top: 12px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  border-top: 2px solid var(--ink);
  color: var(--muted);
  font-size: 14px;
}
body > footer p {
  margin: 0 0 6px;
  max-width: 80ch;
}
main a,
body > footer a {
  color: var(--ink);
  text-underline-offset: 2px;
}
main a:focus-visible,
body > footer a:focus-visible,
main summary:focus-visible {
  outline: 3px solid var(--alert);
  outline-offset: 2px;
}

main h1 {
  margin: 10px 0 6px;
  font-size: clamp(32px, 8vw, 38px);
  line-height: 1.05;
}
main h2 {
  margin: 20px 0 6px;
  font-size: 28px;
  line-height: 1.1;
}
main h2 small {
  font-family: var(--body);
  font-size: 16px;
  color: var(--muted);
}
main h3 {
  margin: 20px 0 6px;
  font-size: 24px;
  line-height: 1.15;
}
main h4 {
  margin: 18px 0 4px;
  font-size: 16px;
  font-weight: 600;
}
main p,
main ul,
main ol,
main dl {
  max-width: 68ch;
}
main p {
  margin: 0 0 10px;
}
main li {
  margin-bottom: 4px;
}
main .lede {
  max-width: 62ch;
  color: var(--muted);
}
main .fine {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 14px;
}
main .none {
  padding: 10px 12px;
  border: 2px solid var(--ink);
  background: var(--panel);
  color: var(--muted);
}
main code {
  overflow-wrap: anywhere;
}
main pre {
  max-width: 68ch;
  margin: 0 0 10px;
  padding: 10px 12px;
  overflow-x: auto;
  border: 2px solid var(--ink);
  background: var(--panel);
  font-size: 13px;
  line-height: 1.5;
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.back {
  margin: 0;
}
.back a,
a.more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
}

/* Links to the pages under a section, and the census filter. */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}
.subnav a {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  background: var(--panel);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.subnav a[aria-current] {
  background: var(--ink);
  color: var(--paper);
}
@media (min-width: 720px) {
  .subnav a {
    flex: 0 1 auto;
    padding: 0 14px;
  }
}

/* A portrait: the drawing on its order's colour, standing where the island's portraits stand it. */
.mug {
  position: relative;
  display: block;
  aspect-ratio: 22 / 16;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--panel);
}
.mug img {
  position: absolute;
  height: auto;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* Species index. */
.orders {
  max-width: none;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 2px solid var(--ink);
  background: var(--panel);
}
.orders li {
  margin: 0;
}
.orders li + li {
  border-top: 1px solid var(--soft);
}
.orders a {
  display: block;
  height: 100%;
  padding: 8px 10px;
  line-height: 1.3;
  text-decoration: none;
}
.orders .ord {
  font-family: var(--display);
  font-size: 26px;
}
.orders .gloss {
  color: var(--muted);
}
.orders .what,
.orders .cen {
  display: block;
}
.orders .cen {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--data);
  font-size: 13px;
}
@media (min-width: 920px) {
  .orders {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }
  .orders li + li {
    border-top: 0;
    border-left: 1px solid var(--soft);
  }
}
.order .about {
  max-width: none;
  margin: 2px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
  color: var(--muted);
}
.pens {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.pen {
  border: 2px solid var(--ink);
  background: var(--panel);
}
.pen .face {
  display: block;
  text-decoration: none;
}
.pen .mug {
  border-width: 0 0 2px;
}
.pen h3 {
  margin: 8px 10px 0;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.pen:hover h3,
.pen:focus-within h3 {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pen p {
  margin: 0 10px 10px;
  font-size: 14.5px;
  line-height: 1.35;
}
main .latin {
  font-family: var(--display);
  font-style: italic;
}
.pen .latin {
  margin-bottom: 6px;
  font-size: 20px;
  line-height: 1.15;
}
.pen .count {
  color: var(--muted);
  font-family: var(--data);
  font-size: 13px;
}

/* One species. */
.plate {
  display: grid;
  grid-template-columns: minmax(96px, 190px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 4px 0 12px;
}
.plate h1 {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 600;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.plate .latin {
  margin: 2px 0 6px;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.05;
}
.plate .meta {
  margin: 0;
  color: var(--muted);
}
.joke {
  padding: 10px 12px;
  border: 2px solid var(--ink);
  background: var(--panel);
}
.joke .cap {
  display: block;
  color: var(--muted);
  font-size: 14px;
}
.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 16px;
  margin: 0 0 10px;
}
.facts dt {
  color: var(--muted);
  font-size: 14px;
}
.facts dd {
  margin: 0 0 8px;
}
@media (min-width: 640px) {
  .facts {
    grid-template-columns: 14em minmax(0, 1fr);
  }
  .facts dt {
    padding-top: 2px;
  }
}

/* Bar charts, each with its figures as a table beside it. */
.chart {
  max-width: 760px;
  margin: 0 0 12px;
}
.bars {
  display: block;
  width: 100%;
  height: 112px;
  border-bottom: 2px solid var(--ink);
}
.bar-a {
  fill: var(--ink);
}
.bar-b {
  fill: var(--muted);
}
.chart .axis {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--data);
  font-size: 12px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 6px 0 0;
  font-size: 14px;
}
.legend .key {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
}
.key.bar-a {
  background: var(--ink);
}
.key.bar-b {
  background: var(--muted);
}
main summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Tables. Wide ones scroll inside their own box, so the page never does. */
.scroll {
  max-width: 100%;
  margin: 0 0 10px;
  overflow-x: auto;
  border: 2px solid var(--ink);
  background: var(--panel);
  container-type: inline-size;
}
.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.35;
}
/* A caption stays the width of the box and in view while a wide table scrolls under it. */
.data caption {
  position: sticky;
  left: 0;
  box-sizing: border-box;
  max-width: 100cqw;
  padding: 8px 10px;
  caption-side: top;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}
.data th,
.data td {
  padding: 6px 10px;
  border-top: 1px solid var(--soft);
  text-align: left;
  vertical-align: top;
}
.data thead th {
  border-top: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  vertical-align: bottom;
}
.data tbody th {
  font-weight: 400;
}
.data .fig {
  font-family: var(--data);
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}
/* A table of three columns or fewer folds its figure headings to fit a narrow screen, so both
   figures stay in view. A wider one keeps them on one line and scrolls. */
.data:not(:has(thead th:nth-child(4))) .fig {
  white-space: normal;
}
.data time {
  white-space: nowrap;
}
/* A table of sentences scrolls on a narrow screen. Folded to fit, it runs to a word a line. */
.data.prose {
  min-width: 640px;
}
.data .sub {
  display: block;
  padding-left: 16px;
  color: var(--muted);
}
.who {
  font-weight: 600;
}
.who i {
  font-weight: 400;
  white-space: nowrap;
}
.ranks .row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 190px;
}
.ranks .mug {
  flex: none;
  width: 44px;
  border: 0;
}
.ranks .split {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
main .tally {
  max-width: 760px;
  margin-bottom: 10px;
}
@media (min-width: 640px) {
  main .tally {
    grid-template-columns: repeat(4, 1fr);
  }
  main .tally div:last-child:nth-child(odd) {
    grid-column: auto;
  }
}

/* robots.txt, a line at a time. */
.rules {
  max-width: none;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 2px solid var(--ink);
  background: var(--panel);
}
.rules li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 20px;
  margin: 0;
  padding: 7px 10px;
}
.rules li + li {
  border-top: 1px solid var(--soft);
}
.rules .gap {
  height: 16px;
  padding: 0;
  background: var(--paper);
}
.rules code {
  font-size: 14px;
  font-weight: 600;
}
.rules .means {
  color: var(--muted);
  font-size: 14.5px;
}
.rules .tal {
  font-family: var(--data);
  font-size: 13px;
}
@media (min-width: 820px) {
  .rules li {
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  }
  .rules code {
    grid-column: 1 / -1;
  }
}
ul.more {
  padding-left: 20px;
}

/* The notices. */
.shelf {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}
@media (min-width: 820px) {
  .shelf {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}
.notice {
  padding: 10px 12px;
  border: 2px solid var(--ink);
  background: var(--panel);
}
.notice h2 {
  margin: 0 0 4px;
  font-family: var(--data);
  font-size: 18px;
  font-weight: 600;
}
.notice h2 code {
  font: inherit;
}
.notice .scroll,
.notice .none {
  background: var(--paper);
}
.notice .data th,
.notice .data td {
  padding-inline: 8px;
}

/* The alignment chart: nine squares, each holding the species placed in it. */
.squares {
  width: 100%;
  min-width: 330px;
  border-collapse: collapse;
  table-layout: fixed;
}
.squares caption {
  padding: 8px 10px;
  caption-side: top;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}
.squares th {
  padding: 6px 8px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}
.squares thead td,
.squares tbody th {
  width: 4.2em;
}
.squares tbody td {
  height: 92px;
  padding: 6px 8px;
  border-top: 1px solid var(--soft);
  border-left: 1px solid var(--soft);
  background: var(--paper);
  vertical-align: top;
}
.squares .sq {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.15;
}
.toks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.toks li {
  width: 72px;
  margin: 0;
  font-family: var(--data);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}
.tok {
  display: block;
  text-decoration: none;
}
.tok .mug {
  margin-bottom: 2px;
}
.toks .mark {
  display: block;
  color: var(--muted);
}
.inputs {
  max-width: 900px;
  border-top: 1px solid var(--soft);
}
.inputs summary {
  font-weight: 400;
  text-decoration: none;
}
