/* Frame Gauge website: rules for the status page only.
 * Loaded after site.css. Every colour is a token from site.css.
 */

/* ------------------------------------------------------------------
   The four status words, each with its total
------------------------------------------------------------------ */
.summary { display: grid; gap: 44px 56px; }
.summary > * { min-width: 0; }
.summary-key { display: grid; gap: 36px; align-content: start; }
.legend { border-top: 1px solid var(--rule); }
.legend > div { display: grid; gap: 6px 20px; padding-block: 12px; border-bottom: 1px solid var(--rule); align-items: baseline; }
.legend dd { font-size: .875rem; line-height: 1.45; color: var(--fg-2); }
.tally > div { grid-template-columns: minmax(0, 1fr) auto; }
.tally dd { grid-column: 1 / -1; }
.tally dd.n {
  grid-column: 2; grid-row: 1;
  font-size: 1.375rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  color: var(--fg); text-align: right;
}

/* the share of each status, drawn to scale */
.split-fig { display: grid; gap: 14px; align-content: start; }
.split-fig figcaption { margin-top: 0; }
.split { display: flex; gap: 3px; height: 12px; }
.split i { flex: var(--n) 1 0; min-width: 4px; border-radius: 3px; }
.split .s-v { background: var(--ok); }
.split .s-b { background: var(--warn); }
.split .s-d { background: var(--info); }
.split .s-p { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }

/* counts by group */
.counts { max-width: 42rem; font-variant-numeric: tabular-nums; }
.counts th, .counts td { padding-block: 9px; }
.counts thead th { white-space: normal; }
.counts thead th.num { font-size: .8125rem; font-weight: 500; line-height: 1.4; color: var(--fg-3); text-align: right; white-space: normal; }
.counts thead th:nth-child(2) { width: 14%; }
.counts thead th:nth-child(3) { width: 21%; }
.counts thead th:nth-child(4) { width: 22%; }
.counts thead th:nth-child(5) { width: 13%; }
.counts .hd { display: inline-flex; align-items: baseline; gap: 6px; text-align: left; }
.counts .zero { color: var(--fg-3); font-weight: 400; }
.counts tfoot th, .counts tfoot td { border-top: 1px solid var(--rule-2); border-bottom-color: var(--rule-2); color: var(--fg); }
.counts tfoot th { font-weight: 600; }

/* links to the groups */
.jump { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--rule); }
.jump h3 { font-size: .8125rem; font-weight: 400; line-height: 1.5; letter-spacing: 0; color: var(--fg-3); }
.jump ul { display: flex; flex-wrap: wrap; gap: 0 22px; margin-top: 4px; }
.jump a { display: block; padding-block: 7px; font-size: .9375rem; color: var(--fg-2); text-decoration: none; }
.jump a:hover { color: var(--fg); }

/* ------------------------------------------------------------------
   The groups
------------------------------------------------------------------ */
.group .section-head { margin-bottom: 14px; }
.status caption { padding-bottom: 18px; font-size: .8125rem; font-weight: 400; line-height: 1.5; letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--fg-3); }
.status tbody th { font-weight: 600; color: var(--fg); letter-spacing: -.005em; }
/* what exists reads first: a planned row keeps its place and steps back */
.status .is-planned th { font-weight: 500; color: var(--fg-2); }
.status .c-note a { color: var(--fg); }

/* Narrow: each row stacks. ID and status on one line, then the feature, then the note. */
@media (max-width: 1199.98px) {
  .status, .status caption, .status tbody { display: block; }
  .status thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .status tbody { border-top: 1px solid var(--rule-2); }
  .status tbody tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "id st" "ft ft" "nt nt";
    gap: 6px 12px; align-items: center;
    padding-block: 14px 16px; border-bottom: 1px solid var(--rule);
  }
  .status tbody th, .status tbody td { display: block; min-width: 0; padding: 0; border: 0; }
  .status tbody .id { grid-area: id; line-height: 1.5; }
  .status tbody .c-st { grid-area: st; justify-self: end; }
  .status tbody th { grid-area: ft; margin-top: 2px; font-size: 1rem; line-height: 1.35; }
  .status tbody .c-note { grid-area: nt; max-width: 44em; }
}
/* Between a phone and a wide window: ID, feature and status share a line; the note runs beneath. */
@media (min-width: 640px) and (max-width: 1199.98px) {
  .status tbody tr {
    grid-template-columns: 4.25rem minmax(0, 1fr) 14.75rem;
    grid-template-areas: "id ft st" ". nt nt";
    gap: 4px 16px; align-items: baseline;
  }
  .status tbody .c-st { justify-self: start; }
  .status tbody th { margin-top: 0; }
}
/* Wide: a four-column table. */
@media (min-width: 1200px) {
  .status { table-layout: fixed; }
  .status thead .id { width: 4.75rem; line-height: 1.5; }
  .status thead th:nth-child(2) { width: 31%; }
  .status thead .c-st { width: 14.5rem; }
  .status tbody th { font-size: .9375rem; }
  .status tbody .c-st { padding-block: 10px; }
}

/* ------------------------------------------------------------------
   Widths
------------------------------------------------------------------ */
@media (max-width: 639.98px) {
  /* the four status columns are narrow, so their headings run down the column */
  .counts thead th.num { vertical-align: bottom; padding-right: 0; }
  .counts thead th.num:nth-child(n) { width: 13%; }
  .counts .hd { writing-mode: vertical-rl; height: 8.2rem; align-items: center; }
}
/* one column of summary: word, meaning and total share a line */
@media (min-width: 640px) and (max-width: 1199.98px) {
  .tally > div { grid-template-columns: 15rem minmax(0, 1fr) 4rem; }
  .tally dd { grid-column: 2; }
  .tally dd.n { grid-column: 3; }
}
/* the words and their totals on the left, the counts by group on the right */
@media (min-width: 1200px) {
  .summary { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .counts { max-width: none; }
}
