/* SPDX-License-Identifier: Apache-2.0 */
/* SPDX-FileCopyrightText: 2026 The Linux Foundation */

/* Colours follow the chart palette (render/palette.py). */
:root {
  --background: #ffffff;
  --surface: #f6f7f9;
  --border: #c9d0da;
  --text: #2b3140;
  --muted: #6b7280;
  --link: #0062a0;
  --focus: #e69f00;
  --member: #0072b2;
  --external: #e69f00;
  --org-bot: #009e73;
  --external-bot: #cc79a7;
  --measure: 72rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
}

body {
  margin: 0;
}

a {
  color: var(--link);
}

a:focus-visible,
input:focus-visible + label,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem;
}

body > header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

body > header a {
  display: inline-block;
  padding: 0.75rem 0;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

h1 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.75rem;
}

h2 {
  margin: 2rem 0 0.5rem;
  font-size: 1.35rem;
}

.note,
.scope,
.missing {
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 1rem 0;
}

/* Charts may use the full width of the window, past the reading measure. */
.chart {
  display: block;
  width: min(100vw - 2rem, 1920px);
  margin-left: 50%;
  transform: translateX(-50%);
}

.chart img {
  display: block;
  width: 100%;
  height: auto;
}

.card {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
}

.card h2 {
  margin-top: 0;
}

.card .chart {
  width: 100%;
  margin: 1rem 0 0;
  transform: none;
}

.headline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.headline div {
  padding: 0.5rem;
  border-radius: 0.25rem;
  background: var(--background);
}

.headline dt {
  font-size: 0.85rem;
  color: var(--muted);
}

.headline dd {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Tabs: radio inputs and labels, one panel per input, no script. */
.tabs > input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.tabs > label {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  cursor: pointer;
}

.tabs > input:checked + label {
  border-color: var(--member);
  background: var(--member);
  color: #ffffff;
}

.tabs > div > div {
  display: none;
  margin-top: 0.5rem;
}

.tabs > input:nth-of-type(1):checked ~ div > div:nth-child(1),
.tabs > input:nth-of-type(2):checked ~ div > div:nth-child(2),
.tabs > input:nth-of-type(3):checked ~ div > div:nth-child(3),
.tabs > input:nth-of-type(4):checked ~ div > div:nth-child(4),
.tabs > input:nth-of-type(5):checked ~ div > div:nth-child(5),
.tabs > input:nth-of-type(6):checked ~ div > div:nth-child(6),
.tabs > input:nth-of-type(7):checked ~ div > div:nth-child(7) {
  display: block;
}

#contributors > div,
#repositories > div {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th,
table.data td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

table.data th:first-child,
table.data td:first-child,
table.data td:nth-child(2) {
  text-align: left;
}

.filters {
  margin: 0 0 0.75rem;
  border: 0;
  padding: 0;
}

.filters legend {
  float: left;
  margin-right: 0.75rem;
  font-weight: 600;
}

.filters label {
  margin-right: 1rem;
}

.badge {
  display: inline-block;
  padding: 0 0.5rem;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  color: #ffffff;
}

/* Text colours keep each badge above 4.5:1 contrast. */
tr[data-class="member"] .badge {
  background: var(--member);
}

tr[data-class="external"] .badge {
  background: var(--external);
  color: var(--text);
}

tr[data-class="org_bot"] .badge {
  background: var(--org-bot);
  color: #000000;
}

tr[data-class="external_bot"] .badge {
  background: var(--external-bot);
  color: #000000;
}

.downloads {
  columns: 12rem auto;
}

footer {
  margin-top: 3rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 40rem) {
  h1 {
    font-size: 1.4rem;
  }

  .chart {
    width: 100%;
    margin-left: 0;
    transform: none;
  }
}
