/* The compare page. Colours come from base.css; this file adds the matrix, the head-to-head
   table and the field cards. */

.logo {
  text-decoration: none;
}
.top nav a[aria-current="page"] {
  color: var(--ink);
}
.intro {
  padding: 64px 0 0;
  max-width: 720px;
}
.intro h1 em {
  font-style: italic;
  color: var(--amber);
}
.intro .lede {
  margin: 18px 0 0;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 20px;
}

/* toolbar */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin: 44px 0 18px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
}
.seg button,
.kinds button {
  font: 500 13.5px var(--sans);
  color: var(--muted);
  background: none;
  border: 0;
  padding: 8px 14px;
  cursor: pointer;
}
.seg button[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}
.kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.kinds button {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
}
.kinds button[aria-pressed="true"] {
  color: var(--amber);
  border-color: var(--chip-rule);
  background: var(--chip-bg);
}
button:focus-visible,
select:focus-visible,
td button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: var(--muted);
  margin-left: auto;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* the glyph: a filled, half-filled, empty or dashed ring */
.g {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--ok);
  flex: none;
}
.g.y {
  background: var(--ok);
}
.g.p {
  border-color: var(--amber);
  background: linear-gradient(90deg, var(--amber) 50%, transparent 50%);
}
.g.n {
  border-color: var(--muted);
  opacity: 0.55;
  background: none;
  width: 11px;
  height: 11px;
}
.g.u {
  border: 1.5px dashed var(--muted);
  background: none;
}

[hidden] {
  display: none !important;
}
section.view {
  padding: 0;
}
.scroller {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--card);
}

/* matrix */
.matrix {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13.5px;
}
.matrix th,
.matrix td {
  border-bottom: 1px solid var(--rule);
  padding: 0;
}
.matrix thead th {
  vertical-align: bottom;
  background: var(--group);
  height: 128px;
}
.matrix thead th button {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 500 12.5px var(--sans);
  color: var(--ink);
  background: none;
  border: 0;
  padding: 10px 0;
  width: 100%;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
}
.matrix .feat {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
  text-align: left;
  font-weight: 400;
  color: var(--body);
  padding: 7px 14px;
  min-width: 220px;
  max-width: 280px;
  line-height: 1.35;
  border-right: 1px solid var(--rule);
}
.matrix thead .feat {
  background: var(--group);
  z-index: 2;
}
.matrix tr.grp th {
  position: sticky;
  left: 0;
  text-align: left;
  font: 500 10.5px var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--group);
  padding: 12px 14px 6px;
}
.matrix td {
  text-align: center;
  min-width: 38px;
}
.matrix td button {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 34px;
  background: none;
  border: 0;
  cursor: pointer;
}
.matrix td button:hover,
.matrix td button[aria-pressed="true"] {
  background: var(--hot-tint);
}
.matrix .us {
  background: var(--chip-bg);
}
.matrix thead th.us {
  background: var(--chip-bg);
}
.matrix thead th.us button {
  color: var(--amber);
}
.matrix tr.score td {
  font: 500 11.5px var(--mono);
  color: var(--muted);
  padding: 8px 0;
  font-variant-numeric: tabular-nums;
}

/* inspector */
.inspect {
  margin: 14px 0 0;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--card);
  padding: 14px 18px;
  display: grid;
  gap: 4px;
  align-content: start;
}
.inspect.on {
  position: sticky;
  bottom: 12px;
  z-index: 3;
  min-height: 92px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}
.inspect .hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.inspect .what {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  color: var(--ink);
  margin: 0;
}
.inspect .what b {
  font-weight: 600;
}
.inspect p {
  margin: 0;
  font-size: 14.5px;
}
.inspect .src {
  font: 12px var(--mono);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.inspect .def {
  font-size: 13px;
  color: var(--muted);
}

/* head to head */
.pick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 18px;
  font-size: 14px;
}
.pick select {
  appearance: none;
  font: 500 14px var(--sans);
  color: var(--ink);
  background-color: var(--card);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 7px 36px 7px 12px;
  margin-left: 6px;
  cursor: pointer;
}
.vs-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin: 0 0 18px;
}
.vs-head > div {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--card);
  padding: 14px 18px;
  min-width: 0;
}
.vs-head h3 {
  margin: 0 0 4px;
  font: 600 20px var(--serif);
  color: var(--ink);
}
.vs-head p {
  margin: 0;
  font-size: 14.5px;
}
.vs-head .tally {
  font: 12px var(--mono);
  color: var(--muted);
  margin-top: 8px;
}
.vs {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 14px;
}
.vs th,
.vs td {
  text-align: left;
  vertical-align: top;
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
}
.vs td:first-child {
  width: 24%;
  color: var(--ink);
}
.vs td + td {
  width: 38%;
}
.vs td .cell {
  display: flex;
  gap: 9px;
  align-items: baseline;
}
.vs td .cell .g {
  transform: translateY(2px);
}
.vs td a {
  font-size: 12px;
  font-family: var(--mono);
}
.vs tr.grp th {
  font: 500 10.5px var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--group);
}
.vs tr.differs td {
  background: var(--hot-tint);
}

/* field */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--card);
  padding: 16px 18px;
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}
.card h3 {
  margin: 0;
  font: 600 19px var(--serif);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.card h3 a {
  color: inherit;
  text-decoration: none;
}
.card .kind {
  font: 500 10.5px var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.card p {
  margin: 0;
  font-size: 14.5px;
}
.card dl {
  margin: 4px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  font-size: 13px;
}
.card dt {
  color: var(--muted);
}
.card dd {
  margin: 0;
  color: var(--body);
  min-width: 0;
}
.card .status {
  font-size: 12.5px;
  color: var(--bad);
}
#method p {
  margin: 0 0 14px;
}

@media (max-width: 760px) {
  .legend {
    margin-left: 0;
  }
  .vs-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .vs {
    min-width: 0;
  }
  .vs thead {
    display: none;
  }
  .vs tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .vs tr.grp th,
  .vs td:first-child {
    grid-column: 1 / -1;
    width: auto;
    border-bottom: 0;
    padding-bottom: 0;
    font-weight: 500;
  }
  .vs tr.grp th {
    padding-bottom: 8px;
  }
  .vs td + td {
    width: auto;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .matrix .feat {
    min-width: 150px;
    max-width: 170px;
    font-size: 12.5px;
    padding: 7px 10px;
  }
  .matrix thead th {
    height: 112px;
  }
}
