/* Variable catalogue (docs/data/metadata.md), rendered by assets/js/catalogue.js */

.vc {
  --vc-ink: #27262b;
  --vc-text: #44434d;
  --vc-muted: #6e6b75;
  --vc-line: #e5e2ea;
  --vc-soft: #f6f6f9;
  --vc-accent: #3d8c99;
  --vc-link: #1b69a1;
  --vc-open: #23705f;
  --vc-open-bg: #e2f2ed;
  --vc-ctrl: #8a4f00;
  --vc-ctrl-bg: #fbeedb;
  --vc-arm: #5b4a7a;
  --vc-arm-bg: #efeaf5;
  --vc-mark: #fff1a8;
  margin-top: 1.5rem;
  color: var(--vc-text);
}

/* Domain colours: the site palette */
.vc [data-domain] { --d: #6e6b75; }
.vc [data-domain="clinical"] { --d: #1b69a1; }
.vc [data-domain="methylation"] { --d: #826c9b; }
.vc [data-domain="immune"] { --d: #ec6669; }
.vc [data-domain="metabolome"] { --d: #f39668; }
.vc [data-domain="microbiome"] { --d: #48a0af; }

.vc-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.vc-loading, .vc-error { color: var(--vc-muted); }

.vc button:focus-visible, .vc summary:focus-visible, .vc a:focus-visible, .vc input:focus-visible {
  outline: 2px solid var(--vc-link);
  outline-offset: 2px;
}

/* ---- Domain cards ------------------------------------------------------- */
.vc-domains {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.vc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 1rem 0.75rem 0.8rem;
  overflow: hidden;
  font: inherit;
  text-align: left;
  color: inherit;
  background: #fff;
  border: 1px solid var(--vc-line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.vc-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--d);
}
.vc-card:hover { border-color: var(--d); box-shadow: 0 2px 10px rgba(39, 38, 43, 0.07); }
.vc-card[aria-pressed="true"] {
  border-color: var(--d);
  box-shadow: inset 0 0 0 1px var(--d);
  background: color-mix(in srgb, var(--d) 7%, #fff);
}
.vc-card.is-empty { opacity: 0.45; }
.vc-card-name {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--vc-ink);
}
.vc-card-count {
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1.15;
  color: var(--vc-ink);
  font-variant-numeric: tabular-nums;
}
.vc-card-meta { font-size: 0.75rem; color: var(--vc-muted); }

/* ---- Toolbar ------------------------------------------------------------ */
.vc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem;
  background: var(--vc-soft);
  border: 1px solid var(--vc-line);
  border-radius: 8px;
}
.vc-search { position: relative; flex: 1 1 100%; display: block; }
.vc-search svg {
  position: absolute; left: 0.7rem; top: 50%; width: 1rem; height: 1rem;
  transform: translateY(-50%); color: var(--vc-muted); pointer-events: none;
}
.vc-search input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.2rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--vc-ink);
  background: #fff;
  border: 1px solid var(--vc-line);
  border-radius: 6px;
}
.vc-search input:focus { border-color: var(--vc-accent); }
.vc-filter { display: flex; align-items: center; gap: 0.5rem; }
.vc-filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--vc-muted);
}
.vc-seg {
  display: inline-flex;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--vc-line);
  border-radius: 6px;
}
.vc-seg button {
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  color: var(--vc-text);
  background: none;
  border: 0;
  cursor: pointer;
}
.vc-seg button + button { border-left: 1px solid var(--vc-line); }
.vc-seg button:hover { background: var(--vc-soft); }
.vc-seg button[aria-pressed="true"] { color: #fff; background: var(--vc-accent); }

/* ---- Status line ------------------------------------------------------- */
.vc-status {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0.9rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--vc-muted);
}
.vc-count strong { color: var(--vc-ink); font-weight: 600; }
.vc-actions { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.vc-actions button, .vc-empty button {
  padding: 0;
  font: inherit;
  color: var(--vc-link);
  background: none;
  border: 0;
  cursor: pointer;
}
.vc-actions button:hover, .vc-empty button:hover { text-decoration: underline; }
.vc-actions a { color: var(--vc-link); }

/* ---- Domain groups and layers ----------------------------------------- */
.vc-group { margin-top: 1.75rem; }
.vc .vc-group-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--d);
}
.vc .vc-group-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--vc-ink);
}
.vc .vc-group-head p { margin: 0; font-size: 0.8rem; color: var(--vc-muted); }

