/*
  The comparison pages (public/compare). Plain pages of their own, like the privacy page, and set the
  same way: its colours and type, which are the app's own (src/landing/front.css). The one thing they
  add is the table of facts, which turns into a list on a phone so that it never runs off the side.
  One stylesheet for all of them, so the six pages cannot drift apart.
*/
:root {
  color-scheme: light dark;
  --page: #faf8f4;
  --text: #1f1e1c;
  --soft: #565554;
  --line: #e5e3df;
  --mark: #f6d98c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #222222;
    --text: #ece9e5;
    --soft: #c0bdba;
    --line: #353535;
    --mark: #75612a;
  }
}
html {
  background: var(--page);
  color: var(--text);
  font: 19px/1.7 ui-serif, 'Iowan Old Style', Charter, 'Palatino Linotype', Georgia, serif;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  padding: 2.5rem 1.25rem 6rem;
}
::selection {
  background: var(--mark);
}
main,
header {
  max-width: 34rem;
  margin: 0 auto;
}
header a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
header img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
}
h1 {
  margin: 3.5rem 0 0;
  font-size: clamp(2.2rem, 7vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.dated {
  margin: 0.75rem 0 0;
  color: var(--soft);
  font-size: 0.875rem;
}
.short {
  margin: 2.25rem 0 0;
  font-size: 1.12rem;
  line-height: 1.6;
}
h2 {
  margin: 3rem 0 0;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
p,
ul,
ol {
  margin: 0.75rem 0 0;
}
ul,
ol {
  padding-left: 1.2rem;
}
li + li {
  margin-top: 0.35rem;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 2px;
}

/* A number that leads to the source of a fact, in the list at the foot of the page. */
sup {
  font-size: 0.7em;
  line-height: 0;
}
sup a {
  padding: 0.4em 0.1em 0.4em 0.05em;
  color: var(--soft);
  text-decoration: none;
}
sup a:hover {
  color: var(--text);
  text-decoration: underline;
}
.sources {
  color: var(--soft);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
:target {
  background: var(--mark);
}

/* The index: each comparison as a line with what it comes down to. */
.list {
  padding: 0;
  list-style: none;
}
.list li {
  margin-top: 1.25rem;
}
.list a {
  font-weight: 600;
}
.list span {
  display: block;
  color: var(--soft);
}

/* The facts, side by side. */
table {
  width: 100%;
  margin: 1.25rem 0 0;
  border-collapse: collapse;
  /* The first row sets the columns: a narrow one for the question, and the two answers equal. */
  table-layout: fixed;
  font-size: 0.875rem;
  line-height: 1.5;
}
th,
td {
  padding: 0.6rem 1rem 0.6rem 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
th:last-child,
td:last-child {
  padding-right: 0;
}
thead th,
thead td {
  border-top: 0;
}
thead td {
  width: 24%;
}
tbody th {
  font-weight: 600;
}

/* On a phone a row becomes its heading and the two answers under it, each with its name. */
@media (max-width: 34rem) {
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  table,
  tbody,
  tr,
  tbody th,
  td {
    display: block;
    width: auto;
  }
  tr {
    padding: 0.75rem 0;
    border-top: 1px solid var(--line);
  }
  tbody th,
  td {
    padding: 0;
    border: 0;
  }
  td {
    margin-top: 0.4rem;
  }
  td::before {
    display: block;
    color: var(--soft);
    font-size: 0.75rem;
  }
  td:nth-of-type(1)::before {
    content: 'Nescio';
  }
  td:nth-of-type(2)::before {
    content: var(--other);
  }
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  max-width: 34rem;
  margin: 4rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.875rem;
}