.vc-layer {
  margin: 0.5rem 0;
  background: #fff;
  border: 1px solid var(--vc-line);
  border-radius: 8px;
}
.vc-layer > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  padding: 0.65rem 0.9rem;
  list-style: none;
  cursor: pointer;
  border-radius: 8px;
}
.vc-layer > summary::-webkit-details-marker { display: none; }
.vc-layer > summary::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.1rem;
  border-right: 2px solid var(--vc-muted);
  border-bottom: 2px solid var(--vc-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.vc-layer[open] > summary::before { transform: rotate(45deg); }
.vc-layer > summary:hover { background: var(--vc-soft); }
.vc-layer[open] > summary { border-bottom: 1px solid var(--vc-line); border-radius: 8px 8px 0 0; }
.vc-layer-name { flex: 1 1 12rem; font-weight: 600; color: var(--vc-ink); }
.vc-layer-count { font-size: 0.85rem; color: var(--vc-muted); font-variant-numeric: tabular-nums; }
.vc-badges { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }

.vc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  border-radius: 999px;
  color: var(--vc-muted);
  background: var(--vc-soft);
}
.vc-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vc-badge.vc-open { color: var(--vc-open); background: var(--vc-open-bg); }
.vc-badge.vc-controlled { color: var(--vc-ctrl); background: var(--vc-ctrl-bg); }

.vc-arm {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: 0.1em;
  color: var(--vc-arm);
  background: var(--vc-arm-bg);
  border-radius: 4px;
}

/* ---- Variable tables --------------------------------------------------- */
.vc-tablewrap { overflow-x: auto; }
.vc .vc-table {
  display: table;
  width: 100%;
  min-width: 0;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.vc .vc-table th, .vc .vc-table td {
  min-width: 0;
  padding: 0.5rem 0.9rem;
  text-align: left;
  vertical-align: top;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--vc-line);
}
.vc .vc-table thead th {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--vc-muted);
  background: var(--vc-soft);
}
.vc .vc-table tbody th { font-weight: 400; }
.vc .vc-table tbody tr:last-child > * { border-bottom: 0; }
.vc .vc-table .vc-x { width: 2.25rem; padding-left: 0; padding-right: 0.6rem; text-align: right; }
.vc-row.has-detail { cursor: pointer; }
.vc-row:hover > * { background: var(--vc-soft); }
.vc-label { color: var(--vc-ink); }
.vc-code {
  display: block;
  margin-top: 0.1rem;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--vc-muted);
  word-break: break-all;
}
.vc-num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.vc-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  color: var(--vc-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}
.vc-expand svg { width: 0.9rem; height: 0.9rem; transition: transform 0.15s; }
.vc-expand[aria-expanded="true"] svg { transform: rotate(180deg); }
.vc-row:hover .vc-expand { border-color: var(--vc-line); background: #fff; }

.vc .vc-detail > td { padding: 0.75rem 1rem 0.9rem 1.5rem; background: #fbfbfd; }
.vc .vc-dl {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0;
  font-size: 0.82rem;
}
.vc .vc-dl dt {
  grid-column: 1;
  margin: 0;
  font-weight: 500;
  text-align: left;
  color: var(--vc-muted);
}
.vc .vc-dl dt::after { content: none; }
.vc .vc-dl dd { grid-column: 2; margin: 0; color: var(--vc-ink); overflow-wrap: anywhere; }

.vc-more {
  display: block;
  width: 100%;
  padding: 0.55rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--vc-link);
  background: var(--vc-soft);
  border: 0;
  border-top: 1px solid var(--vc-line);
  border-radius: 0 0 8px 8px;
  cursor: pointer;
}
.vc-more:hover { text-decoration: underline; }

.vc .vc-rrid {
  display: inline;
  margin-left: 0.3rem;
  padding: 0.05rem 0.35rem;
  vertical-align: baseline;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  white-space: nowrap;
  text-decoration: none;
  color: var(--vc-link);
  background: #eaf2f8;
  border-radius: 4px;
}
.vc .vc-rrid:hover { text-decoration: underline; }

.vc mark { padding: 0 1px; color: inherit; background: var(--vc-mark); border-radius: 2px; }

.vc-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--vc-muted);
  border: 1px dashed var(--vc-line);
  border-radius: 8px;
}
.vc-empty p { margin: 0 0 0.5rem; }
.vc-source { margin-top: 1.5rem; font-size: 0.75rem; color: var(--vc-muted); }

@media (max-width: 40rem) {
  .vc-filter { flex-wrap: wrap; }
  .vc .vc-dl { grid-template-columns: 1fr; gap: 0.1rem; }
  .vc .vc-dl dt, .vc .vc-dl dd { grid-column: 1; }
  .vc .vc-dl dd { margin-bottom: 0.4rem; }
}
